From 82c8209946fbcc4dcfc9cdc169744e3b78701652 Mon Sep 17 00:00:00 2001 From: Jonni Date: Mon, 16 Dec 2024 16:27:31 +0000 Subject: [PATCH 1/2] feat: option of tabTitle to sections and subsections --- libs/application/types/src/lib/Form.ts | 2 ++ libs/application/ui-shell/src/hooks/useApplicationTitle.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/application/types/src/lib/Form.ts b/libs/application/types/src/lib/Form.ts index e3656d70d405..d33bf25c4c5f 100644 --- a/libs/application/types/src/lib/Form.ts +++ b/libs/application/types/src/lib/Form.ts @@ -110,11 +110,13 @@ export interface Section extends FormItem { type: FormItemTypes.SECTION children: SectionChildren[] draftPageNumber?: number + tabTitle?: string } export interface SubSection extends FormItem { type: FormItemTypes.SUB_SECTION children: FormLeaf[] + tabTitle?: string } export interface Repeater extends FormItem { diff --git a/libs/application/ui-shell/src/hooks/useApplicationTitle.ts b/libs/application/ui-shell/src/hooks/useApplicationTitle.ts index 8f50c7fae3e9..9991cfd270de 100644 --- a/libs/application/ui-shell/src/hooks/useApplicationTitle.ts +++ b/libs/application/ui-shell/src/hooks/useApplicationTitle.ts @@ -32,8 +32,10 @@ export const getApplicationTitle = ( const titleParts = [`${formName} | Ísland.is`] if (activeSection) { + const tabTitle = activeSection.tabTitle + const title = activeSection.title const sectionTitle = formatTextWithLocale( - activeSection.title, + tabTitle || title, state.application, locale as Locale, formatMessage, From be81599729a41b1481c70782c7035f8cd3340d1f Mon Sep 17 00:00:00 2001 From: Jonni Date: Mon, 16 Dec 2024 16:28:05 +0000 Subject: [PATCH 2/2] feat: rathter use FormTextWithLocale --- libs/application/types/src/lib/Form.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/application/types/src/lib/Form.ts b/libs/application/types/src/lib/Form.ts index d33bf25c4c5f..b110eea336b7 100644 --- a/libs/application/types/src/lib/Form.ts +++ b/libs/application/types/src/lib/Form.ts @@ -110,13 +110,13 @@ export interface Section extends FormItem { type: FormItemTypes.SECTION children: SectionChildren[] draftPageNumber?: number - tabTitle?: string + tabTitle?: FormTextWithLocale } export interface SubSection extends FormItem { type: FormItemTypes.SUB_SECTION children: FormLeaf[] - tabTitle?: string + tabTitle?: FormTextWithLocale } export interface Repeater extends FormItem {