diff --git a/src/server/plugins/engine/components/FormComponent.ts b/src/server/plugins/engine/components/FormComponent.ts index 04a4a8d04..3cf7c288f 100644 --- a/src/server/plugins/engine/components/FormComponent.ts +++ b/src/server/plugins/engine/components/FormComponent.ts @@ -30,6 +30,7 @@ export class FormComponent extends ComponentBase { type: FormComponentsDef['type'] hint: FormComponentsDef['hint'] label: string + summaryLabel: string isFormComponent = true isAppendageStateSingleObject = false @@ -46,6 +47,7 @@ export class FormComponent extends ComponentBase { this.hint = hint this.label = this.getLabel(def) + this.summaryLabel = this.getSummaryLabel(def) } getLabel(def: FormComponentsDef) { @@ -53,6 +55,10 @@ export class FormComponent extends ComponentBase { return def.errorDescription } + return this.getSummaryLabel(def) + } + + getSummaryLabel(def: FormComponentsDef) { if ('shortDescription' in def && def.shortDescription) { return def.shortDescription } diff --git a/src/server/plugins/engine/models/SummaryViewModel.ts b/src/server/plugins/engine/models/SummaryViewModel.ts index 4faa1370a..2aaf95f89 100644 --- a/src/server/plugins/engine/models/SummaryViewModel.ts +++ b/src/server/plugins/engine/models/SummaryViewModel.ts @@ -228,8 +228,8 @@ export function ItemField( label: field.title, title: field.options.required === false - ? `${field.label} (optional)` - : field.label, + ? `${field.summaryLabel} (optional)` + : field.summaryLabel, error: field.getFirstError(options.errors), value: getAnswer(field, state), href: getPageHref(page, options.path, { diff --git a/src/server/plugins/engine/pageControllers/SummaryPageController.ts b/src/server/plugins/engine/pageControllers/SummaryPageController.ts index 20178d700..fdd088fee 100644 --- a/src/server/plugins/engine/pageControllers/SummaryPageController.ts +++ b/src/server/plugins/engine/pageControllers/SummaryPageController.ts @@ -570,7 +570,7 @@ function getPaymentFieldItems( name: field.name, page, title: field.title, - label: field.label, + label: field.summaryLabel, field, state: context.state, href: page.href,