Skip to content

Commit

Permalink
PYIC-6421 Workaround for prefix issue
Browse files Browse the repository at this point in the history
We’re still waiting for hmpo-components PR HMPO/hmpo-components#165  to be merged and released. In the meantime we should implement a workaround so that amount fields have the “£” prefix while non-amount fields don’t.
  • Loading branch information
blakeyp committed May 20, 2024
1 parent db2d80e commit 5e79946
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"express-session": "1.18.0",
"govuk-frontend": "4.8.0",
"hmpo-app": "3.0.1",
"hmpo-components": "6.4.0",
"hmpo-components": "6.5.0",
"hmpo-form-wizard": "13.0.0",
"hmpo-i18n": "6.0.1",
"hmpo-logger": "7.0.1",
Expand Down
1 change: 0 additions & 1 deletion src/app/kbv/controllers/single-amount-question.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class SingleAmountQuestionController extends BaseController {
req.lang
),
title: presenters.questionToTitle(req.session.question, req.translate),
prefix: "£",
name: req.session.question?.questionKey,
};

Expand Down
13 changes: 13 additions & 0 deletions src/locales/en/fields.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,80 @@
rti-payslip-national-insurance:
label: Amount
hint: For example 123.86
prefix: £
validation:
required: Enter an amount
regexNumeric: Enter a valid amount in pounds and pence, like 123.45
regexPoundsAndPence: Amount must include pounds and pence, like 123.45
rti-payslip-income-tax:
label: Amount
hint: For example 123.86
prefix: £
validation:
required: Enter an amount
regexNumeric: Enter a valid amount in pounds and pence, like 123.45
regexPoundsAndPence: Amount must include pounds and pence, like 123.45
rti-p60-payment-for-year:
label: Amount
hint: For example, 21350.75
prefix: £
validation:
required: Enter an amount
regexNumeric: Enter a valid amount in pounds and pence, like 123.45
regexPoundsAndPence: Amount must include pounds and pence, like 123.45
rti-p60-earnings-above-pt:
label: Amount
hint: For example, 24368
prefix: £
validation:
required: Enter an amount
regex: Amount must be a whole number, like 123
rti-p60-postgraduate-loan-deductions:
label: Amount
hint: For example, 765
prefix: £
validation:
required: Enter an amount
regex: Amount must be a whole number, like 123
rti-p60-statutory-shared-parental-pay:
label: Amount
hint: For example, 15620.75
prefix: £
validation:
required: Enter an amount
regexNumeric: Enter a valid amount in pounds and pence, like 123.45
regexPoundsAndPence: Amount must include pounds and pence, like 123.45
rti-p60-statutory-adoption-pay:
label: Amount
hint: For example, 15620.75
prefix: £
validation:
required: Enter an amount
regexNumeric: Enter a valid amount in pounds and pence, like 123.45
regexPoundsAndPence: Amount must include pounds and pence, like 123.45
rti-p60-statutory-maternity-pay:
label: Amount
hint: For example, 15620.75
prefix: £
rti-p60-student-loan-deductions:
label: Amount
hint: For example, 765
prefix: £
validation:
required: Enter an amount
regex: Amount must be a whole number, like 123
rti-p60-employee-ni-contributions:
label: Amount
hint: For example, 836.16
prefix: £
validation:
required: Enter an amount
regexNumeric: Enter a valid amount in pounds and pence, like 123.45
regexPoundsAndPence: Amount must include pounds and pence, like 123.45
ita-bankaccount:
label: Last 4 digits of your account number
hint: ""
prefix: ""
validation:
default: Enter the last 4 digits of your account number
numeric: Last 4 digits of your account number must only include numbers
Expand Down Expand Up @@ -156,6 +167,7 @@ statePensionAndBenefitsShort:
tc-amount:
label: Amount
hint: For example 36.75
prefix: £
validation:
required: Enter an amount
regexNumeric: Enter a valid amount in pounds and pence, like 123.45
Expand All @@ -168,6 +180,7 @@ selfAssessmentPaymentDate:
selfAssessmentPaymentAmount:
label: Payment amount
hint: Enter the amount in pounds and pence. For example, 3625.75.
prefix: £
content: ""
validation:
required: Enter an amount
Expand Down
3 changes: 0 additions & 3 deletions src/views/kbv/single-amount-question.njk
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
hint: {
text: question.hint
},
prefix: {
text: question.prefix
},
classes: "govuk-input--width-5"
}) }}

Expand Down

0 comments on commit 5e79946

Please sign in to comment.