Skip to content

Commit

Permalink
batch 5 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim-Lam committed Dec 19, 2024
1 parent 93b27ad commit 73686a4
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 37 deletions.
4 changes: 2 additions & 2 deletions components/Forms/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ type ButtonType = 'submit' | 'reset' | 'button'

const BUTTON_STYLES = {
primary:
'text-white bg-[#26374A] hover:bg-[#2B4380] focus:bg-[#0535D2] border-transparent border-[2px]',
'text-white visited:text-white bg-[#26374A] hover:bg-[#2B4380] focus:bg-[#0535D2] border-transparent border-[2px]',
secondary:
'text-[#2B4380] focus:text-white bg-white hover:bg-[#D7E5F5] focus:bg-[#0535D2] border-[#2B4380] border-[2px]',
'text-[#2B4380] visited:text-[#2B4380] focus:text-white bg-white hover:bg-[#D7E5F5] focus:bg-[#0535D2] border-[#2B4380] border-[2px]',
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',
Expand Down
4 changes: 2 additions & 2 deletions components/ResultsPage/CustomCollapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const CustomCollapse = (props) => {
<details
key={id}
id={id}
className="my-6 text-h6 bg-white border"
className="my-6 text-h6 bg-white border group"
data-testid={`${id}-${props.dataTestId}`}
data-cy={datacy}
>
Expand All @@ -13,7 +13,7 @@ export const CustomCollapse = (props) => {
className="border-none pl-0 ds-text-multi-blue-blue70b p-3 ds-cursor-pointer ds-select-none pl-4"
>
<span
className="ml-[5px] ds-underline"
className="ml-[5px] group-open:underline"
dangerouslySetInnerHTML={{ __html: title }}
/>
</summary>
Expand Down
32 changes: 17 additions & 15 deletions components/ResultsPage/Estimation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const Estimation: React.VFC<{
if (benefitType.includes('alw') || benefitType.includes('alws')) {
//CURRENT ELIGIBLE
if (benefitAge == '0') {
text = `${apiTrans.detail.youCouldReceiveUntil} ${displayAge}${
text = `${apiTrans.detail.youCouldReceiveUntil} 65${
language == 'fr' ? ' ans' : ''
},`
}
Expand All @@ -127,7 +127,7 @@ export const Estimation: React.VFC<{
apiTrans.detail.youCouldReceiveTo
} 65${language == 'fr' ? ' ans' : ''},`
}
text += ` ${isPartnerStr} ${apiTrans.detail.youCouldReceive} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}`
text += ` ${isPartnerStr} ${apiTrans.detail.youCouldReceive} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}:`
}
//OAS AND GIS BENEFIT
else {
Expand All @@ -142,7 +142,7 @@ export const Estimation: React.VFC<{
partner ? apiTrans.detail.yourPartner : apiTrans.detail.you
} ${apiTrans.detail.youCouldReceive} ${eligibleAmt} ${
apiTrans.detail.youCouldReceivePerMonth
}`
}:`
}
//FIRST NOT LAST
else {
Expand All @@ -165,13 +165,13 @@ export const Estimation: React.VFC<{
partner ? apiTrans.detail.yourPartner : apiTrans.detail.you
} ${apiTrans.detail.youCouldReceive} ${eligibleAmt} ${
apiTrans.detail.youCouldReceivePerMonth
}`
}:`
}
text = `${
partner ? apiTrans.detail.yourPartner : apiTrans.detail.you
} ${apiTrans.detail.youCouldReceive} ${eligibleAmt} ${
apiTrans.detail.youCouldReceivePerMonth
}`
}:`
}
}

Expand All @@ -184,7 +184,7 @@ export const Estimation: React.VFC<{
language == 'fr' ? ' ans' : ''
}, ${partner ? apiTrans.detail.yourPartner : apiTrans.detail.you} ${
apiTrans.detail.youCouldStartReceiving
} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}`
} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}:`
}
//NOT LAST
else {
Expand All @@ -206,7 +206,7 @@ export const Estimation: React.VFC<{
partner ? apiTrans.detail.yourPartner : apiTrans.detail.you
} ${apiTrans.detail.youCouldStartReceiving} ${eligibleAmt} ${
apiTrans.detail.youCouldReceivePerMonth
}`
}:`
}
//NEXT NOT SAME
else {
Expand All @@ -215,7 +215,7 @@ export const Estimation: React.VFC<{
} ${Object.keys(nextBenefitResult)[0]}${
language == 'fr' ? ' ans' : ''
},`
text += ` ${isPartnerStr} ${apiTrans.detail.youCouldReceive} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}`
text += ` ${isPartnerStr} ${apiTrans.detail.youCouldReceive} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}:`
}
}
}
Expand All @@ -238,17 +238,17 @@ export const Estimation: React.VFC<{
partner
? apiTrans.detail.yourEstimateIsStillPartner
: apiTrans.detail.yourEstimateIsStill
} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}`
} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}.`
}
//PREVIOUS NOT THE SAME
else {
//IS LAST
if (lastOasGis) {
text = `${apiTrans.detail.youCouldStartReceivingAt} ${benefitAge}${
text = `${apiTrans.detail.youCouldStartReceivingAt} ${displayAge}${
language == 'fr' ? ' ans' : ''
}, ${partner ? apiTrans.detail.yourPartner : apiTrans.detail.you} ${
apiTrans.detail.youCouldContinueReceiving
} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}`
} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}:`
} else {
const nextBenefitResult =
arrayOfBen[arrayOfBen.indexOf(resultObject) + 1]
Expand All @@ -263,16 +263,18 @@ export const Estimation: React.VFC<{
if (eligibleTotalAmount == nextBenefitTotal) {
text = `${
apiTrans.detail.youCouldStartReceivingAt
} ${benefitAge}${language == 'fr' ? ' ans' : ''}, ${
} ${displayAge}${language == 'fr' ? ' ans' : ''}, ${
partner ? apiTrans.detail.yourPartner : apiTrans.detail.you
} ${apiTrans.detail.youCouldContinueReceiving} ${eligibleAmt} ${
apiTrans.detail.youCouldReceivePerMonth
}`
}:`
} else {
text = `${apiTrans.detail.youCouldReceiveFrom} ${displayAge} ${
apiTrans.detail.youCouldReceiveTo
} ${nextBenefitAge}${language == 'fr' ? ' ans' : ''},`
text += ` ${isPartnerStr} ${apiTrans.detail.continueReceiving} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}`
} ${Math.trunc(Number(nextBenefitAge))}${
language == 'fr' ? ' ans' : ''
},`
text += ` ${isPartnerStr} ${apiTrans.detail.youCouldContinueReceiving} ${eligibleAmt} ${apiTrans.detail.youCouldReceivePerMonth}:`
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/ResultsPage/SummaryEstimates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export const SummaryEstimates: React.VFC<{
{headings.length > 1 &&
index < year.length &&
index != headings.length - 1 && (
<hr className="border-[#6F6F6F]" />
<hr className="border-[#6F6F6F] border-solid border-t border-opacity-25" />
)}
</div>
)
Expand Down
12 changes: 6 additions & 6 deletions i18n/api/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ const en: Translations = {
"You may be eligible for this benefit once you turn 60. You can <a class='text-default-text' style='text-decoration: underline' href='/en/questions#age'>edit your answers</a> to see what you could receive at a future age. <p class='mt-6'>You can apply for this benefit 1 month after you turn 59.</p>",
eligibleWhen65: 'You may be eligible when you turn 65.',
mustBeInCanada:
"You need to live in Canada to receive this benefit. You can <a class='text-default-text' style='text-decoration: underline' href='/en/questions#livingCountry'>edit your answers</a> to see what you could get if you lived in Canada.",
"You need to live in Canada to receive this benefit. You can <a class='text-default-text' style='text-decoration: underline' href='/en/questions?step=residence'>edit your answers</a> to see what you could get if you lived in Canada.",
mustBeOasEligible:
'You need to be eligible for the Old Age Security pension to be eligible for this benefit.',
mustCompleteOasCheck:
Expand Down Expand Up @@ -408,9 +408,9 @@ const en: Translations = {
youCantGetThisBenefit:
'You can’t get this benefit if you don’t receive the Old Age Security pension. Your Guaranteed Income Supplement payments won’t increase if you defer your pension.',
thisEstimate:
'This estimate is based on the information you provided. Your actual amount may be different. To confirm that your information is up to date, consult your {MY_SERVICE_CANADA}.',
'This estimate is based on the information you provided. Your actual amount may be different. To confirm that your information is up to date, consult your My Service Canada Account.',
thisEstimateWhenZero:
'This estimate is based on the information you provided. To confirm that your information is up to date, consult your {MY_SERVICE_CANADA}.',
'This estimate is based on the information you provided. To confirm that your information is up to date, consult your My Service Canada Account.',
alwNotEligible:
'The Allowance is for individuals between the ages of 60 and 64 whose spouse or common-law partner is receiving the Guaranteed Income Supplement.',
alwEligibleButPartnerAlreadyIs:
Expand Down Expand Up @@ -453,7 +453,7 @@ const en: Translations = {
yourPartner: 'your partner',
youCouldReceive: 'could receive',
youCouldReceiveTo: 'to',
youCouldReceivePerMonth: 'per month:',
youCouldReceivePerMonth: 'per month',
youCouldReceiveUntil: 'Until age',
youCouldReceiveFrom: 'From age ',
youCouldStartReceivingAt: 'At ',
Expand All @@ -473,7 +473,7 @@ const en: Translations = {
futureEligibleIncomeTooHigh:
'You may be eligible once you turn {EARLIEST_ELIGIBLE_AGE}. Since your income is too high, you may not receive a monthly payment.',
serviceCanadaReviewYourPayment:
'If you apply, your payement will be reviewed each year based on your income tax return.',
'If you apply, your payment amount will be reviewed each year based on your income tax return.',
automaticallyBePaid:
"You'll automatically be paid if your income qualifies.",
youWillReceiveLetter:
Expand Down Expand Up @@ -511,7 +511,7 @@ const en: Translations = {
"If you apply, Service Canada will review your income tax return every year. You'll automatically be paid if your income qualifies.",
canApplyOnline: 'You can apply for this benefit.',
ifYouAlreadyApplied:
'If you already applied for the Guaranteed Income Supplement, you can confirm that your information is up to date in your {MY_SERVICE_CANADA}.',
"If you already applied for the Guaranteed Income Supplement, you can <a id='oasLink2' class='text-default-text' style='text-decoration: underline' target='_blank' aria-label='opens a new tab' href='https://www.canada.ca/en/employment-social-development/services/my-account.html'>sign in to My Service Canada Account</a> to confirm that your information is up to date.",
ifYouAlreadyReceive:
'If you already receive the Guaranteed Income Supplement, you can confirm that your information is up to date in your {MY_SERVICE_CANADA}.',
},
Expand Down
12 changes: 6 additions & 6 deletions i18n/api/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ const fr: Translations = {
"Vous pourriez être admissible lorsque vous aurez 60 ans. Vous pouvez <a class='text-default-text' style='text-decoration: underline' href='/fr/questions#age'>modifier vos réponses</a> pour voir ce que vous pourriez recevoir à un âge futur. <p class='mt-6'>Vous pouvez présenter une demande pour cette prestation 1 mois après votre 59e anniversaire.</p>",
eligibleWhen65: 'Vous pourriez être admissible à votre 65e anniversaire.',
mustBeInCanada:
"Vous devez habiter au Canada pour recevoir cette prestation. Vous pouvez <a class='text-default-text' style='text-decoration: underline' href='/fr/questions#livingCountry'>modifier vos réponses</a> pour voir ce que vous pourriez recevoir si vous habitiez au Canada.",
"Vous devez habiter au Canada pour recevoir cette prestation. Vous pouvez <a class='text-default-text' style='text-decoration: underline' href='/fr/questions?step=residence'>modifier vos réponses</a> pour voir ce que vous pourriez recevoir si vous habitiez au Canada.",
mustBeOasEligible:
'Vous devez être admissible à la pension de la Sécurité de la vieillesse pour être admissible à cette prestation.',
mustCompleteOasCheck:
Expand Down Expand Up @@ -418,9 +418,9 @@ const fr: Translations = {
youCantGetThisBenefit:
'Vous ne pouvez pas recevoir cette prestation si vous ne recevez pas la pension de la Sécurité de la vieillesse. Vos paiements du Supplément de revenu garanti n’augmenteront pas si vous reportez votre pension.',
thisEstimate:
'Cette estimation est basée sur les informations fournies. Votre montant réel pourrait être différent. Pour confirmer que vos renseignements sont à jour, consultez votre compte {MY_SERVICE_CANADA}.',
'Cette estimation est basée sur les informations fournies. Votre montant réel pourrait être différent. Pour confirmer que vos renseignements sont à jour, consultez votre compte Mon dossier Service Canada.',
thisEstimateWhenZero:
'Cette estimation est basée sur les informations fournies. Pour confirmer que vos renseignements sont à jour, consultez votre compte {MY_SERVICE_CANADA}.',
'Cette estimation est basée sur les informations fournies. Pour confirmer que vos renseignements sont à jour, consultez votre compte Mon dossier Service Canada.',
alwNotEligible:
"L'Allocation est une prestation pour les personnes âgées de 60 à 64 ans dont le conjoint reçoit le Supplément de revenu garanti.",
alwEligibleButPartnerAlreadyIs:
Expand Down Expand Up @@ -461,7 +461,7 @@ const fr: Translations = {
currentEligible: 'Présentement',
you: 'vous pourriez',
yourPartner: 'votre conjoint pourrait',
youCouldReceivePerMonth: 'par mois&nbsp;:',
youCouldReceivePerMonth: 'par mois&nbsp;',
youCouldReceiveTo: 'à',
youCouldReceive: 'recevoir',
youCouldReceiveUntil: 'Jusqu’à',
Expand Down Expand Up @@ -522,7 +522,7 @@ const fr: Translations = {
'Si vous présentez une demande, Service Canada révisera votre déclaration de revenus chaque année. Vous recevrez automatiquement des paiements si votre revenu est admissible.',
canApplyOnline: 'Vous pouvez faire une demande pour cette prestation.',
ifYouAlreadyApplied:
'Si vous avez déjà fait une demande pour le Supplément de revenu garanti, vous pouvez confirmer que vos renseignements sont à jour dans votre compte {MY_SERVICE_CANADA}.',
"Si vous avez déjà demandé le Supplément de revenu garanti, vous pouvez <a id='oasLink2' class='text-default-text' style='text-decoration: underline' target='_blank' aria-label='opens a new tab' href='https://www.canada.ca/fr/emploi-developpement-social/services/mon-dossier.html'>vous connecter à Mon dossier Service Canada<a/> pour confirmer que vos renseignements sont à jour.",
ifYouAlreadyReceive:
'Si vous recevez déjà le Supplément de revenu garanti, vous pouvez confirmer que vos renseignements sont à jour dans votre compte {MY_SERVICE_CANADA}.',
},
Expand Down Expand Up @@ -619,7 +619,7 @@ const fr: Translations = {
},
retroactivePayment: {
heading: 'Vos options de report',
text: 'Vous pouvez reporter votre pension pour encore {DELAY_MONTHS} mois.',
text: 'Vous pourriez recevoir un paiement pour un maximum des 11 derniers mois.',
},
mayBecomeEligible: {
heading: 'Paiement rétroactif',
Expand Down
5 changes: 2 additions & 3 deletions utils/api/benefits/gisBenefit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,12 @@ export class GisBenefit extends BaseBenefit<EntitlementResultGeneric> {
if (this.oasResult.cardDetail.meta.receiveOAS == false) {
heading = this.translations.detail.yourDeferralOptions
if (this.oasResult.entitlement.result > 0) {
if (ageToCheck >= 65 && ageToCheck < 70) {
if (this.input.age >= 65 && this.input.age < 70) {
//CHECK IF RECEIVING OAS
text += this.translations.detail.deferralEligible
} else if (ageToCheck < 65) {
} else if (this.input.age < 65) {
text += this.translations.detail.deferralWillBeEligible
}

if (text !== '') {
if (this.entitlement.result !== 0) {
text += `<p class="mt-6">${this.translations.detail.deferralNoGis}</p>`
Expand Down
4 changes: 2 additions & 2 deletions utils/api/benefits/oasBenefit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ export class OasBenefit extends BaseBenefit<EntitlementResultOas> {
//EC15
if (this.entitlement.result > 0) {
if (
this.input.partnerBenefitStatus.value !== PartnerBenefitStatus.NONE
this.input.partnerBenefitStatus.value === PartnerBenefitStatus.NONE
) {
cardCollapsedText.push(
this.translations.detailWithHeading.partnerEligibleButAnsweredNo
Expand Down Expand Up @@ -542,7 +542,7 @@ export class OasBenefit extends BaseBenefit<EntitlementResultOas> {

const ageCalc = this.formAge ? this.formAge : this.inputAge

if (ageCalc > 74 && ageCalc > 64 && this.entitlement.result > 0) {
if (ageCalc >= 75 && this.entitlement.result > 0) {
cardCollapsedText.push(
this.translations.detailWithHeading.oasIncreaseAt75Applied
)
Expand Down

0 comments on commit 73686a4

Please sign in to comment.