From 20eea5b128aa6bb106d9c3900a640f43191d7eb1 Mon Sep 17 00:00:00 2001 From: Robert Bond Date: Mon, 13 Apr 2026 10:59:27 +0000 Subject: [PATCH] Merged PR 2238: refactor(newappeal): extract BuildCheckSection presentation components (Slice 5) refactor(newappeal): extract BuildCheckSection presentation components (Slice 5) Related work items: #22586 --- .../buildCheckSection/CheckSectionHeading.js | 5 + .../ConfirmationCheckboxGroup.js | 63 +++++++ .../buildCheckSection/DocsOfflineNotice.js | 19 ++ .../buildCheckSection/FinalisingStatePanel.js | 11 ++ .../buildCheckSection/SectionReviewList.js | 5 + .../buildCheckSection/SubmitActionsPanel.js | 5 + components/newappeal/buildchecksection.js | 169 ++++++------------ context/refactor-tracker.md | 4 +- 8 files changed, 167 insertions(+), 114 deletions(-) create mode 100644 components/newappeal/buildCheckSection/CheckSectionHeading.js create mode 100644 components/newappeal/buildCheckSection/ConfirmationCheckboxGroup.js create mode 100644 components/newappeal/buildCheckSection/DocsOfflineNotice.js create mode 100644 components/newappeal/buildCheckSection/FinalisingStatePanel.js create mode 100644 components/newappeal/buildCheckSection/SectionReviewList.js create mode 100644 components/newappeal/buildCheckSection/SubmitActionsPanel.js diff --git a/components/newappeal/buildCheckSection/CheckSectionHeading.js b/components/newappeal/buildCheckSection/CheckSectionHeading.js new file mode 100644 index 00000000..7e79ef5c --- /dev/null +++ b/components/newappeal/buildCheckSection/CheckSectionHeading.js @@ -0,0 +1,5 @@ +const CheckSectionHeading = ({ title }) => { + return

{title}

