Skip to content

Commit

Permalink
feat: use custom translation key on pay subsidy decision attachements
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Oct 13, 2023
1 parent b747837 commit fe3d568
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/benefit/applicant/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@
"title": "Pay subsidy decision",
"message": "Attach both issued pay subsidy decisions"
},
"paySubsidyDecisionAged": {
"title": "Decision for employment aid for people aged 55 and above"
},
"commissionContract": {
"title": "Toimeksiantosopimus",
"message": ""
Expand Down
3 changes: 3 additions & 0 deletions frontend/benefit/applicant/public/locales/fi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@
"title": "Palkkatukipäätös",
"message": "Liitä molemmat myönnetyt palkkatukipäätökset"
},
"paySubsidyDecisionAged": {
"title": "55 vuotta täyttäneiden työllistämistukipäätös"
},
"commissionContract": {
"title": "Toimeksiantosopimus",
"message": ""
Expand Down
3 changes: 3 additions & 0 deletions frontend/benefit/applicant/public/locales/sv/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@
"title": "Beslut om lönesubvention",
"message": "Bifoga båda besluten om beviljad lönesubvention"
},
"paySubsidyDecisionAged": {
"title": "Beslut om finansiella stöd för personer som är 55 år och äldre"
},
"commissionContract": {
"title": "Toimeksiantosopimus",
"message": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ import StepperActions from '../stepperActions/StepperActions';
import AttachmentsList from './attachmentsList/AttachmentsList';
import { useApplicationFormStep3 } from './useApplicationFormStep3';

const translationKeyForPaySubsidyAttachement = (
paySubsidyGranted: PAY_SUBSIDY_GRANTED
): 'paySubsidyDecision' | 'paySubsidyDecisionAged' => {
if (paySubsidyGranted === PAY_SUBSIDY_GRANTED.GRANTED) {
return 'paySubsidyDecision';
}
if (paySubsidyGranted === PAY_SUBSIDY_GRANTED.GRANTED_AGED) {
return 'paySubsidyDecisionAged';
}
return 'paySubsidyDecision';
};

const ApplicationFormStep3: React.FC<DynamicFormStepComponentProps> = ({
data,
}) => {
Expand Down Expand Up @@ -60,6 +72,9 @@ const ApplicationFormStep3: React.FC<DynamicFormStepComponentProps> = ({
as="li"
attachments={attachments}
attachmentType={ATTACHMENT_TYPES.PAY_SUBSIDY_CONTRACT}
attachmentTypeTranslationKey={translationKeyForPaySubsidyAttachement(
paySubsidyGranted
)}
showMessage={showSubsidyMessage}
required
/>
Expand Down

0 comments on commit fe3d568

Please sign in to comment.