Skip to content

Commit

Permalink
Asl 4413 hba upload functionality in ppl transfer journeys (#1587)
Browse files Browse the repository at this point in the history
* Latest functional and content changes towards ASL-4413, including those cherry picked from commit b77a538

* - 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 <[email protected]>
Co-authored-by: Jeffrey Horton <[email protected]>
  • Loading branch information
3 people authored May 17, 2024
1 parent 6aff21d commit 6a270e8
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 52 deletions.
50 changes: 25 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions pages/success/content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand All @@ -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.'
}
}
};
4 changes: 2 additions & 2 deletions pages/success/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down
2 changes: 1 addition & 1 deletion pages/task/content/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 3 additions & 0 deletions pages/task/read/content/confirm-hba.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module.exports = merge({}, baseContent, {
applicant: {
label: 'Applicant:'
},
currentPPLHolder: {
label: 'Current PPL holder:'
},
pplHolder: {
label: 'PPL holder:'
},
Expand Down
8 changes: 7 additions & 1 deletion pages/task/read/content/upload-hba.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
15 changes: 8 additions & 7 deletions pages/task/read/views/confirm-hba.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<WidthContainer>
Expand All @@ -27,21 +28,21 @@ const ConfirmHba = ({ establishment, licenceHolder, hba, task }) => {
subtitle={<Snippet>{`tasks.${task.data.model}.${action}`}</Snippet>}
/>
{
uploadType === 'transfer'
(uploadType === 'transfer' && proposedEstablishment?.name)
? <>
<p>
<strong>
<Snippet>fields.currentEstablishment.label</Snippet>
</strong>
<br />
{establishment.name}
{currentEstablishment.name}
</p>
<p>
<strong>
<Snippet>fields.proposedEstablishment.label</Snippet>
</strong>
<br />
{proposedEstablishmentName.name}
{proposedEstablishment.name}
</p>
</>
: <p>
Expand All @@ -53,11 +54,11 @@ const ConfirmHba = ({ establishment, licenceHolder, hba, task }) => {
</p>
}
{
uploadType === 'amendment'
(uploadType === 'amendment' && licenceHolder.name)
? <>
<p>
<strong>
<Snippet>fields.pplHolder.label</Snippet>
<Snippet>fields.currentPPLHolder.label</Snippet>
</strong>
<br />
{task.data.profile.name}
Expand All @@ -72,7 +73,7 @@ const ConfirmHba = ({ establishment, licenceHolder, hba, task }) => {
</>
: <p>
<strong>
<Snippet>fields.applicant.label</Snippet>
<Snippet>fields.pplHolder.label</Snippet>
</strong>
<br />
{task.data.profile.name}
Expand Down
25 changes: 16 additions & 9 deletions pages/task/read/views/upload-hba.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,22 @@ const UploadHba = ({ hba, task }) => {
: <Snippet action={uploadAction} type={uploadType}>intro</Snippet>
}
</p>
{hba && (
<p>
<strong>
<Snippet>fields.hba.label</Snippet>
</strong>
<br />
<a href={`/attachment/${hba.hbaToken}`} download={`${hba.hbaFilename}`}>{hba.hbaFilename}</a>{' '}
</p>
)}
{
uploadType === 'transfer'
? <p>
<strong>
<Snippet>transferIntroBody.upload.label</Snippet>
</strong>
</p>
: hba && (
<p>
<strong>
<Snippet>fields.hba.label</Snippet>
</strong>
<br />
<a href={`/attachment/${hba.hbaToken}`} download={`${hba.hbaFilename}`}>{hba.hbaFilename}</a>{' '}
</p>
)}
</Form>
</WidthContainer>
);
Expand Down

0 comments on commit 6a270e8

Please sign in to comment.