diff --git a/business-registry-dashboard/app/components/Table/AffiliatedEntity/StatusDetails.vue b/business-registry-dashboard/app/components/Table/AffiliatedEntity/StatusDetails.vue index 452c2bc..d546d3a 100644 --- a/business-registry-dashboard/app/components/Table/AffiliatedEntity/StatusDetails.vue +++ b/business-registry-dashboard/app/components/Table/AffiliatedEntity/StatusDetails.vue @@ -47,16 +47,24 @@ const entityAlertMessages: Record = { message: t(`entityAlertTypes.${EntityAlertTypes.DISSOLUTION}`), colour: 'text-red-600', priority: 1 - }, - [EntityAlertTypes.EXPIRED]: { - message: t(`entityAlertTypes.${EntityAlertTypes.EXPIRED}`), - colour: 'text-red-600', - priority: 5 } } -const generateMessage = (status: string): Message | null => { - return entityAlertMessages[status] || null +const generateMessage = (status: string | { type: string, data: any }): Message | null => { + if (typeof status === 'string') { + return entityAlertMessages[status] || null + } + + // Handle EXPIRED case with dynamic type + if (status.type === EntityAlertTypes.EXPIRED) { + return { + message: t(`entityAlertTypes.${EntityAlertTypes.EXPIRED}`, status.data), + colour: 'text-red-600', + priority: 5 + } + } + + return null } const makeMessages = () => { diff --git a/business-registry-dashboard/app/locales/en-CA.ts b/business-registry-dashboard/app/locales/en-CA.ts index 86b6fb7..eceb290 100644 --- a/business-registry-dashboard/app/locales/en-CA.ts +++ b/business-registry-dashboard/app/locales/en-CA.ts @@ -180,13 +180,19 @@ export default { description: 'The link appears to be entered incorrectly. Please go back and click the full link.' } }, + entityTypes: { + registration: 'registration', + incorporationApplication: 'incorporation application', + amalgamationApplication: 'amalgamation application', + continuationApplication: 'continuation application' + }, entityAlertTypes: { FROZEN: 'This business is frozen', BAD_STANDING: 'This business is not in good standing', LIQUIDATION: 'This business is in liquidation', DISSOLUTION: 'This business is in the process of being dissolved', - PROCESSING: 'This name request is still processing, it may take up to 10 minutes.', - EXPIRED: 'This incorporation application is no longer valid; the name request is expired.' + PROCESSING: 'This name request is still processing. It may take up to 10 minutes.', + EXPIRED: 'This {type} is no longer valid; the name request is expired.' }, form: { manageNR: { diff --git a/business-registry-dashboard/app/locales/fr-CA.ts b/business-registry-dashboard/app/locales/fr-CA.ts index 3436b46..27ad4ee 100644 --- a/business-registry-dashboard/app/locales/fr-CA.ts +++ b/business-registry-dashboard/app/locales/fr-CA.ts @@ -170,13 +170,19 @@ export default { description: 'Le lien semble avoir été mal saisi. Veuillez revenir en arrière et cliquer sur le lien complet.' } }, + entityTypes: { + registration: 'inscription', + incorporationApplication: 'demande de constitution', + amalgamationApplication: 'demande de fusion', + continuationApplication: 'demande de continuation' + }, entityAlertTypes: { FROZEN: 'Cette entreprise est gelée', BAD_STANDING: "Cette entreprise n'est pas en règle", LIQUIDATION: 'Cette entreprise est en liquidation', DISSOLUTION: 'Cette entreprise est en cours de dissolution', PROCESSING: "Cette demande de dénomination est encore en cours de traitement, cela peut prendre jusqu'à 10 minutes.", - EXPIRED: "Cette demande d'incorporation n'est plus valide; la demande de dénomination est expirée." + EXPIRED: "Cette {type} n'est plus valide; la demande de nom est expirée." }, form: { manageNR: { diff --git a/business-registry-dashboard/app/pages/incorporateNow.vue b/business-registry-dashboard/app/pages/incorporateNow.vue index 27e61da..c3f0c05 100644 --- a/business-registry-dashboard/app/pages/incorporateNow.vue +++ b/business-registry-dashboard/app/pages/incorporateNow.vue @@ -111,11 +111,11 @@ onMounted(async () => { await affNav.goToDashboard(identifier) } } catch (error) { - // All errors are handled with a generic error modal + // All errors are handled with the incorporate now error modal console.error('Error in incorporate flow:', error) brdModal.openMagicLinkModal( - t('error.magicLinkGenericError.title'), - t('error.magicLinkGenericError.description') + t('error.magicLinkIncorporateNowError.title'), + t('error.magicLinkIncorporateNowError.description') ) } finally { isLoading.value = false diff --git a/business-registry-dashboard/app/utils/affiliations.ts b/business-registry-dashboard/app/utils/affiliations.ts index 8ed5296..6b2d8a7 100644 --- a/business-registry-dashboard/app/utils/affiliations.ts +++ b/business-registry-dashboard/app/utils/affiliations.ts @@ -153,9 +153,17 @@ export const isDissolution = (item: Business) => { } export const getDetails = (item: Business): EntityAlertTypes[] => { + const { t } = useNuxtApp().$i18n const details = [] if (isExpired(item)) { - details.push(EntityAlertTypes.EXPIRED) + const typeMap = { + [CorpTypes.REGISTRATION]: t('entityTypes.registration'), + [CorpTypes.INCORPORATION_APPLICATION]: t('entityTypes.incorporationApplication'), + [CorpTypes.AMALGAMATION_APPLICATION]: t('entityTypes.amalgamationApplication'), + [CorpTypes.CONTINUATION_IN]: t('entityTypes.continuationApplication') + } + const type = typeMap[item.corpType?.code] || t('entityTypes.incorporationApplication') + details.push({ type: EntityAlertTypes.EXPIRED, data: { type } }) } if (isFrozed(item)) { details.push(EntityAlertTypes.FROZEN) diff --git a/business-registry-dashboard/package.json b/business-registry-dashboard/package.json index 2539475..261dcc5 100644 --- a/business-registry-dashboard/package.json +++ b/business-registry-dashboard/package.json @@ -2,7 +2,7 @@ "name": "business-registry-dashboard", "private": true, "type": "module", - "version": "0.0.9", + "version": "0.0.10", "scripts": { "build-check": "nuxt build", "build": "nuxt generate",