diff --git a/frontend/packages/vkt/public/i18n/fi-FI/public.json b/frontend/packages/vkt/public/i18n/fi-FI/public.json index 23469f1df..a2c790f90 100644 --- a/frontend/packages/vkt/public/i18n/fi-FI/public.json +++ b/frontend/packages/vkt/public/i18n/fi-FI/public.json @@ -33,7 +33,8 @@ "title": "Peru ilmoittautuminen" }, "enrollToQueue": "Ilmoittaudu jonoon", - "pay": "Siirry maksamaan" + "pay": "Siirry maksamaan", + "enroll": "Ilmoittaudu" }, "examEventDetails": { "enrollmentToQueue": "ilmoittautuminen jonoon", @@ -53,7 +54,8 @@ "reservationInfoText": "Jos ilmoittautumisesi on kesken, paina \"Jatka ilmoittautumista\"." }, "paymentSum": { - "title": "Tutkintomaksu" + "title": "Tutkintomaksu", + "free": "Ilmainen" }, "stepHeading": { "common": { @@ -139,6 +141,13 @@ "lastName": "Sukunimi", "title": "Henkilötietosi" }, + "educationDetails": { + "education": "Koulutus", + "no": "Ei", + "highschool": "Ylioppilastutkinto tai vastaava ulkomaalainen tutkinto", + "college": "Korkeakoulututkinto", + "collegeEnrolled": "Olen kirjoilla korkeakoulussa" + }, "preview": { "certificateShippingDetails": { "addressLabel": "Toimitusosoite", diff --git a/frontend/packages/vkt/src/components/publicEnrollment/PublicEnrollmentDesktopGrid.tsx b/frontend/packages/vkt/src/components/publicEnrollment/PublicEnrollmentDesktopGrid.tsx index 601e5c2d1..716e505f5 100644 --- a/frontend/packages/vkt/src/components/publicEnrollment/PublicEnrollmentDesktopGrid.tsx +++ b/frontend/packages/vkt/src/components/publicEnrollment/PublicEnrollmentDesktopGrid.tsx @@ -61,6 +61,9 @@ export const PublicEnrollmentDesktopGrid = ({ const isEnrollmentSubmitLoading = enrollmentSubmitStatus === APIResponseStatus.InProgress; + const includePaymentStep = + ExamEventUtils.hasOpenings(examEvent) && !enrollment.isFree; + return ( <> @@ -79,7 +82,7 @@ export const PublicEnrollmentDesktopGrid = ({ > {reservation && !isPreviewPassed && ( void; +}) => { + const { t } = usePublicTranslation({ + keyPrefix: 'vkt.component.publicEnrollment.steps.educationDetails', + }); + + const handleRadioChange = () => { + handleChange(true); + }; + + return ( +
+

Koulutustiedot

+
+ + + {t('education')} + + + + + } + label={t('no')} + /> + } + label={t('highschool')} + /> + } + label={t('college')} + /> + } + label={t('collegeEnrolled')} + /> + + +
+
+ ); +}; diff --git a/frontend/packages/vkt/src/components/publicEnrollment/steps/FillContactDetails.tsx b/frontend/packages/vkt/src/components/publicEnrollment/steps/FillContactDetails.tsx index 6acfb0cee..4cd691e7d 100644 --- a/frontend/packages/vkt/src/components/publicEnrollment/steps/FillContactDetails.tsx +++ b/frontend/packages/vkt/src/components/publicEnrollment/steps/FillContactDetails.tsx @@ -4,14 +4,16 @@ import { InputAutoComplete, TextFieldTypes } from 'shared/enums'; import { TextField } from 'shared/interfaces'; import { FieldErrors, getErrors, hasErrors } from 'shared/utils'; +import { EducationDetails } from 'components/publicEnrollment/steps/EducationDetails'; import { PersonDetails } from 'components/publicEnrollment/steps/PersonDetails'; import { useCommonTranslation, usePublicTranslation } from 'configs/i18n'; -import { useAppDispatch } from 'configs/redux'; +import { useAppDispatch, useAppSelector } from 'configs/redux'; import { PublicEnrollment, PublicEnrollmentContactDetails, } from 'interfaces/publicEnrollment'; import { updatePublicEnrollment } from 'redux/reducers/publicEnrollment'; +import { featureFlagsSelector } from 'redux/selectors/featureFlags'; const fields: Array> = [ { @@ -69,6 +71,7 @@ export const FillContactDetails = ({ keyPrefix: 'vkt.component.publicEnrollment.steps.fillContactDetails', }); const translateCommon = useCommonTranslation(); + const { freeEnrollmentAllowed } = useAppSelector(featureFlagsSelector); const [dirtyFields, setDirtyFields] = useState< Array @@ -106,6 +109,14 @@ export const FillContactDetails = ({ ); }; + const handleEducationChange = (isFree: boolean) => { + dispatch( + updatePublicEnrollment({ + isFree, + }), + ); + }; + const handleBlur = (fieldName: keyof PublicEnrollmentContactDetails) => () => { if (!dirtyFields.includes(fieldName)) { @@ -173,6 +184,9 @@ export const FillContactDetails = ({ type={TextFieldTypes.PhoneNumber} autoComplete={InputAutoComplete.PhoneNumber} /> + {freeEnrollmentAllowed && ( + + )} ); }; diff --git a/frontend/packages/vkt/src/interfaces/featureFlags.ts b/frontend/packages/vkt/src/interfaces/featureFlags.ts index 7e2a7bd08..b56e45771 100644 --- a/frontend/packages/vkt/src/interfaces/featureFlags.ts +++ b/frontend/packages/vkt/src/interfaces/featureFlags.ts @@ -2,4 +2,4 @@ export interface FeatureFlags { freeEnrollmentAllowed: boolean; } -export interface FeatureFlagsResponse extends Partial {}; \ No newline at end of file +export interface FeatureFlagsResponse extends Partial {} diff --git a/frontend/packages/vkt/src/redux/reducers/publicEnrollment.ts b/frontend/packages/vkt/src/redux/reducers/publicEnrollment.ts index e1ea7edb4..22fa4e7ec 100644 --- a/frontend/packages/vkt/src/redux/reducers/publicEnrollment.ts +++ b/frontend/packages/vkt/src/redux/reducers/publicEnrollment.ts @@ -33,7 +33,7 @@ export const initialState: PublicEnrollmentState = { email: '', emailConfirmation: '', phoneNumber: '', - isFree: true, + isFree: false, oralSkill: false, textualSkill: false, understandingSkill: false, diff --git a/frontend/packages/vkt/src/styles/components/publicEnrollment/_public-enrollment.scss b/frontend/packages/vkt/src/styles/components/publicEnrollment/_public-enrollment.scss index e1806f549..5173ce167 100644 --- a/frontend/packages/vkt/src/styles/components/publicEnrollment/_public-enrollment.scss +++ b/frontend/packages/vkt/src/styles/components/publicEnrollment/_public-enrollment.scss @@ -35,6 +35,10 @@ } } + &__education-details { + border: 0; + } + &__previous-enrollment { width: calc(50% - 1rem);