Skip to content

Commit

Permalink
SC prototype | Start app with action link & fix typo (#31981)
Browse files Browse the repository at this point in the history
* Show start action links in SC prototype

* Fix typo

* Fix JS when no issues loaded (local testing)
  • Loading branch information
Mottie authored Sep 17, 2024
1 parent d018a78 commit 3d332cb
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 28 deletions.
14 changes: 6 additions & 8 deletions src/applications/appeals/shared/components/ContestableIssues.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand All @@ -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,
Expand All @@ -151,7 +149,7 @@ const ContestableIssues = props => {
onShowRemoveModal: cardIndex => {
const adjustedIndex = calculateIndexOffset(
cardIndex,
formData.contestedIssues.length,
loadedIssues.length,
);
setRemoveIndex(adjustedIndex);
setShowRemoveModal(true);
Expand All @@ -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);
Expand Down
53 changes: 34 additions & 19 deletions src/applications/appeals/testing/sc/containers/IntroductionPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="schemaform-intro">
Expand All @@ -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.
</p>
<ShowAlertOrSip basename={location.basename} sipOptions={sipOptions} />
{/* <ShowAlertOrSip basename={location.basename} sipOptions={sipOptions} /> */}
<va-link-action
href="/decision-reviews/test-sc/veteran-information"
text="Start your claim"
/>
<h2 className="vads-u-margin-top--2 vads-u-margin-bottom--0">
Follow these steps to get started
</h2>
Expand Down Expand Up @@ -166,11 +174,18 @@ const IntroductionPage = props => {
</va-process-list-item>
</va-process-list>

<p className="vads-u-margin-top--4">
<va-link-action
href="/decision-reviews/test-sc/veteran-information"
text="Start your claim"
/>
</p>
{/*
<ShowAlertOrSip
basename={location.basename}
sipOptions={sipOptions}
bottom
/>
/> */}

<OmbInfo />
<p />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 3d332cb

Please sign in to comment.