diff --git a/frontend/app/.server/locales/protected-en.json b/frontend/app/.server/locales/protected-en.json index 29092516..ea6a47ce 100644 --- a/frontend/app/.server/locales/protected-en.json +++ b/frontend/app/.server/locales/protected-en.json @@ -394,10 +394,15 @@ }, "review": { "page-title": "Review", + "sub-title-preferred-name": "Preferred name", "read-carefully": "Review information below for accuracy before creating case.", "document-uploaded": "Document uploaded", "choosen-file": "File_chosen.pdf", - "edit-primary-identity-document": "Edit primary identity document" + "yes": "Yes", + "no": "No", + "edit-primary-identity-document": "Edit primary identity document", + "edit-secondary-identity-document": "Edit secondary identity document", + "edit-current-name": "Edit current name" }, "search-sin": { "page-title": "Search for a SIN", diff --git a/frontend/app/.server/locales/protected-fr.json b/frontend/app/.server/locales/protected-fr.json index 21553bd7..c01b3449 100644 --- a/frontend/app/.server/locales/protected-fr.json +++ b/frontend/app/.server/locales/protected-fr.json @@ -395,10 +395,15 @@ }, "review": { "page-title": "Review", + "sub-title-preferred-name": "Nom préféré", "read-carefully": "Veuillez examiner les informations ci-dessous pour en vérifier l'exactitude avant de créer le dossier.", "document-uploaded": "Document téléchargé", "choosen-file": "Fichier_choisi.pdf", - "edit-primary-identity-document": "Modifier le document d'identité principal" + "yes": "Oui", + "no": "Non", + "edit-primary-identity-document": "Modifier le document d'identité principal", + "edit-secondary-identity-document": "Modifier le document d'identité secondaire", + "edit-current-name": "Modifier le nom actuel" }, "search-sin": { "page-title": "Search for a SIN", diff --git a/frontend/app/routes/protected/person-case/contact-information.tsx b/frontend/app/routes/protected/person-case/contact-information.tsx index 7bfb7a45..ee8c65b1 100644 --- a/frontend/app/routes/protected/person-case/contact-information.tsx +++ b/frontend/app/routes/protected/person-case/contact-information.tsx @@ -148,9 +148,9 @@ export async function action({ context, request }: Route.ActionArgs) { (context.session.inPersonSINCase ??= {}).contactInformation = parseResult.output; - throw i18nRedirect('routes/protected/person-case/primary-docs.tsx', request, { + throw i18nRedirect('routes/protected/person-case/review.tsx', request, { search: new URLSearchParams({ tid: tabId }), - }); // TODO: change to proper route + }); } default: { diff --git a/frontend/app/routes/protected/person-case/review.tsx b/frontend/app/routes/protected/person-case/review.tsx index b156ffc0..fe196370 100644 --- a/frontend/app/routes/protected/person-case/review.tsx +++ b/frontend/app/routes/protected/person-case/review.tsx @@ -8,11 +8,12 @@ import { useTranslation } from 'react-i18next'; import type { Info, Route } from './+types/review'; +import { applicantGenderService } from '~/.server/domain/person-case/services'; import { requireAuth } from '~/.server/utils/auth-utils'; import { i18nRedirect } from '~/.server/utils/route-utils'; import { Button } from '~/components/button'; -import { ButtonLink } from '~/components/button-link'; import { DescriptionList, DescriptionListItem } from '~/components/description-list'; +import { InlineLink } from '~/components/links'; import { PageTitle } from '~/components/page-title'; import { AppError } from '~/errors/app-error'; import { ErrorCodes } from '~/errors/error-codes'; @@ -29,10 +30,20 @@ export async function loader({ context, request }: Route.LoaderArgs) { const tabId = new URL(request.url).searchParams.get('tid'); if (!tabId) throw new AppError('Missing tab id', ErrorCodes.MISSING_TAB_ID, { httpStatusCode: 400 }); - const { t } = await getTranslation(request, handle.i18nNamespace); + const { t, lang } = await getTranslation(request, handle.i18nNamespace); const inPersonSINCase = validateInPersonSINCaseSession(context.session, tabId, request); - return { documentTitle: t('protected:review.page-title'), inPersonSINCase, tabId }; + return { + documentTitle: t('protected:review.page-title'), + inPersonSINCase: { + ...inPersonSINCase, + primaryDocuments: { + ...inPersonSINCase.primaryDocuments, + genderName: applicantGenderService.getLocalizedApplicantGenderById(inPersonSINCase.primaryDocuments.gender, lang).name, + }, + }, + tabId, + }; } function validateInPersonSINCaseSession( @@ -176,13 +187,12 @@ export default function Review({ loaderData, actionData, params }: Route.Compone
{t('protected:review.read-carefully')}
-- {/* TODO: Code Table Value */} {t( `protected:primary-identity-document.current-status-in-canada.options.${inPersonSINCase.primaryDocuments.currentStatusInCanada}` as 'protected:primary-identity-document.current-status-in-canada.options.select-option', )} @@ -190,7 +200,6 @@ export default function Review({ loaderData, actionData, params }: Route.Compone
- {/* TODO: Code Table Value */} {t( `protected:primary-identity-document.document-type.options.${inPersonSINCase.primaryDocuments.documentType}` as 'protected:primary-identity-document.document-type.options.select-option', )} @@ -212,7 +221,7 @@ export default function Review({ loaderData, actionData, params }: Route.Compone
{inPersonSINCase.primaryDocuments.dateOfBirth}
{inPersonSINCase.primaryDocuments.gender}
+{inPersonSINCase.primaryDocuments.genderName}
{inPersonSINCase.primaryDocuments.citizenshipDate}
@@ -221,14 +230,89 @@ export default function Review({ loaderData, actionData, params }: Route.Compone{t('protected:review.choosen-file')}
+ {t( + `protected:secondary-identity-document.document-type.options.${inPersonSINCase.secondaryDocument.documentType}` as 'protected:primary-identity-document.document-type.options.select-option', + )} +
+{inPersonSINCase.secondaryDocument.expiryDate}
+{t('protected:review.choosen-file')}
++ {inPersonSINCase.currentNameInfo.preferredSameAsDocumentName + ? t('protected:review.yes') + : t('protected:review.no')} +
++ {inPersonSINCase.currentNameInfo.preferredSameAsDocumentName + ? inPersonSINCase.primaryDocuments.givenName + : inPersonSINCase.currentNameInfo.firstName} +
+{inPersonSINCase.currentNameInfo.middleName}
} ++ {inPersonSINCase.currentNameInfo.preferredSameAsDocumentName + ? inPersonSINCase.primaryDocuments.lastName + : inPersonSINCase.currentNameInfo.lastName} +
++ {inPersonSINCase.currentNameInfo.preferredSameAsDocumentName === false && + inPersonSINCase.currentNameInfo.supportingDocuments.required + ? t('protected:review.yes') + : t('protected:review.no')} +
+