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 103 upload (EU) passport #67

Merged
merged 1 commit into from
Feb 14, 2025
Merged
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
39 changes: 23 additions & 16 deletions apps/epp-amend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
backLink: '/application-type',
fields: ['amend-licence-number'],
next: '/name-on-licence',
locals: { captionHeading: 'Section 1 of 20' }
locals: { captionHeading: 'Section 1 of 23' }
},
'/name-on-licence': {
fields: [
Expand All @@ -28,12 +28,12 @@ module.exports = {
'amend-lastname'
],
next: '/date-of-birth',
locals: { captionHeading: 'Section 2 of 20' }
locals: { captionHeading: 'Section 2 of 23' }
},
'/date-of-birth': {
fields: ['amend-date-of-birth'],
next: '/home-address',
locals: { captionHeading: 'Section 3 of 20' }
locals: { captionHeading: 'Section 3 of 23' }
},
'/home-address': {
behaviours: [PostcodeValidation],
Expand All @@ -46,14 +46,14 @@ module.exports = {
'amend-country'
],
next: '/contact-details',
locals: { captionHeading: 'Section 4 of 20' }
locals: { captionHeading: 'Section 4 of 23' }
},
'/contact-details': {
fields: [
'amend-phone-number',
'amend-email'
],
locals: {captionHeading: 'Section 5 of 20'},
locals: {captionHeading: 'Section 5 of 23'},
next: '/amend-details'
},
'/amend-details': {
Expand All @@ -74,7 +74,7 @@ module.exports = {
}
}
],
locals: {captionHeading: 'Section 6 of 20'},
locals: {captionHeading: 'Section 6 of 23'},
next: '/new-name'
},
'/new-name': {
Expand All @@ -86,7 +86,7 @@ module.exports = {
'amend-new-date-name-changed'
],
next: '/identity-details',
locals: { captionHeading: 'Section 7 of 20' },
locals: { captionHeading: 'Section 7 of 23' },
behaviours: [AfterDateOfBirth]
},
'/identity-details': {
Expand All @@ -107,23 +107,30 @@ module.exports = {
}
],

