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

EPP-57 Amend - SEC2 - Create a what is YOUR NAME on the licence page #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
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']
}
};
9 changes: 5 additions & 4 deletions apps/epp-amend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ module.exports = {
translations: 'apps/epp-amend/translations',
baseUrl: '/amend-license',
steps: {
'/section-one': {
'/amend-licence-number': {
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',
'amend-middlename',
'amend-lastname'
],
next: '/section-three'
next: '/confirm',
locals: {captionHeading: 'Section 2 of 20'}
},
'/section-three': {
fields: ['amend-date-of-birth'],
Expand Down
31 changes: 31 additions & 0 deletions apps/epp-amend/sections/summary-data-sections.js
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
'use strict';

module.exports = {
'Licence details': {
steps: [
{
step: '/amend-licence-number',
field: 'amend-licence-number'
}
]
},
'Applicant name': {
steps: [
{
step: '/amend-name-on-licence',
field: 'amend-name-title'
},
{
step: '/amend-name-on-licence',
field: 'amend-firstname'
},
{
step: '/amend-name-on-licence',
field: 'amend-middlename'
},
{
step: '/amend-name-on-licence',
field: '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"
}
}
29 changes: 27 additions & 2 deletions apps/epp-amend/translations/src/en/pages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
{
"application-submitted": {
"confirmed": "Amendment submitted"
"amend-name-on-licence": {
"header": "What is your name on the licence?"
},


"confirm": {
"header": "Check your answers",
"subheader": "Review your answers below and amend if required before proceeding to declaration and payment.",
"sections": {
"Applicant name": {
"header": "Applicant name"
}
}
},
"fields": {
"amend-name-title": {
"label" : "Title"
},
"amend-name-firstname": {
"label" : "First name"
},
"amend-name-middlename": {
"label" : "Middle name(s)"
},
"amend-name-lastname": {
"label" : "Surname"
}
}
}
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"
}
}
11 changes: 11 additions & 0 deletions apps/epp-amend/views/confirm.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{<partials-page}}
{{$page-content}}
<div>
<p class="govuk-body">{{#t}}pages.confirm.subheader{{/t}}</p>
</div>
{{#rows}}
{{> partials-summary-table}}
{{/rows}}
{{#input-submit}}continue{{/input-submit}}
{{/page-content}}
{{/partials-page}}
28 changes: 28 additions & 0 deletions apps/epp-amend/views/partials/summary-table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div>
<h2 class="section-header">{{section}}</h2>
</div>
<dl>
{{#fields}}
{{^omitFromSummary}}
<div class="confirm-row">
{{#isSeparator}}
{{/isSeparator}}
{{^isSeparator}}
<dt class="confirm-label">{{label}}</dt>
<dd class="confirm-value" data-value="{{value}}">{{value}}</dd>
{{^omitChangeLink}}
{{#changeLink}}
<dd><span><a class="govuk-link" href="{{changeLink}}" id="{{field}}-change-{{index}}">{{#t}}buttons.change{{/t}} <span class="visuallyhidden">{{changeLinkDescription}} from {{value}}</span></a></span></dd>
{{/changeLink}}
{{^changeLink}}
<dd><span><a class="govuk-link" href="{{baseUrl}}{{step}}/edit#{{field}}" id="{{field}}-change">{{#t}}buttons.change{{/t}} <span class="visuallyhidden">{{changeLinkDescription}} from {{value}}</span></a></span></dd>
{{/changeLink}}
{{/omitChangeLink}}
{{#omitChangeLink}}
<dd> </dd>
{{/omitChangeLink}}
{{/isSeparator}}
</div>
{{/omitFromSummary}}
{{/fields}}
</dl>
2 changes: 1 addition & 1 deletion apps/epp-common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
}
},
{
target: '/amend-license/section-one',
target: '/amend-license/amend-licence-number',
condition: {
field: 'application-type',
value: 'amend'
Expand Down