diff --git a/public/locales/de/translations.json b/public/locales/de/translations.json index 9e5c2af7..6f5e276c 100644 --- a/public/locales/de/translations.json +++ b/public/locales/de/translations.json @@ -1025,6 +1025,7 @@ "accompanyingDetailsTitle": "Begleitdetails", "accompanyingDetails": { "appointmentAddress": "Terminadresse", + "appointmentPostcode": "Terminpostleitzahl", "appointmentDate": "Termindatum", "appointmentTime": "Terminzeit", "refugeeNumber": "Geflüchtetennummer", diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index e3f0914d..cd43ae8c 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -1024,6 +1024,7 @@ "accompanyingDetailsTitle": "Accompanying details", "accompanyingDetails": { "appointmentAddress": "Appointment address", + "appointmentPostcode": "Appointment postcode", "appointmentDate": "Appointment date", "appointmentTime": "Appointment time", "refugeeNumber": "Refugee number", diff --git a/src/components/Dashboard/Profile/sections/AccompanyingDetails/AccompanyingDetailsDisplay.tsx b/src/components/Dashboard/Profile/sections/AccompanyingDetails/AccompanyingDetailsDisplay.tsx index 64e9d9fd..1a22ae05 100644 --- a/src/components/Dashboard/Profile/sections/AccompanyingDetails/AccompanyingDetailsDisplay.tsx +++ b/src/components/Dashboard/Profile/sections/AccompanyingDetails/AccompanyingDetailsDisplay.tsx @@ -23,6 +23,14 @@ export const AccompanyingDetailsDisplay = ({ values, languageLabel }: Props) => setValue={() => {}} /> + {}} + /> + {values.appointmentDate ? format(values.appointmentDate, "dd.MM.yyyy") : EMPTY_PLACEHOLDER_VALUE} diff --git a/src/components/Dashboard/Profile/sections/AccompanyingDetails/AccompanyingDetailsEdit.tsx b/src/components/Dashboard/Profile/sections/AccompanyingDetails/AccompanyingDetailsEdit.tsx index bcff065b..dce6d0b9 100644 --- a/src/components/Dashboard/Profile/sections/AccompanyingDetails/AccompanyingDetailsEdit.tsx +++ b/src/components/Dashboard/Profile/sections/AccompanyingDetails/AccompanyingDetailsEdit.tsx @@ -60,6 +60,21 @@ export const AccompanyingDetailsEdit = ({ )} /> + }) => ( + + )} + /> + {errors.appointmentTime && ( - {t( - `dashboard.opportunityProfile.accompanyingDetails.validation.${errors.appointmentTime.message}`, - )} + {t(`dashboard.opportunityProfile.accompanyingDetails.validation.${errors.appointmentTime.message}`)} )} diff --git a/src/components/Dashboard/Profile/sections/AccompanyingDetails/accompanyingDetailsSchema.ts b/src/components/Dashboard/Profile/sections/AccompanyingDetails/accompanyingDetailsSchema.ts index f36c634c..558db99c 100644 --- a/src/components/Dashboard/Profile/sections/AccompanyingDetails/accompanyingDetailsSchema.ts +++ b/src/components/Dashboard/Profile/sections/AccompanyingDetails/accompanyingDetailsSchema.ts @@ -4,6 +4,7 @@ const timeRegex = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/; export const accompanyingDetailsSchema = z.object({ appointmentAddress: z.string().optional(), + appointmentPostcode: z.string().optional(), appointmentDate: z.date().nullable().optional(), appointmentTime: z .string() diff --git a/src/components/Dashboard/Profile/sections/AccompanyingDetails/helpers.ts b/src/components/Dashboard/Profile/sections/AccompanyingDetails/helpers.ts index 26c76c85..e1140a02 100644 --- a/src/components/Dashboard/Profile/sections/AccompanyingDetails/helpers.ts +++ b/src/components/Dashboard/Profile/sections/AccompanyingDetails/helpers.ts @@ -38,6 +38,8 @@ export const getInitialFormValues = ( details: ApiOpportunityAccompanyingDetails | undefined, ): AccompanyingDetailsFormData => ({ appointmentAddress: details?.appointmentAddress || "", + appointmentPostcode: + (details as ApiOpportunityAccompanyingDetails & { appointmentPostcode?: string })?.appointmentPostcode || "", appointmentDate: parseDate(details?.appointmentDate), appointmentTime: parseTime(details?.appointmentTime), refugeeNumber: details?.refugeeNumber || "",