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

New results - dyna link fix? #1133

Merged
merged 55 commits into from
Feb 7, 2025
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
1a3e5b2
Partial check in next steps
Maxim-Lam Apr 16, 2024
6987ece
Summary + next steps done
Maxim-Lam May 28, 2024
590d66e
Fixed Summary Estimates headers
Maxim-Lam Jun 25, 2024
67ae8cc
Remove unused files and refs, clean up, remove console logs, add images
Maxim-Lam Jul 5, 2024
bebd916
Merge branch 'develop' into new-results
Maxim-Lam Jul 5, 2024
f32c5a5
Remove unused files
Maxim-Lam Jul 5, 2024
059968b
Batch 1,2,3 changes
Maxim-Lam Sep 18, 2024
0f0a18c
ITAO fixes
Maxim-Lam Oct 8, 2024
5447c8b
Fix lint issues
Maxim-Lam Oct 8, 2024
ea628df
Merge branch 'develop' into new-results
Maxim-Lam Oct 9, 2024
5f1c268
Checking in batch 2 & 3 revisions as well as 4 and ITAO changes
Maxim-Lam Dec 12, 2024
9c62b60
Merge branch 'develop' into new-results + added api translations
Maxim-Lam Dec 12, 2024
93b27ad
Api translation added
Maxim-Lam Dec 12, 2024
73686a4
batch 5 changes
Maxim-Lam Dec 19, 2024
d512811
Fix Batch 6, items 1-11
Maxim-Lam Dec 20, 2024
cab979f
batch 7 fixes
Maxim-Lam Jan 13, 2025
d3024e0
Checking in high prio items from excel - missing 64, 71 and itao high…
Maxim-Lam Jan 23, 2025
34e4fa5
saving changes xls #17 #23 #27
MarcoGoC Jan 28, 2025
70e8c95
after merge with develop
MarcoGoC Jan 28, 2025
b127099
311248, 311226, 311229, 311231, 311238 check in for testing
Maxim-Lam Jan 30, 2025
65c33e6
Merge remote-tracking branch 'origin/new-results-mf' into new-results
Maxim-Lam Jan 30, 2025
572d7f6
checking in 311249/311254/311256/311246/311250
Maxim-Lam Jan 31, 2025
d1495d6
HOTFIX smoketests
Maxim-Lam Jan 31, 2025
9cc7269
HOTFIX headings for smoketest
Maxim-Lam Jan 31, 2025
ffe17e4
Checking in resident tax fixes and 311250 fix
Maxim-Lam Feb 3, 2025
552c8df
311234, 311242, 311261, 311237, 311251 check in
Maxim-Lam Feb 3, 2025
246f7e8
311221 311222 311223 ITAO changes
MarcoGoC Feb 3, 2025
f71fd20
hopefully the screerreader will work
MarcoGoC Feb 4, 2025
614e119
311244/311245/311236/312199
Maxim-Lam Feb 4, 2025
794b426
rem console
MarcoGoC Feb 4, 2025
8a79514
Merge pull request #1139 from DTS-STN/311223-Labels
Maxim-Lam Feb 4, 2025
86a807c
Merge pull request #1140 from DTS-STN/311224-ScreenReader
Maxim-Lam Feb 4, 2025
19ea344
fix key error
MarcoGoC Feb 4, 2025
e52329f
move role document to another div
MarcoGoC Feb 4, 2025
2ab066b
HOTFIX numerical estimates
Maxim-Lam Feb 4, 2025
d40b946
HOTFIX link behaviour
Maxim-Lam Feb 4, 2025
17e4b74
311255/311246/311240/311243/ HOTFIX 311245
Maxim-Lam Feb 4, 2025
2e0885a
Merge pull request #1141 from DTS-STN/999999-Fix-Key-error
Maxim-Lam Feb 5, 2025
3817643
Merge pull request #1142 from DTS-STN/311224-ScreenReader
Maxim-Lam Feb 5, 2025
94670ee
removing a console log
Maxim-Lam Feb 5, 2025
34f713e
HOTFIX 314021
Maxim-Lam Feb 5, 2025
7137e79
Checking in Residence message 311216
Maxim-Lam Feb 5, 2025
ae8f46a
trying something different
MarcoGoC Feb 5, 2025
fe23f18
trying something different
MarcoGoC Feb 5, 2025
6308ba6
HOTFIX 311216
Maxim-Lam Feb 5, 2025
e5133bb
trying something different
MarcoGoC Feb 6, 2025
dadd384
trying something different
MarcoGoC Feb 6, 2025
5ebd840
trying something different
MarcoGoC Feb 6, 2025
0b71ef3
trying something different
MarcoGoC Feb 6, 2025
e898d61
Merge pull request #1144 from DTS-STN/311221-FocusModal
Maxim-Lam Feb 6, 2025
233795f
focus on the button
MarcoGoC Feb 6, 2025
ed768b4
focus on the button
MarcoGoC Feb 6, 2025
1570375
Merge pull request #1145 from DTS-STN/311221-FocusModal
MarcoGoC Feb 6, 2025
6c0f0fa
fix for 314021/313954
Maxim-Lam Feb 7, 2025
449b1b7
Merge branch 'develop' into new-results
Maxim-Lam Feb 7, 2025
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
Prev Previous commit
Next Next commit
ITAO fixes
Maxim-Lam committed Oct 8, 2024
commit 0f0a18ca1973a94e32e1accfdf77cfaaed830870
13 changes: 8 additions & 5 deletions components/Forms/Button.tsx
Original file line number Diff line number Diff line change
@@ -20,12 +20,15 @@ interface ButtonProps {
type ButtonType = 'submit' | 'reset' | 'button'

const BUTTON_STYLES = {
primary: 'text-white bg-[#26374A] hover:bg-[#1C578A] focus:bg-[#0E62C9]',
primary:
'text-white bg-[#26374A] hover:bg-[#1C578A] focus:bg-[#0E62C9] visited:text-white',
secondary:
'text-[#335075] bg-[#EAEBED] hover:bg-[#CFD1D5] focus:bg-[#CFD1D5]',
supertask: 'text-white bg-[#318000] hover:bg-[#1D4D00] focus:bg-[#1D4D00]',
danger: 'text-white bg-[#BC3331] hover:bg-[#942826] focus:bg-[#942826]',
link: 'text-[#2B4380] hover:text-[#0535D2] focus:text-[#0535D2]n hover:underline focus:underline',
'text-[#335075] visited:text-[#335075] bg-[#EAEBED] hover:bg-[#CFD1D5] focus:bg-[#CFD1D5]',
supertask:
'text-white visited:text-white bg-[#318000] hover:bg-[#1D4D00] focus:bg-[#1D4D00]',
danger:
'text-white visited:text-white bg-[#BC3331] hover:bg-[#942826] focus:bg-[#942826]',
link: 'text-[#2B4380] visited:text-[#2B4380] hover:text-[#0535D2] focus:text-[#0535D2]n hover:underline focus:underline',
}

export const Button: React.FC<ButtonProps> = ({
17 changes: 15 additions & 2 deletions components/ResultsPage/EstimatedTotalItem.tsx
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import { BenefitResult } from '../../utils/api/definitions/types'
import { useTranslation } from '../Hooks'
import { Modal } from './Modal'
import Image from 'next/image'
import { Button } from '../Forms/Button'

export const EstimatedTotalItem: React.VFC<{
heading: string
@@ -60,15 +61,27 @@ export const EstimatedTotalItem: React.VFC<{
{displayBenefitName(heading, result.entitlement.result, displayAmount)}
{result.entitlement.result == 0 && (
<>
<span className="align-middle ml-2">
<span className="align-middle ml-2">
<button
onClick={openModal}
style={{
background: 'none',
border: 'none',
padding: 0,
cursor: 'pointer',
}}
aria-label={tsln.resultsPage.moreInformation + ' ' + heading}
>
<Image
className="cursor-pointer"
src="/moreInfo.png"
alt="info"
alt={tsln.resultsPage.moreInformation + ' ' + heading}
width="25"
height="25"
onClick={openModal}
/>
</button>

<Modal
isOpen={modalOpen}
onClose={closeModal}
2 changes: 1 addition & 1 deletion components/ResultsPage/Intro.tsx
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ export const Intro: React.VFC<{
return (
<>
<p dangerouslySetInnerHTML={{ __html: tsln.resultsPage.general }} />
<div className="h2 my-8">{tsln.resultsPage.yourMonEstimateHeading}</div>
<h2 className="h2 my-8">{tsln.resultsPage.yourMonEstimateHeading}</h2>
{estimateLength == 1 && (
<p className="my-5">{tsln.resultsPage.changeInSituation}</p>
)}
44 changes: 43 additions & 1 deletion components/ResultsPage/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Button } from '@dts-stn/service-canada-design-system'
import { useEffect, useRef } from 'react'
import { getTranslations } from '../../i18n/api'
import { WebTranslations } from '../../i18n/web'
import { MaritalStatus } from '../../utils/api/definitions/enums'
@@ -12,9 +13,46 @@ export const Modal: React.VFC<{
}> = ({ isOpen, onClose, partner, maritalStatus }) => {
const tsln = useTranslation<WebTranslations>()
const apiTrans = getTranslations(tsln._language)
const modalRef = useRef(null);
const firstFocusableRef = useRef(null);
const closeButtonRef = useRef(null);

useEffect(() => {
if (isOpen) {
// Focus the first focusable element when the modal opens
firstFocusableRef.current?.focus();

// Event listener for trapping focus
const handleKeyDown = (event) => {
if (event.key === 'Tab') {
const focusableElements = modalRef.current.querySelectorAll(
'button, a, input, textarea, select, [tabindex]:not([tabindex="-1"])'
);
const firstElement = focusableElements[0];
const lastElement =
focusableElements[focusableElements.length - 1];

if (event.shiftKey && document.activeElement === firstElement) {
// Shift + Tab pressed on first element: move focus to the last element
event.preventDefault();
lastElement.focus();
} else if (!event.shiftKey && document.activeElement === lastElement) {
// Tab pressed on the last element: move focus to the first element
event.preventDefault();
firstElement.focus();
}
}
};

document.addEventListener('keydown', handleKeyDown);
return () => document.removeEventListener('keydown', handleKeyDown);
}
}, [isOpen])

if (!isOpen) return null



const getModalString = () => {
let text = ''

@@ -37,9 +75,12 @@ export const Modal: React.VFC<{
<div
className="modal-overlay fixed inset-0 flex items-center justify-center z-50"
onClick={onClose}
role="dialog"
aria-modal="true"
ref={modalRef}
>
<div className="absolute inset-0 bg-black opacity-50"></div>
<div className="modal-content w-6/12 bg-white p-6 shadow-lg z-50">
<div role={'status'} className="modal-content md:w-6/12 sm:w-9/12 bg-white p-6 shadow-lg z-50">
<h2 className="h2">
{!partner
? apiTrans.modal.userHeading
@@ -48,6 +89,7 @@ export const Modal: React.VFC<{
<p>{getModalString()}</p>
<div className="mt-4 flex justify-start">
<Button
ref={closeButtonRef}
text={apiTrans.modal.close}
id={apiTrans.modal.close}
style="primary"
2 changes: 1 addition & 1 deletion components/ResultsPage/index.tsx
Original file line number Diff line number Diff line change
@@ -218,7 +218,7 @@ const ResultsPage: React.VFC<{
<YourAnswers title={tsln.resultsPage.whatYouToldUs} inputs={inputs} />
</div>
<div className="col-span-2 row-span-1">
<div className="h2"> {apiTsln.nextStepTitle}</div>
<h2 className="h2"> {apiTsln.nextStepTitle}</h2>
<BenefitCards
inputAge={Math.floor(
Number(inputs.find((input) => input.key === 'age').value)
1 change: 1 addition & 0 deletions i18n/web/en.ts
Original file line number Diff line number Diff line change
@@ -301,6 +301,7 @@ const en: WebTranslations = {
'EC Economics and Industry;Allowances;Benefits;Survivor benefits;Finance;Personal finance;Income;Pensions;Public pensions,PE Persons;Adults;Seniors,So Society and Culture;Old age',
},
resultsPage: {
moreInformation: "Plus d'information ",
yourMonEstimateHeading: 'Your monthly estimate',
changeInSituation: 'Changes in your situation may impact your results.',
youEstimateMayChange: 'Your estimate may change over time based on',
1 change: 1 addition & 0 deletions i18n/web/fr.ts
Original file line number Diff line number Diff line change
@@ -303,6 +303,7 @@ const fr: WebTranslations = {
homeSubject: `EC Économie et industrie;Allocation;Avantages sociaux;Prestation au survivant;Finances;Finances personnelles;Revenu;Pension;Pension publique,PE Personnes;Adulte;Aîné,SO Société et culture;Vieillesse`,
},
resultsPage: {
moreInformation: 'More information on',
yourMonEstimateHeading: 'Votre estimation mensuelle',
changeInSituation:
'Si votre situation change, vos résultats pourraient changer.',
1 change: 1 addition & 0 deletions i18n/web/index.ts
Original file line number Diff line number Diff line change
@@ -209,6 +209,7 @@ export type WebTranslations = {
}
//results page
resultsPage: {
moreInformation: string
yourMonEstimateHeading: string
changeInSituation: string
youEstimateMayChange: string