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

SPIKE: Add character count for driving licence to details page #83

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"test:watch": "mocha --watch",
"mocks": "yarn run wiremock --port 8030 --root-dir test/mocks",
"test:browser": "wait-on tcp:8030 tcp:5030 && cucumber-js --config test/browser/cucumber.js",
"test:browser:ci": "npm-run-all -p -r start:ci mocks test:browser"
"test:browser:ci": "npm-run-all -p -r start:ci mocks test:browser",
"check-translation": "node node_modules/di-ipv-cri-common-express/scripts/checkTranslations.js"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -70,12 +71,12 @@
"cfenv": "1.2.4",
"connect-dynamodb": "^2.0.5",
"copyfiles": "2.4.1",
"di-ipv-cri-common-express": "alphagov/di-ipv-cri-common-express.git#v0.0.38",
"di-ipv-cri-common-express": "alphagov/di-ipv-cri-common-express.git#v0.0.39",
"dotenv": "^16.0.1",
"express": "4.18.1",
"express-async-errors": "^3.1.1",
"express-session": "^1.17.3",
"govuk-frontend": "4.2.0",
"govuk-frontend": "4.5.0",
"hmpo-app": "2.4.0",
"hmpo-components": "5.7.0",
"hmpo-config": "2.2.1",
Expand Down
5 changes: 5 additions & 0 deletions src/assets/scss/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ $govuk-assets-path: "/public/";
background-color: $govuk-error-colour;
}

// remove the resize option on the driving licence number character count
// To match both the DVLA and DVA forms this selector looks for any textarea
// that contains the string 'LicenceNumber' anywhere in the class name
textarea[name*="LicenceNumber"] {resize: none;}

//// Task list pattern
//
//.app-task-list {
Expand Down
7 changes: 6 additions & 1 deletion src/locales/cy/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ govuk:
paragraph2: unrhyw bryd.
buttonAcceptText: Derbyn cwcis dadansoddi
buttonRejectText: Gwrthod cwcis dadansoddi
linkViewCookies: Gweld cwcis
linkViewCookiesText: Gweld cwcis
cookieBannerHideLink: Cuddio'r neges yma
footerNavItems:
meta:
Expand Down Expand Up @@ -66,6 +66,11 @@ drivingLicence:
retryMessageList2: rydych wedi rhoi eich rhif trwydded yrru yn gywir
retryMessageList3: bod dyddiau a misoedd yn y drefn gywir yn eich dyddiad geni, dyddiad cyhoeddi a dyddiad dilys tan
retryMessageList4: you’ve left the middle names section blank if you do not have any middle names
charactersUnderLimitTextOther: Mae gennych %{count} nod ar ôl
charactersUnderLimitTextOne: Mae gennych %{count} nod ar ôl
charactersAtLimitText: Mae gennych 0 nod ar ôl
charactersOverLimitTextOne: Mae gennych %{count} nod yn ormod
charactersOverLimitTextOther: Mae gennych %{count} nod yn ormod

prove-another-way:
title: Profi pwy ydych chi mewn ffordd arall
Expand Down
6 changes: 6 additions & 0 deletions src/locales/cy/fields.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
drivingLicenceNumber:
label: Rhif trwydded
hint: "Dyma'r rhif hir yn adran 5 ar eich trwydded er enghraifft HARRI559146MJ931"
maxlength: false
validation:
default: "Rhowch y rhif yn union fel mae’n ymddangos ar eich trwydded yrru"
exactlength: "Dylai rhif eich trwydded fod yn 16 nod o hyd"
numeric: "Your licence number should not include any symbols or spaces"
limit: "Driving licence numbers do not start with 16 – enter the number as it appears on your driving licence"
dvlaChecker: "Rhowch y rhif yn union fel mae’n ymddangos ar eich trwydded yrru"
regexSpecialCharacters: "Ni ddylai rhif eich trwydded gynnwys unrhyw symbolau neu ofodau"

