From 3d033ccaf90cde42c9b56f6aa6977fe9732b4415 Mon Sep 17 00:00:00 2001 From: Daniel Naab Date: Thu, 29 Feb 2024 08:55:05 -0600 Subject: [PATCH] Style the submission confirmation pattern (#57) --- .../view/SubmissionConfirmation/index.tsx | 69 ++++++++++++++----- .../forms/src/config/elements/form-summary.ts | 2 +- packages/forms/src/pattern.ts | 16 +++-- 3 files changed, 64 insertions(+), 23 deletions(-) diff --git a/packages/design/src/config/view/SubmissionConfirmation/index.tsx b/packages/design/src/config/view/SubmissionConfirmation/index.tsx index 33da21b5..bd771687 100644 --- a/packages/design/src/config/view/SubmissionConfirmation/index.tsx +++ b/packages/design/src/config/view/SubmissionConfirmation/index.tsx @@ -11,24 +11,59 @@ const SubmissionConfirmation: FormElementComponent< Submission confirmation - - - - - - - - - {pattern.table.map((row, index) => { - return ( - - - +
+
+

Submission complete

+

+ Thank you for submitting your filing. Your document package has been + auto-downloaded. +

+
+
+

Next steps:

+
+ +
+
+

+ +

+
FieldValue
{row.label}{row.value}
+ + + + - ); - })} - -
Form fieldProvided value
+ + + {pattern.table.map((row, index) => { + return ( + + {row.label} + {row.value} + + ); + })} + + + + ); }; diff --git a/packages/forms/src/config/elements/form-summary.ts b/packages/forms/src/config/elements/form-summary.ts index 4056510a..c1181189 100644 --- a/packages/forms/src/config/elements/form-summary.ts +++ b/packages/forms/src/config/elements/form-summary.ts @@ -31,7 +31,7 @@ export const formSummaryConfig: FormElementConfig = { type: 'form-summary', title: element.data.title, description: element.data.description, - } as FormSummaryPattern, + } as Pattern, children: [], }; }, diff --git a/packages/forms/src/pattern.ts b/packages/forms/src/pattern.ts index d06bffec..7657ee57 100644 --- a/packages/forms/src/pattern.ts +++ b/packages/forms/src/pattern.ts @@ -80,14 +80,20 @@ export const createPrompt = ( pattern: { _elementId: 'submission-confirmation', type: 'submission-confirmation', - table: Object.entries(session.data.values).map( - ([elementId, value]) => { + table: Object.entries(session.data.values) + .filter(([elementId, value]) => { + const elemConfig = getFormElementConfig( + config, + session.form.elements[elementId].type + ); + return elemConfig.acceptsInput; + }) + .map(([elementId, value]) => { return { - label: session.form.elements[elementId].id, + label: session.form.elements[elementId].data.label, value: value, }; - } - ), + }), } as Pattern, children: [], },