; +}; + +export default CheckSectionHeading; diff --git a/components/newappeal/buildCheckSection/ConfirmationCheckboxGroup.js b/components/newappeal/buildCheckSection/ConfirmationCheckboxGroup.js new file mode 100644 index 00000000..1131649e --- /dev/null +++ b/components/newappeal/buildCheckSection/ConfirmationCheckboxGroup.js @@ -0,0 +1,63 @@ +const ConfirmationCheckboxGroup = ({ + downloadAppealForm, + onDownloadChange, + onConfirmChange, + downloadLabel, + confirmLabel, + paragraphOne, + paragraphTwo, + paragraphTwoLink +}) => { + return ( +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+

{paragraphOne}

+
+
+

+ {paragraphTwo} {paragraphTwoLink} +

+
+
+ ); +}; + +export default ConfirmationCheckboxGroup; diff --git a/components/newappeal/buildCheckSection/DocsOfflineNotice.js b/components/newappeal/buildCheckSection/DocsOfflineNotice.js new file mode 100644 index 00000000..b67d1d3c --- /dev/null +++ b/components/newappeal/buildCheckSection/DocsOfflineNotice.js @@ -0,0 +1,19 @@ +const DocsOfflineNotice = ({ noticeText, returnLink }) => { + return ( + <> +
+ + + Notice + {noticeText} + {" "} + +
{" "} + {returnLink} + + ); +}; + +export default DocsOfflineNotice; diff --git a/components/newappeal/buildCheckSection/FinalisingStatePanel.js b/components/newappeal/buildCheckSection/FinalisingStatePanel.js new file mode 100644 index 00000000..f64552bd --- /dev/null +++ b/components/newappeal/buildCheckSection/FinalisingStatePanel.js @@ -0,0 +1,11 @@ +const FinalisingStatePanel = ({ heading, label, waitLabel }) => { + return ( +
+

{heading}

+

{label}

+

{waitLabel}

+
+ ); +}; + +export default FinalisingStatePanel; diff --git a/components/newappeal/buildCheckSection/SectionReviewList.js b/components/newappeal/buildCheckSection/SectionReviewList.js new file mode 100644 index 00000000..a20e0dce --- /dev/null +++ b/components/newappeal/buildCheckSection/SectionReviewList.js @@ -0,0 +1,5 @@ +const SectionReviewList = ({ children }) => { + return
{children}
; +}; + +export default SectionReviewList; diff --git a/components/newappeal/buildCheckSection/SubmitActionsPanel.js b/components/newappeal/buildCheckSection/SubmitActionsPanel.js new file mode 100644 index 00000000..682e1221 --- /dev/null +++ b/components/newappeal/buildCheckSection/SubmitActionsPanel.js @@ -0,0 +1,5 @@ +const SubmitActionsPanel = ({ children }) => { + return
{children}
; +}; + +export default SubmitActionsPanel; diff --git a/components/newappeal/buildchecksection.js b/components/newappeal/buildchecksection.js index ea49e687..ea90fe51 100644 --- a/components/newappeal/buildchecksection.js +++ b/components/newappeal/buildchecksection.js @@ -26,6 +26,12 @@ import { generateAppealPDFEffect, sendCaseCompleteMessageEffect } from "../../lib/newappeal/journeyEffects"; +import CheckSectionHeading from "./buildCheckSection/CheckSectionHeading"; +import ConfirmationCheckboxGroup from "./buildCheckSection/ConfirmationCheckboxGroup"; +import DocsOfflineNotice from "./buildCheckSection/DocsOfflineNotice"; +import FinalisingStatePanel from "./buildCheckSection/FinalisingStatePanel"; +import SectionReviewList from "./buildCheckSection/SectionReviewList"; +import SubmitActionsPanel from "./buildCheckSection/SubmitActionsPanel"; let BuildCheckSection = (props) => { useEffect(() => { @@ -242,10 +248,8 @@ let BuildCheckSection = (props) => {
-

- Are these answers correct? -

-
+ + {Object.keys(titles).map((key) => (

@@ -263,7 +267,7 @@ let BuildCheckSection = (props) => { />

))} -
+ {/*
{buildAppealFilesArray.length > 0 ? buildAppealFilesArray.map((blob, i) => { @@ -318,120 +322,61 @@ let BuildCheckSection = (props) => {
*/}
{finaliseAppealProcess ? ( -
-

- {t("newappeal:new-appeal-finalising-heading")} -

-

- {t("newappeal:new-appeal-finalising-label")} -

-

- {t("newappeal:new-appeal-wait-label")} -

-
+ ) : ( <> -
-
-
-
- { - setDownloadAppealForm( - e.target.checked - ); - }} - /> - -
-
-
-
- { - setConfirmSections( - !confirmSections - ); - }} - /> - -
-
-
-
-

- {t( - "newappeal:new-appeal-check-confirm-paragraph-one" + { + setDownloadAppealForm(e.target.checked); + }} + onConfirmChange={(e) => { + setConfirmSections(!confirmSections); + }} + downloadLabel={t( + "newappeal:new-appeal-check-download-label" + )} + confirmLabel={t( + "newappeal:new-appeal-check-confirm-label" + )} + paragraphOne={t( + "newappeal:new-appeal-check-confirm-paragraph-one" + )} + paragraphTwo={t( + "newappeal:new-appeal-check-confirm-paragraph-two" + )} + paragraphTwoLink={ + -

-
-

+ > {t( - "newappeal:new-appeal-check-confirm-paragraph-two" - )}{" "} - - {t( - "newappeal:new-appeal-check-confirm-paragraph-two-link" - )} - -

-
-
+ "newappeal:new-appeal-check-confirm-paragraph-two-link" + )} + + } + /> -
+ {ShowDocLinks ? ( - <> -
- - - - Notice - + {t( - "myportal:docsoffline-newappeal-label" + "newappeal:return-to-myportal-link" )} - {" "} - -
{" "} - - {t("newappeal:return-to-myportal-link")} - - + + } + /> ) : ( <>
+ )}
diff --git a/context/refactor-tracker.md b/context/refactor-tracker.md index 12a50e49..f69b2f94 100644 --- a/context/refactor-tracker.md +++ b/context/refactor-tracker.md @@ -4,7 +4,7 @@ Base branch for this tracker: `refactor` ## Status -Current slice: Slice 5 — BuildCheckSection UI Extraction +Current slice: Slice 6 — BuildCheckRow Formatter Map Status: READY TO START --- @@ -56,7 +56,7 @@ Status: COMPLETE ### Slice 5 — BuildCheckSection UI Extraction -Status: NOT STARTED +Status: COMPLETE ---