dvaLicenceNumber:
label: Rhif trwydded
hint: "Dyma'r rhif hir yn adran 5 ar eich trwydded"
validation:
default: "Rhowch y rhif yn union fel mae’n ymddangos ar eich trwydded yrru"
exactlength: "Dylai rhif eich trwydded fod yn 8 nod o hyd"
numeric: "Ni ddylai rhif eich trwydded gynnwys unrhyw symbolau neu ofodau"
regexSpecialCharacters: "Ni ddylai rhif eich trwydded gynnwys unrhyw symbolau neu ofodau"

issueNumber:
label: Rhif cyhoeddi
hint: "Dyma'r rhif 2 ddigid ar ôl y gofod yn adran 5 o'ch trwydded"
validation:
default: "Rhowch y rhif cyhoeddi fel y mae'n ymddangos ar eich trwydded yrru"
exactlength: "Dylai eich rhif cyhoeddi fod yn 2 rif o hyd"
numeric: "Ni ddylai eich rhif cyhoeddi gynnwys unrhyw symbolau neu ofodau"
regexSpecialCharacters: "Ni ddylai rhif eich trwydded gynnwys unrhyw symbolau neu ofodau"

surname:
label: Enw olaf
Expand Down Expand Up @@ -54,6 +59,7 @@ dateOfBirth:
default: "Rhowch eich dyddiad geni fel y mae'n ymddangos ar eich trwydded yrru"
before: "Rhaid i'ch dyddiad geni fod yn y gorffennol"
dvlaChecker: "Gwiriwch eich bod wedi rhoi eich dyddiad geni yn gywir"

dvaDateOfBirth:
legend: Dyddiad geni
hint: "Er enghraifft, 5 9 1973"
Expand Down
5 changes: 5 additions & 0 deletions src/locales/en/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ drivingLicence:
retryMessageList2: you’ve entered your driving licence number correctly
retryMessageList3: days and months are in the right order in your date of birth, issue date and valid to date
retryMessageList4: you’ve left the middle names section blank if you do not have any middle names
charactersUnderLimitTextOther: You have %{count} characters remaining
charactersUnderLimitTextOne: You have %{count} character remaining
charactersAtLimitText: You have 0 characters remaining
charactersOverLimitTextOne: You have %{count} character too many
charactersOverLimitTextOther: You have %{count} characters too many

prove-another-way:
title: Prove your identity another way
Expand Down
4 changes: 4 additions & 0 deletions src/locales/en/fields.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
drivingLicenceNumber:
label: Licence number
hint: "This is the long number in section 5 on your licence for example HARRI559146MJ931"
maxlength: false
validation:
default: "Enter the number exactly as it appears on your driving licence"
exactlength: "Your licence number should be 16 characters long"
numeric: "Your licence number should not include any symbols or spaces"
limit: "Driving licence numbers do not start with 16 – Enter the number exactly as it appears on your driving licence"
dvlaChecker: "Enter the number exactly as it appears on your driving licence"
regexSpecialCharacters: "Your licence number should not include any symbols or spaces"

dvaLicenceNumber:
label: Licence number
hint: "This is the long number in section 5 on your licence"
Expand All @@ -16,13 +18,15 @@ dvaLicenceNumber:
exactlength: "Your licence number should be 8 characters long"
regexSpecialCharacters: "Your licence number should not include any symbols or spaces"
numeric: "Enter the number exactly as it appears on your driving licence"

issueNumber:
label: Issue number
hint: "This is the 2 digit number after the space in section 5 of your licence"
validation:
default: "Enter the issue number as it appears on your driving licence"
exactlength: "Your issue number should be 2 numbers long"
regexSpecialCharacters: "Your issue number should not include any symbols or spaces"
numeric: "Enter the number exactly as it appears on your driving licence"

surname:
label: Last name
Expand Down
Loading