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

support when income is not known #306

Merged
merged 11 commits into from
Jun 21, 2022
Merged

Conversation

JeremyKennedy
Copy link
Contributor

@JeremyKennedy JeremyKennedy commented Jun 20, 2022

This PR mainly adds support for when income is not known. This is done by first asking the user if they want to provide their income, and if they do, then we show the income question. Same for partner income. If either income is not provided, that will affect the results available.

I have differed from the mockups somewhat in order to accommodate the existing application structure. Rather than having a checkbox and an optional field, I've gone with radio buttons which will show the income field if Yes is selected (exactly as we have the OAS Deferral). This keeps consistency with the rest of the app, and keeps complexity to a minimum, since we're using logic our app supports already.

The results page is still using the old layout, as the new one is not complete yet.

Several things were improved as a result of this PR:

  • compressed tests some more, using variable unpacking
  • update text replacement rules to optionally have the context of their benefit, allowing us to know what benefit we're working with in the replacement logic (this simplified some existing rules, and allowed me to include the max income in the detail when income is not known)
  • updated the detail wording for a few things, like saying "you and your partner's combined income" instead of "your income" when partnered
  • force-capitalize each line of the eligibility detail text, required due to the above change
  • fix field sorting not actually working in the ui
  • reduce debounce for currency fields, to increase responsiveness. the reason we had it was to prevent pop-in and errors as the user types, but with our new layout, neither of those things happen (for currency fields - not the case for age!)

If interested, you can check out some screenshots I've added to JIRA here: https://jira-dev.bdm-dev.dts-stn.com/browse/SAEB-1310

@vercel
Copy link

vercel bot commented Jun 20, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
canadian-old-age-benefits-estimator ✅ Ready (Inspect) Visit Preview Jun 21, 2022 at 9:11PM (UTC)

@JeremyKennedy JeremyKennedy changed the title wip: support when income is not known support when income is not known Jun 21, 2022
@JeremyKennedy JeremyKennedy marked this pull request as ready for review June 21, 2022 01:55
Copy link
Collaborator

@alex-solo alex-solo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Demoed, everything works!

# Conflicts:
#	__tests__/pages/api/benefits.test.ts
#	__tests__/pages/api/help-me-find-out.test.ts
#	utils/api/benefits/afsBenefit.ts
#	utils/api/benefits/alwBenefit.ts
#	utils/api/benefits/oasBenefit.ts
#	utils/api/definitions/textReplacementRules.ts
#	utils/api/summaryHandler.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants