From 6a270e892a58c0208e54e61f150f3c1a663303c9 Mon Sep 17 00:00:00 2001 From: Ishaq <156688098+farrukhishaq@users.noreply.github.com> Date: Fri, 17 May 2024 19:41:34 +0100 Subject: [PATCH] Asl 4413 hba upload functionality in ppl transfer journeys (#1587) * Latest functional and content changes towards ASL-4413, including those cherry picked from commit b77a5381e9aaf9badf92f9cb85a62eb96b8c0706 * - Content updates for various journey points of establishment transfer, as set out in the copy deck, as part of ASL-4413 - Content updates for various journey points of change in project licence holder, as set out in the copy deck, as part of ASL-4413 * transfer anf amendment success page content changed. * action = update for license holder change. * More content updates to journey point 5 for both journeys (ASL-4421) * redirecting to upload-hba.jsx page. * content added proposed PPL license holder, for confirm-hba.jsx page. * content updated for confirm-hba page. * confirm-hba.jsx warning text content chanage. * switch btw transfer/amendment journey content update. * confirm-hba.jsx content changed for transfer and amendment journey done. * confirm-hba.jsx content warning to use their own json data for amendment/ transfer journey. * task view page content update on activity comp, reworded. * task view pages content updated for ProfileDetails. * props added to ProfileLink. * refactored task-details & extend logic, lint fixes. * existing test typo fixed for this branch. * test aded for upload-hba transfer journey. * transfer and amendment upload-jsx to use seperate content intro keys. * radio button for confirm-hba.jsx content overriden. * test passing, lint passing. DONE * Update view.js - remove console.log() * Provisionally adding back Applicant label * Bump asl-pages from 31.3.2 to 31.4.0 * PPL amendment PPL holder label change in content. * content fixed for transfer journey on upload page * confirm HBA page for transfer journey use label PPL Holder fix. * success page hyperlink content fixed rm prefix 'You can' * transfer journey establishment current and proposed content done. * eslint applied - test passing * HBA page pape banner on success page message fix. * HBA v2 done, ready for e2e test. * ASL-4413 - use updated components version. Use "Refused" as status label * status resolved check added on transfer and amendment success message * ASL-4413 - remove redundant specific status checks --------- Co-authored-by: edemirbag <17883910+edemirbag@users.noreply.github.com> Co-authored-by: Jeffrey Horton --- package-lock.json | 50 +++++++++++++------------- package.json | 4 +-- pages/success/content/index.js | 10 +++--- pages/success/index.js | 4 +-- pages/task/content/status.js | 2 +- pages/task/read/content/confirm-hba.js | 3 ++ pages/task/read/content/upload-hba.js | 8 ++++- pages/task/read/views/confirm-hba.jsx | 15 ++++---- pages/task/read/views/upload-hba.jsx | 25 ++++++++----- 9 files changed, 69 insertions(+), 52 deletions(-) diff --git a/package-lock.json b/package-lock.json index c3d61621d..d956a9734 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "@asl/pages", - "version": "31.4.0", + "version": "31.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@asl/pages", - "version": "31.4.0", + "version": "31.4.1", "license": "MIT", "dependencies": { "@asl/projects": "^15.2.1", "@asl/service": "^10.3.2", "@joefitter/docx": "^4.7.0", - "@ukhomeoffice/asl-components": "^13.4.1", + "@ukhomeoffice/asl-components": "^13.5.0", "@ukhomeoffice/asl-constants": "^2.1.5", "@ukhomeoffice/asl-dictionary": "^2.1.0", "@ukhomeoffice/frontend-toolkit": "^3.0.0", @@ -85,14 +85,14 @@ } }, "node_modules/@asl/projects": { - "version": "15.2.1", - "resolved": "https://artifactory.digital.homeoffice.gov.uk/artifactory/api/npm/npm-virtual/@asl/projects/-/@asl/projects-15.2.1.tgz", - "integrity": "sha512-1a4zGxUC/Z5tp5UYzAu6pyMMhVFSQMlNgZ8f0tmbJxjhD2SmlwmFRmZHMRLWvVOAoC6oIvDpRWEWUCwSy5lQMw==", + "version": "15.3.0", + "resolved": "https://artifactory.digital.homeoffice.gov.uk/artifactory/api/npm/npm-virtual/@asl/projects/-/@asl/projects-15.3.0.tgz", + "integrity": "sha512-gG+ZyF90LZLBT+lNTGjdYr8fNzGkHz6hLvJopgxbmsKYQU7AcGedLOMDPlw6+sUbdTKRU6jYQ1o2Tq6Ed2J3Pw==", "dependencies": { "@asl/service": "^10.3.2", "@asl/slate-edit-table": "0.0.3", "@babel/core": "^7.24.4", - "@ukhomeoffice/asl-components": "13.4.1", + "@ukhomeoffice/asl-components": "13.5.0", "@ukhomeoffice/asl-constants": "^2.1.5", "@ukhomeoffice/asl-slate-edit-list": "0.0.8", "@ukhomeoffice/frontend-toolkit": "^3.0.0", @@ -152,9 +152,9 @@ } }, "node_modules/@asl/service": { - "version": "10.4.1", - "resolved": "https://artifactory.digital.homeoffice.gov.uk/artifactory/api/npm/npm-virtual/@asl/service/-/@asl/service-10.4.1.tgz", - "integrity": "sha512-+qEsC/TYDi3rIlSFNolvqteS67DyHHRul/LcMGKcsYhsEDKWmXPNYxx40G3XgWN7O045cD758fTLBe4Avnh6aw==", + "version": "10.5.0", + "resolved": "https://artifactory.digital.homeoffice.gov.uk/artifactory/api/npm/npm-virtual/@asl/service/-/@asl/service-10.5.0.tgz", + "integrity": "sha512-Ary2mBa71vJaokhDIjwNBloVhZQzpXogtl+PiSc9nsOrCZLlpyPyyPqLwu1xZTycAUsUdUxwVDDTE7dES8YhGQ==", "dependencies": { "@babel/core": "^7.24.4", "@babel/plugin-proposal-class-properties": "^7.18.6", @@ -163,7 +163,7 @@ "@babel/preset-react": "^7.24.1", "@babel/register": "^7.23.7", "@lennym/redis-session": "^2.2.0", - "@ukhomeoffice/asl-components": "13.4.1", + "@ukhomeoffice/asl-components": "13.5.0", "@ukhomeoffice/frontend-toolkit": "^3.0.0", "aws-sdk": "^2.1370.0", "babel-plugin-transform-require-ignore": "^0.1.1", @@ -3453,9 +3453,9 @@ "dev": true }, "node_modules/@ukhomeoffice/asl-components": { - "version": "13.4.1", - "resolved": "https://npm.pkg.github.com/download/@ukhomeoffice/asl-components/13.4.1/689908ed3d25d3cee343b7b4f5cb0f48200b9769", - "integrity": "sha512-xYrwEnsjGyBTdniUXjHN3RRojzrJFKrwhaOYKjoWHLjulXEPPSzHAc0S6x6F4bSXaNhM14vJr+M/QYJzdzF/5g==", + "version": "13.5.0", + "resolved": "https://npm.pkg.github.com/download/@ukhomeoffice/asl-components/13.5.0/3a2dbc35f0511193e5e2fc12398271e89234a853", + "integrity": "sha512-NauUA8/HaRgI2KD6SH3N82aATWmGtUet9fM7dqbOOW+pD8Hd27PFgKNBrhQVrZilV+c1Rzm/wPRhT6LPch45aw==", "dependencies": { "@ukhomeoffice/asl-constants": "^2.1.5", "@ukhomeoffice/asl-dictionary": "^2.1.0", @@ -14561,14 +14561,14 @@ } }, "@asl/projects": { - "version": "15.2.1", - "resolved": "https://artifactory.digital.homeoffice.gov.uk/artifactory/api/npm/npm-virtual/@asl/projects/-/@asl/projects-15.2.1.tgz", - "integrity": "sha512-1a4zGxUC/Z5tp5UYzAu6pyMMhVFSQMlNgZ8f0tmbJxjhD2SmlwmFRmZHMRLWvVOAoC6oIvDpRWEWUCwSy5lQMw==", + "version": "15.3.0", + "resolved": "https://artifactory.digital.homeoffice.gov.uk/artifactory/api/npm/npm-virtual/@asl/projects/-/@asl/projects-15.3.0.tgz", + "integrity": "sha512-gG+ZyF90LZLBT+lNTGjdYr8fNzGkHz6hLvJopgxbmsKYQU7AcGedLOMDPlw6+sUbdTKRU6jYQ1o2Tq6Ed2J3Pw==", "requires": { "@asl/service": "^10.3.2", "@asl/slate-edit-table": "0.0.3", "@babel/core": "^7.24.4", - "@ukhomeoffice/asl-components": "13.4.1", + "@ukhomeoffice/asl-components": "13.5.0", "@ukhomeoffice/asl-constants": "^2.1.5", "@ukhomeoffice/asl-slate-edit-list": "0.0.8", "@ukhomeoffice/frontend-toolkit": "^3.0.0", @@ -14621,9 +14621,9 @@ } }, "@asl/service": { - "version": "10.4.1", - "resolved": "https://artifactory.digital.homeoffice.gov.uk/artifactory/api/npm/npm-virtual/@asl/service/-/@asl/service-10.4.1.tgz", - "integrity": "sha512-+qEsC/TYDi3rIlSFNolvqteS67DyHHRul/LcMGKcsYhsEDKWmXPNYxx40G3XgWN7O045cD758fTLBe4Avnh6aw==", + "version": "10.5.0", + "resolved": "https://artifactory.digital.homeoffice.gov.uk/artifactory/api/npm/npm-virtual/@asl/service/-/@asl/service-10.5.0.tgz", + "integrity": "sha512-Ary2mBa71vJaokhDIjwNBloVhZQzpXogtl+PiSc9nsOrCZLlpyPyyPqLwu1xZTycAUsUdUxwVDDTE7dES8YhGQ==", "requires": { "@babel/core": "^7.24.4", "@babel/plugin-proposal-class-properties": "^7.18.6", @@ -14632,7 +14632,7 @@ "@babel/preset-react": "^7.24.1", "@babel/register": "^7.23.7", "@lennym/redis-session": "^2.2.0", - "@ukhomeoffice/asl-components": "13.4.1", + "@ukhomeoffice/asl-components": "13.5.0", "@ukhomeoffice/frontend-toolkit": "^3.0.0", "aws-sdk": "^2.1370.0", "babel-plugin-transform-require-ignore": "^0.1.1", @@ -17059,9 +17059,9 @@ "dev": true }, "@ukhomeoffice/asl-components": { - "version": "13.4.1", - "resolved": "https://npm.pkg.github.com/download/@ukhomeoffice/asl-components/13.4.1/689908ed3d25d3cee343b7b4f5cb0f48200b9769", - "integrity": "sha512-xYrwEnsjGyBTdniUXjHN3RRojzrJFKrwhaOYKjoWHLjulXEPPSzHAc0S6x6F4bSXaNhM14vJr+M/QYJzdzF/5g==", + "version": "13.5.0", + "resolved": "https://npm.pkg.github.com/download/@ukhomeoffice/asl-components/13.5.0/3a2dbc35f0511193e5e2fc12398271e89234a853", + "integrity": "sha512-NauUA8/HaRgI2KD6SH3N82aATWmGtUet9fM7dqbOOW+pD8Hd27PFgKNBrhQVrZilV+c1Rzm/wPRhT6LPch45aw==", "requires": { "@ukhomeoffice/asl-constants": "^2.1.5", "@ukhomeoffice/asl-dictionary": "^2.1.0", diff --git a/package.json b/package.json index 310afcfd9..86741d417 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asl/pages", - "version": "31.4.0", + "version": "31.4.1", "description": "", "main": "index.js", "style": "pages/common/assets/sass/style.scss", @@ -29,7 +29,7 @@ "@asl/projects": "^15.2.1", "@asl/service": "^10.3.2", "@joefitter/docx": "^4.7.0", - "@ukhomeoffice/asl-components": "^13.4.1", + "@ukhomeoffice/asl-components": "^13.5.0", "@ukhomeoffice/asl-constants": "^2.1.5", "@ukhomeoffice/asl-dictionary": "^2.1.0", "@ukhomeoffice/frontend-toolkit": "^3.0.0", diff --git a/pages/success/content/index.js b/pages/success/content/index.js index 30ca8c7f4..994f203fc 100644 --- a/pages/success/content/index.js +++ b/pages/success/content/index.js @@ -211,13 +211,13 @@ The relevant people have been emailed.` title: 'Licence amended' }, whatNext: { - body: `This request has been approved.`, + body: '', internal: 'The relevant people have been emailed.', external: '' }, taskLink: { - before: 'You can ', - linkText: 'view the history of this request.' + before: '', + linkText: 'View the history of this request.' } }, 'pil-transfer': { @@ -230,8 +230,8 @@ The relevant people have been emailed.` external: '' }, taskLink: { - before: 'You can ', - linkText: 'view the history of this request.' + before: '', + linkText: 'View the history of this request.' } } }; diff --git a/pages/success/index.js b/pages/success/index.js index 34fcff788..8fa006860 100644 --- a/pages/success/index.js +++ b/pages/success/index.js @@ -101,11 +101,11 @@ const getSuccessType = task => { return 'discarded'; } // HBA amendment licence holder content change on success - if (task?.type === 'amendment' && task?.data?.model === 'project') { + if (task.status === 'resolved' && task?.type === 'amendment' && task?.data?.model === 'project') { return 'licence-amended'; } // HBA PPL transfer establishment content change on success - if (task?.type === 'transfer' && task?.data?.model === 'project') { + if (task.status === 'resolved' && task?.type === 'transfer' && task?.data?.model === 'project') { return 'pil-transfer'; } diff --git a/pages/task/content/status.js b/pages/task/content/status.js index d4d68a14a..dafc8cdc4 100644 --- a/pages/task/content/status.js +++ b/pages/task/content/status.js @@ -239,7 +239,7 @@ module.exports = { 'on-behalf-of-pelh': 'Approved on behalf of establishment licence holder by' }, rejected: { - state: 'Rejected', + state: 'Refused', action: { application: 'Refuse application', amendment: 'Refuse amendment', diff --git a/pages/task/read/content/confirm-hba.js b/pages/task/read/content/confirm-hba.js index df9bdd613..cf208fdf4 100644 --- a/pages/task/read/content/confirm-hba.js +++ b/pages/task/read/content/confirm-hba.js @@ -19,6 +19,9 @@ module.exports = merge({}, baseContent, { applicant: { label: 'Applicant:' }, + currentPPLHolder: { + label: 'Current PPL holder:' + }, pplHolder: { label: 'PPL holder:' }, diff --git a/pages/task/read/content/upload-hba.js b/pages/task/read/content/upload-hba.js index 400c9f333..dd31c1fe1 100644 --- a/pages/task/read/content/upload-hba.js +++ b/pages/task/read/content/upload-hba.js @@ -10,7 +10,13 @@ module.exports = merge({}, baseContent, { The HBA will be visible to ASRU only.`, transferIntro: `To approve this transfer you must upload the PPL assessment form containing the harm benefit analysis (HBA) for this request. - The HBA will be visible to ASRU.`, + The HBA will be visible to ASRU only.`, + transferIntroBody: { + upload: { + label: 'Upload file', + hint: 'You can review and confirm the file you\'ve chosen before approving the transfer. You can also update the file in the future, if required.' + } + }, fields: { upload: { label: 'Upload {{#model.hbaToken}}new {{/model.hbaToken}}file', diff --git a/pages/task/read/views/confirm-hba.jsx b/pages/task/read/views/confirm-hba.jsx index 38de96ae8..324372fba 100644 --- a/pages/task/read/views/confirm-hba.jsx +++ b/pages/task/read/views/confirm-hba.jsx @@ -16,7 +16,8 @@ const ConfirmHba = ({ establishment, licenceHolder, hba, task }) => { if (isAmendment(action, task.type)) { action = 'update'; } - const proposedEstablishmentName = task?.data?.meta?.establishment?.to ?? ''; + const proposedEstablishment = task?.data?.meta?.establishment?.to || null; + const currentEstablishment = task?.data?.meta?.establishment?.from || null; return ( @@ -27,21 +28,21 @@ const ConfirmHba = ({ establishment, licenceHolder, hba, task }) => { subtitle={{`tasks.${task.data.model}.${action}`}} /> { - uploadType === 'transfer' + (uploadType === 'transfer' && proposedEstablishment?.name) ? <>

fields.currentEstablishment.label
- {establishment.name} + {currentEstablishment.name}

fields.proposedEstablishment.label
- {proposedEstablishmentName.name} + {proposedEstablishment.name}

:

@@ -53,11 +54,11 @@ const ConfirmHba = ({ establishment, licenceHolder, hba, task }) => {

} { - uploadType === 'amendment' + (uploadType === 'amendment' && licenceHolder.name) ? <>

- fields.pplHolder.label + fields.currentPPLHolder.label
{task.data.profile.name} @@ -72,7 +73,7 @@ const ConfirmHba = ({ establishment, licenceHolder, hba, task }) => { :

- fields.applicant.label + fields.pplHolder.label
{task.data.profile.name} diff --git a/pages/task/read/views/upload-hba.jsx b/pages/task/read/views/upload-hba.jsx index f6e68e7ad..c6ad16e4a 100644 --- a/pages/task/read/views/upload-hba.jsx +++ b/pages/task/read/views/upload-hba.jsx @@ -33,15 +33,22 @@ const UploadHba = ({ hba, task }) => { : intro }

- {hba && ( -

- - fields.hba.label - -
- {hba.hbaFilename}{' '} -

- )} + { + uploadType === 'transfer' + ?

+ + transferIntroBody.upload.label + +

+ : hba && ( +

+ + fields.hba.label + +
+ {hba.hbaFilename}{' '} +

+ )}
);