Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PXBF-1975-more-info-return-to-form #1985

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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
Loading