Skip to content

Commit

Permalink
Merge pull request #1985 from GSA/1975-more-info-return-to-form
Browse files Browse the repository at this point in the history
PXBF-1975-more-info-return-to-form
  • Loading branch information
scottqueen-bixal authored Dec 9, 2024
2 parents 14b3f8a + d5882d2 commit 01f0ba3
Show file tree
Hide file tree
Showing 6 changed files with 339 additions and 7 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { useContext } from 'react'
import PropTypes from 'prop-types'
import { RouteContext } from '@/App'
import { useNavigate } from 'react-router-dom'
import {
BenefitAccordionGroup,
Button,
Expand Down Expand Up @@ -29,6 +32,8 @@ const Results = ({
relevantBenefits,
ui,
}) => {
const ROUTES = useContext(RouteContext)
const navigate = useNavigate()
// Results view components
const ResultsBannerBlock = ({ notEligibleView, zeroBenefitsResult, ui }) => {
const { eligible, notEligible, zeroBenefits } = ui
Expand Down Expand Up @@ -140,12 +145,7 @@ const Results = ({
>
{resultsRelativeBenefits?.heading}
</Heading>
{relevantBenefits && (
<RelativeBenefitList
data={relevantBenefits}
carrotType="carrot"
></RelativeBenefitList>
)}
{relevantBenefits && <RelativeBenefitList data={relevantBenefits} />}
</div>
)
}
Expand Down Expand Up @@ -176,6 +176,9 @@ const Results = ({
}
isExpandAll={isExpandAll}
setExpandAll={setExpandAll}
returnToForm={() =>
navigate(`/${ROUTES.indexPath}/${ROUTES.formPaths[0]}`)
}
ui={ui}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ exports[`BenefitAccordionGroup > renders a match to the previous snapshot 1`] =
You paid for funeral or burial expenses and were not reimbursed
</li>
</ul>
<button
class="bf-step-back-button bf-usa-button usa-button bf-usa-button--unstyled usa-button--unstyled"
data-test="button"
data-testid="bf-step-back-button"
type="button"
>
Go back to start
</button>
</div>
<div
class="bf-usa-accordion-group-cta-wrapper"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Button,
Heading,
KeyElegibilityCrieriaList,
StepBackButton,
ObfuscatedLink,
} from '@components'
import './_index.scss'
Expand All @@ -18,6 +19,7 @@ import './_index.scss'
* @param {bool} isExpandAll - determines if all the accordions in the group are expanded
* @param {function} setExpandAll - inherited useState function
* @param {function} notEligibleView - inherited bolean state
* @param {object} returnToForm - inherited object for more info cta
* @param {object} ui - inherited ui content
* @return {html} returns html
*/
Expand All @@ -28,6 +30,7 @@ const BenefitAccordionGroup = ({
isExpandAll,
setExpandAll,
notEligibleView,
returnToForm,
ui,
}) => {
const { benefitAccordion, benefitAccordionGroup } = ui
Expand All @@ -37,6 +40,7 @@ const BenefitAccordionGroup = ({
visitLabel,
unmetLabel,
sourceIsEnglish,
backcta,
} = benefitAccordion
const { closedState, openState } = benefitAccordionGroup
const { benefitLink, openAllBenefitAccordions } =
Expand Down Expand Up @@ -151,6 +155,9 @@ const BenefitAccordionGroup = ({
)
})}
</ul>
<StepBackButton onClick={() => returnToForm()}>
{backcta?.link}
</StepBackButton>
</div>
)
}
Expand Down Expand Up @@ -236,7 +243,9 @@ const BenefitAccordionGroup = ({
<NotEligibleList items={notEligibleBenefits} />
)}
{moreInformationNeeded.length > 0 && (
<MoreInfoList items={moreInformationNeeded} />
<>
<MoreInfoList items={moreInformationNeeded} />
</>
)}
<div className="bf-usa-accordion-group-cta-wrapper">
<ObfuscatedLink
Expand Down
4 changes: 4 additions & 0 deletions benefit-finder/src/shared/locales/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
"More information needed",
"Not eligible"
],
"backcta": {
"text": "",
"link": "Go back to start"
},
"agencyPrefix": "By",
"benefitSummary": "Key eligibility criteria",
"benefitSummaryPrefix": "Met ",
Expand Down
4 changes: 4 additions & 0 deletions benefit-finder/src/shared/locales/es/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
"Más información requerida",
"No elegible"
],
"backcta": {
"text": "",
"link": "Volver al inicio"
},
"agencyPrefix": "",
"benefitSummary": "Criterios de elegibilidad",
"benefitSummaryPrefix": "Cumple ",
Expand Down

0 comments on commit 01f0ba3

Please sign in to comment.