From 7f788645f84f2f9675c3074bf91590616485eb34 Mon Sep 17 00:00:00 2001 From: Paola Maddaluno <83777310+PaolaDMadd-Pro@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:08:29 +0000 Subject: [PATCH] EPP-57 amend licence path - add fields in fields/index.js, fields.json, page.json, validation.json - add step in summary-data-sections.js - defined steps in index.js --- apps/epp-amend/fields/index.js | 27 ++++++++++++++++++- apps/epp-amend/index.js | 4 +-- .../sections/summary-data-sections.js | 19 +++++++++++++ .../epp-amend/translations/src/en/fields.json | 16 ++++++++++- apps/epp-amend/translations/src/en/pages.json | 6 ++++- .../translations/src/en/validation.json | 17 +++++++++++- 6 files changed, 83 insertions(+), 6 deletions(-) diff --git a/apps/epp-amend/fields/index.js b/apps/epp-amend/fields/index.js index f4d6253..60f1cda 100644 --- a/apps/epp-amend/fields/index.js +++ b/apps/epp-amend/fields/index.js @@ -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'] + } }; diff --git a/apps/epp-amend/index.js b/apps/epp-amend/index.js index e6812e4..f36f0fb 100644 --- a/apps/epp-amend/index.js +++ b/apps/epp-amend/index.js @@ -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', diff --git a/apps/epp-amend/sections/summary-data-sections.js b/apps/epp-amend/sections/summary-data-sections.js index 8b13789..fa69027 100644 --- a/apps/epp-amend/sections/summary-data-sections.js +++ b/apps/epp-amend/sections/summary-data-sections.js @@ -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'] + } + ] + } +}; diff --git a/apps/epp-amend/translations/src/en/fields.json b/apps/epp-amend/translations/src/en/fields.json index 0db3279..2a399f7 100644 --- a/apps/epp-amend/translations/src/en/fields.json +++ b/apps/epp-amend/translations/src/en/fields.json @@ -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" + } } diff --git a/apps/epp-amend/translations/src/en/pages.json b/apps/epp-amend/translations/src/en/pages.json index 6cf1eb7..4b78597 100644 --- a/apps/epp-amend/translations/src/en/pages.json +++ b/apps/epp-amend/translations/src/en/pages.json @@ -1,5 +1,9 @@ { - "application-submitted": { + "amend-name-on-licence": { + "header": "What is your name on the licence?" + }, + + "application-submitted": { "confirmed": "Amendment submitted" } } diff --git a/apps/epp-amend/translations/src/en/validation.json b/apps/epp-amend/translations/src/en/validation.json index 0967ef4..c6a88fc 100644 --- a/apps/epp-amend/translations/src/en/validation.json +++ b/apps/epp-amend/translations/src/en/validation.json @@ -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" + } +}