Skip to content

Commit

Permalink
EPP-57 amend licence path
Browse files Browse the repository at this point in the history
- add fields in fields/index.js, fields.json, page.json, validation.json
- add step in summary-data-sections.js
- defined steps in index.js
  • Loading branch information
PaolaDMadd-Pro committed Dec 20, 2024
1 parent f493bc5 commit 7f78864
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 6 deletions.
27 changes: 26 additions & 1 deletion apps/epp-amend/fields/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
const title = require('../../../utilities/constants/titles.js');
module.exports = {

'amend-name-title': {
mixin: 'select',
validate: ['required'],
labelClassName: 'govuk-label--s',
className: ['govuk-input--width-2'],
options: [{
value: '',
label: 'fields.amend-name-title.options.none_selected'
}].concat(title)
},
'amend-firstname': {
validate: ['required', 'notUrl', { type: 'maxlength', arguments: [250] }],
labelClassName: 'govuk-label--s',
className: ['govuk-input', 'govuk-!-width-two-thirds']
},
'amend-middlename': {
validate: [{ type: 'maxlength', arguments: [250] }],
labelClassName: 'govuk-label--s',
className: ['govuk-input', 'govuk-!-width-two-thirds']
},
'amend-lastname': {
validate: ['required', 'notUrl', { type: 'maxlength', arguments: [250] }],
labelClassName: 'govuk-label--s',
className: ['govuk-input', 'govuk-!-width-two-thirds']
}
};
4 changes: 2 additions & 2 deletions apps/epp-amend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ module.exports = {
behaviours: [validateAndRedirect],
backLink: '/application-type',
fields: ['amend-licence-number'],
next: '/section-two'
next: '/amend-name-on-licence'
},
'/section-two': {
'/amend-name-on-licence': {
fields: [
'amend-name-title',
'amend-firstname',
Expand Down
19 changes: 19 additions & 0 deletions apps/epp-amend/sections/summary-data-sections.js
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
'use strict';

module.exports = {
'Licence details': {
steps: [
{
step: '/amend-licence-number',
field: 'amend-licence-number'
}
]
},
'Applicant name': {
steps: [
{
step: '/amend-name-on-licence',
fields: ['amend-name-title', 'amend-firstname', 'amend-middlename', 'amend-lastname']
}
]
}
};
16 changes: 15 additions & 1 deletion apps/epp-amend/translations/src/en/fields.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
{

"amend-name-title": {
"label": "Title",
"options": {
"none_selected": "Select"
}
},
"amend-firstname": {
"label": "First name"
},
"amend-middlename": {
"label": "Middle names (optional)"
},
"amend-lastname": {
"label": "Last name"
}
}
6 changes: 5 additions & 1 deletion apps/epp-amend/translations/src/en/pages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"application-submitted": {
"amend-name-on-licence": {
"header": "What is your name on the licence?"
},

"application-submitted": {
"confirmed": "Amendment submitted"
}
}
17 changes: 16 additions & 1 deletion apps/epp-amend/translations/src/en/validation.json
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
{}
{
"amend-name-title" : {
"required" : "Select your title"
},
"amend-firstname" : {
"required" : "Enter your first name",
"maxlength" : "First name must between 1 and 250 characters"
},
"amend-middlename" :{
"maxlength" : "Middle names must be between 250 characters or less"
},
"amend-lastname" : {
"required" : "Enter your last name",
"maxlength" : "Last name must be between 1 and 250 characters"
}
}

0 comments on commit 7f78864

Please sign in to comment.