From 3d332cb34a7c95ff357486d5f1ae1610d60e323f Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Tue, 17 Sep 2024 15:53:14 -0500 Subject: [PATCH] SC prototype | Start app with action link & fix typo (#31981) * Show start action links in SC prototype * Fix typo * Fix JS when no issues loaded (local testing) --- .../shared/components/ContestableIssues.jsx | 14 +++-- .../sc/containers/IntroductionPage.jsx | 53 ++++++++++++------- .../testing/sc/content/facilityTypes.js | 2 +- 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/src/applications/appeals/shared/components/ContestableIssues.jsx b/src/applications/appeals/shared/components/ContestableIssues.jsx index 973ac9941d22..29e1b033ef97 100644 --- a/src/applications/appeals/shared/components/ContestableIssues.jsx +++ b/src/applications/appeals/shared/components/ContestableIssues.jsx @@ -76,9 +76,10 @@ const ContestableIssues = props => { const inReviewMode = (onReviewPage && formContext.reviewMode) || false; const showCheckbox = !onReviewPage || (onReviewPage && !inReviewMode); const { submitted } = formContext; + const loadedIssues = formData.contestedIssues || []; // combine all issues for viewing - const items = (formData.contestedIssues || []) + const items = loadedIssues .map(item => ({ ...item?.attributes, [SELECTED]: item?.[SELECTED], @@ -123,7 +124,7 @@ const ContestableIssues = props => { setShowErrorModal(true); event.preventDefault(); // prevent checking checked = false; - } else if (index < formData.contestedIssues.length) { + } else if (index < loadedIssues.length) { // contestable issue check toggle const changedItems = set( ['contestedIssues', index, SELECTED], @@ -134,10 +135,7 @@ const ContestableIssues = props => { setFormData(changedItems); } else { // additional issue check toggle - const adjustedIndex = calculateIndexOffset( - index, - formData.contestedIssues.length, - ); + const adjustedIndex = calculateIndexOffset(index, loadedIssues.length); const updatedAdditionalIssues = formData.additionalIssues.map( (issue, indx) => adjustedIndex === indx ? { ...issue, [SELECTED]: checked } : issue, @@ -151,7 +149,7 @@ const ContestableIssues = props => { onShowRemoveModal: cardIndex => { const adjustedIndex = calculateIndexOffset( cardIndex, - formData.contestedIssues.length, + loadedIssues.length, ); setRemoveIndex(adjustedIndex); setShowRemoveModal(true); @@ -160,7 +158,7 @@ const ContestableIssues = props => { focusIssue( null, null, - `${formData.contestedIssues.length + removeIndex},remove-cancel`, + `${loadedIssues.length + removeIndex},remove-cancel`, ); setShowRemoveModal(false); setRemoveIndex(null); diff --git a/src/applications/appeals/testing/sc/containers/IntroductionPage.jsx b/src/applications/appeals/testing/sc/containers/IntroductionPage.jsx index 95d22c9963cb..e6ca7fb145bf 100644 --- a/src/applications/appeals/testing/sc/containers/IntroductionPage.jsx +++ b/src/applications/appeals/testing/sc/containers/IntroductionPage.jsx @@ -5,32 +5,36 @@ import { focusElement } from 'platform/utilities/ui'; import FormTitle from 'platform/forms-system/src/js/components/FormTitle'; import scrollTo from 'platform/utilities/ui/scrollTo'; -import ShowAlertOrSip from '../../../shared/components/ShowAlertOrSip'; +// import ShowAlertOrSip from '../../../shared/components/ShowAlertOrSip'; import OmbInfo from '../content/OmbInfo'; const IntroductionPage = props => { useEffect(() => { focusElement('h1'); scrollTo('topContentElement'); + + // mock logged in state + localStorage.setItem('hasSession', 'true'); + localStorage.setItem('userFirstName', 'Hector'); }, []); - const { route, location } = props; - const { formConfig, pageList } = route; - const { formId, prefillEnabled, savedFormMessages, downtime } = formConfig; + const { route /* , location */ } = props; + const { formConfig /* , pageList */ } = route; + // const { formId, prefillEnabled, savedFormMessages, downtime } = formConfig; - const sipOptions = { - downtime, - formId, - gaStartEventName: 'decision-reviews-va20-0995-start-form', - headingLevel: 2, - hideUnauthedStartLink: false, // true, // once testing is complete - messages: savedFormMessages, - pageList, - pathname: '/introduction', - prefillEnabled, - startText: 'Start your Claim', - useActionLinks: true, - }; + // const sipOptions = { + // downtime, + // formId, + // gaStartEventName: 'decision-reviews-va20-0995-start-form', + // headingLevel: 2, + // hideUnauthedStartLink: false, // true, // once testing is complete + // messages: savedFormMessages, + // pageList, + // pathname: '/introduction', + // prefillEnabled, + // startText: 'Start your Claim', + // useActionLinks: true, + // }; return (
@@ -39,7 +43,11 @@ const IntroductionPage = props => { If you disagree with our decision on your claim, a Supplemental Claim may be an option for you.

- + {/* */} +

Follow these steps to get started

@@ -166,11 +174,18 @@ const IntroductionPage = props => { +

+ +

+ {/* + /> */}

diff --git a/src/applications/appeals/testing/sc/content/facilityTypes.js b/src/applications/appeals/testing/sc/content/facilityTypes.js index 1fe964b70283..9da67c179406 100644 --- a/src/applications/appeals/testing/sc/content/facilityTypes.js +++ b/src/applications/appeals/testing/sc/content/facilityTypes.js @@ -7,7 +7,7 @@ export const facilityTypeChoices = { vetCenter: 'A VA Vet center', ccp: 'A community care provider that VA paid for', vamc: 'A VA medical center (also called a VAMC)', - cobc: 'A community-based outpatient clinic (also called a COBC)', + cboc: 'A community-based outpatient clinic (also called a CBOC)', mtf: 'A Department of Defense military treatment facility (also called an MTF)', nonVa: {