locals: { captionHeading: 'Section 8 of 20' },
locals: { captionHeading: 'Section 8 of 23' },
next: '/upload-driving-licence'
},
'/upload-british-passport': {
behaviours: [SaveDocument('amend-british-passport', 'file-upload'), RemoveDocument('amend-british-passport')],
fields: ['file-upload'],
continueOnEdit: true,
next: '/change-home-address',
locals: { captionHeading: 'Section 9 of 20' }
locals: { captionHeading: 'Section 9 of 23' }
},
'/upload-passport': {
next: '/change-home-address',
locals: { captionHeading: 'Section 9 of 20' }
behaviours: [SaveDocument('amend-eu-passport', 'file-upload'), RemoveDocument('amend-eu-passport')],
fields: ['file-upload'],
continueOnEdit: true,
next: '/upload-certificate-conduct',
locals: { captionHeading: 'Section 9 of 23' }
},
'/upload-driving-licence': {
next: '/change-home-address',
locals: { captionHeading: 'Section 9 of 20' }
locals: { captionHeading: 'Section 9 of 23' }
},
'/upload-certificate-conduct': {
next: '/change-home-address',
locals: { captionHeading: 'Section 9 of 23' }
},
'/change-home-address': {
fields: ['amend-home-address-options'],
Expand All @@ -143,7 +150,7 @@ module.exports = {
}
}
],
locals: { captionHeading: 'Section 10 of 20' },
locals: { captionHeading: 'Section 10 of 23' },
next: '/new-address'
},
'/new-address': {
Expand All @@ -158,7 +165,7 @@ module.exports = {
],
behaviours: [AfterDateOfBirth, PostcodeValidation],
next: '/upload-proof-address',
locals: { captionHeading: 'Section 11 of 20' }
locals: { captionHeading: 'Section 11 of 23' }
},
'/upload-proof-address': {
next: '/section-twelve'
Expand All @@ -169,7 +176,7 @@ module.exports = {
},
'/change-substances': {
fields: ['amend-explosive-precusor-type'],
locals: { captionHeading: 'Section 13 of 20' },
locals: { captionHeading: 'Section 13 of 23' },
next: '/section-fourteen'
},
'/section-fourteen': {
Expand All @@ -178,7 +185,7 @@ module.exports = {
},
'/select-precursor': {
fields: ['amend-precursor-field'],
locals: { captionHeading: 'Section 15 of 20' },
locals: { captionHeading: 'Section 15 of 23' },
next: '/section-sixteen'
},
'/section-sixteen': {
Expand Down
17 changes: 16 additions & 1 deletion apps/epp-amend/sections/summary-data-sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,23 @@ module.exports = {

return null;
}
}
},
{
step: '/upload-passport',
field: 'amend-eu-passport',
parse: (documents, req) => {
if (
req.sessionModel
.get('steps')
.includes('/upload-passport') &&
documents?.length > 0
) {
return documents.map(file => file.name);
}

return null;
}
}
]
},
'amend-home-address-options': {
Expand Down
3 changes: 2 additions & 1 deletion apps/epp-amend/translations/src/en/journey.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"header": "Explosives precursors and poisons licensing",
"phase": "beta",
"serviceName": "Amend an explosives and precursor chemicals licence"
"serviceName": "Amend an explosives and precursor chemicals licence",
"error": "Error"
}
22 changes: 18 additions & 4 deletions apps/epp-amend/translations/src/en/pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,24 @@
"upload-british-passport" : {
"header": "Upload British passport",
"label": "Upload a file",
"hint": "Your file must be JPEG, PDF or PNG and be 25MB or less",
"paragraph1": "Attach an image of your British passport as proof of your identity. the image must be",
"hint": "Your file must be JPG, JPEG, PDF or PNG and be 25MB or less",
"paragraph1": "Attach an image of your British passport as proof of your identity. The image must be",
"link": "https://www.gov.uk/government/publications/explosives-precursors-licence-applications-countersignatory/explosives-precursors-and-poisons-licence-applications-how-to-get-documents-countersigned",
"link-text" : "signed by your countersignatory (opens in a new tab).",
"uploading-document": "Document uploading",
"not-uploaded": "No files uploaded",
"uploaded": "File uploaded"
"not-uploaded": "No file uploaded",
"uploaded": "Files uploaded"
},
"upload-passport" : {
"header": "Upload passport",
"label": "Upload a file",
"hint": "Your file must be JPG, JPEG, PDF or PNG and be 25MB or less",
"paragraph1": "Attach an image of your passport from the EU, Switzerland, Norway, Iceland or Liechtenstein as proof of your identity. The image must be ",
"link": "https://www.gov.uk/government/publications/explosives-precursors-licence-applications-countersignatory/explosives-precursors-and-poisons-licence-applications-how-to-get-documents-countersigned",
"link-text" : "signed by your countersignatory (opens in a new tab).",
"uploading-document": "Document uploading",
"not-uploaded": "No file uploaded",
"uploaded": "Files uploaded"
},
"select-precursor": {
"header": "Explosives precursors",
Expand Down Expand Up @@ -146,6 +157,9 @@
"amend-british-passport" : {
"label": "British passport attachment"
},
"amend-eu-passport" : {
"label": "Passport attachment"
},
"amend-new-country": {
"label": "Country"
},
Expand Down
5 changes: 3 additions & 2 deletions apps/epp-amend/translations/src/en/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@
"file-upload": {
"required": "Select a file to upload",
"maxFileSize": "The selected file must 25MB or smaller",
"fileType": "The selected file must be a JPG, PDF or PNG",
"maxAmendBritishPassport": "You can only upload up to {{maxAmendBritishPassport}} files or less. Remove a file before uploading another "
"fileType": "The selected file must be a JPG, JPEG, PDF or PNG",
"maxAmendBritishPassport": "You can only upload up to {{maxAmendBritishPassport}} files or less. Remove a file before uploading another",
"maxAmendPassport": "You can only upload up to {{maxAmendPassport}} files or less. Remove a file before uploading another"
},
"amend-new-name-title": {
"required" : "Select the title of your new name"
Expand Down
1 change: 0 additions & 1 deletion apps/epp-amend/views/upload-british-passport.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ <h2>{{#t}}pages.upload-british-passport.label{{/t}}</h2>
<h2 class="govuk-heading-m">{{#t}}pages.upload-british-passport.not-uploaded{{/t}}</h2>
{{/values.amend-british-passport}}
{{#values.amend-british-passport.length}}
<br>
<h2 class="govuk-heading-m">{{#t}}pages.upload-british-passport.uploaded{{/t}}</h2>
<div id="uploaded-documents" class="govuk-width-container">
{{#values.amend-british-passport}}
Expand Down
47 changes: 47 additions & 0 deletions apps/epp-amend/views/upload-passport.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{<partials-page}}
{{$encoding}}enctype="multipart/form-data" name="file-upload-form" {{/encoding}}
{{$page-content}}
<p>{{#t}}pages.upload-passport.paragraph1{{/t}}
<a class="govuk-link" href="{{#t}}pages.upload-passport.link{{/t}}" rel="noreferrer noopener" target="_blank">{{#t}}pages.upload-passport.link-text{{/t}}</a>
</p>
<div class="govuk-form-group" id="hofFileUpload">
<label class="govuk-label" for="file-upload">
<h2>{{#t}}pages.upload-passport.label{{/t}}</h2>
<span class="govuk-hint">{{#t}}pages.upload-passport.hint{{/t}}</span>
</label>
<p id="file-upload-error-maxFileSize" class="govuk-error-message govuk-!-display-none">
<span id="validation-error" class="govuk-visually-hidden">{{#t}}journey.error{{/t}}:</span> {{#t}}validation.file-upload.maxFileSize{{/t}}
</p>
<p id="file-upload-error-fileType" class="govuk-error-message govuk-!-display-none">
<span id="validation-error" class="govuk-visually-hidden">{{#t}}journey.error{{/t}}:</span> {{#t}}validation.file-upload.fileType{{/t}}
</p>
<input class="govuk-file-upload" id="file-upload" name="file-upload" type="file" value="amend-eu-passport">
<div id="upload-page-loading-spinner" class="spinner-container">
<div class="spinner-loader"></div>
<span class="spinner-message">{{#t}}pages.upload-passport.uploading-document{{/t}}</span>
</div>
</div>
{{^values.amend-eu-passport}}
<h2 class="govuk-heading-m">{{#t}}pages.upload-passport.not-uploaded{{/t}}</h2>
{{/values.amend-eu-passport}}
{{#values.amend-eu-passport.length}}
<h2 class="govuk-heading-m">{{#t}}pages.upload-passport.uploaded{{/t}}</h2>
<div id="uploaded-documents" class="govuk-width-container">
{{#values.amend-eu-passport}}
<div class="govuk-grid-row">
<div class="govuk-grid-column-three-quarters">
{{name}}
</div>
<div class="govuk-grid-column-one-quarter">
<a href="?delete={{id}}" class="govuk-link">{{#t}}buttons.remove{{/t}}</a>
</div>
</div>
<div class="file-upload-hrline"></div>
{{/values.amend-eu-passport}}
</div>
{{/values.amend-eu-passport.length}}
<button class="govuk-button" name="requireFileUpload" value="amend-eu-passport">
{{#t}}buttons.continue{{/t}}
</button>
{{/page-content}}
{{/partials-page}}
25 changes: 15 additions & 10 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,26 @@ module.exports = {
limit: 1,
limitValidationError: 'maxNewRenewEuPassport'
},
'amend-eu-passport': {
allowMultipleUploads: false,
limit: 1,
limitValidationError: 'maxAmendPassport'
},
'new-renew-proof-address': {
allowMultipleUploads: true,
limit: 2,
limitValidationError: 'maxNewRenewProofAddress'
}
},
sectionDetails: {
totalStepsNew: 20,
totalStepsRenew: 21
},
postCodeCountriesMap: {
'amend-postcode': 'amend-country',
'new-renew-home-address-postcode': 'new-renew-home-address-country',
'new-renew-previous-home-address-postcode': 'new-renew-previous-home-address-country',
'amend-new-postcode': 'amend-new-country'
}
},
sectionDetails: {
totalStepsNew: 20,
totalStepsRenew: 21
},
postCodeCountriesMap: {
'amend-postcode': 'amend-country',
'new-renew-home-address-postcode': 'new-renew-home-address-country',
'new-renew-previous-home-address-postcode': 'new-renew-previous-home-address-country',
'amend-new-postcode': 'amend-new-country'
}
};