IRMER authorisation – change content on medical info button - #401
IRMER authorisation – change content on medical info button#401rivalee wants to merge 5 commits into
Conversation
| updateProgress(sections, completedSections) | ||
|
|
||
| // Handle "Complete all and continue" button | ||
| // Handle "Authorise" button |
There was a problem hiding this comment.
| // Handle "Authorise" button | |
| // Handle "Complete all and continue" button |
| function highlightCompletionButton() { | ||
| const completeButton = document.querySelector( | ||
| 'button:contains("Complete all and continue")' | ||
| 'button:contains("Authorise")' |
There was a problem hiding this comment.
| 'button:contains("Authorise")' | |
| 'button:contains("Complete all and continue")' |
There was a problem hiding this comment.
We still need to inform users of what happens when clicking this button - switching to 'Authorise' removes this, creating risk they would skip some of the medical info steps.
For qualified users, we should include copy associated to the button rather than changing the button itself
|
|
||
| buttons.forEach((btn) => { | ||
| if (btn.textContent.includes('Complete all and continue')) { | ||
| if (btn.textContent.includes('Authorise')) { |
There was a problem hiding this comment.
| if (btn.textContent.includes('Authorise')) { | |
| if (btn.textContent.includes('Complete all and continue')) { |
|
|
||
| await page | ||
| .getByRole('button', { name: 'Complete all and continue' }) | ||
| .getByRole('button', { name: 'Authorise' }) |
There was a problem hiding this comment.
| .getByRole('button', { name: 'Authorise' }) | |
| .getByRole('button', { name: 'Complete all and continue' }) |
| ).toBeVisible() | ||
| await page | ||
| .getByRole('button', { name: 'Complete all and continue' }) | ||
| .getByRole('button', { name: 'Authorise' }) |
There was a problem hiding this comment.
| .getByRole('button', { name: 'Authorise' }) | |
| .getByRole('button', { name: 'Complete all and continue' }) |
| </div> | ||
| {% else %} | ||
| {{ button({ | ||
| text: "Authorise and continue", |
There was a problem hiding this comment.
| text: "Authorise and continue", | |
| text: "Complete all and continue", |
| text: "Authorise and continue", | ||
| classes: "js-complete-all-sections nhsuk-u-margin-bottom-0" | ||
| }) }} | ||
| <p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-top-2 nhsuk-u-margin-bottom-5">This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}</p> |
There was a problem hiding this comment.
| <p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-top-2 nhsuk-u-margin-bottom-5">This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}</p> | |
| <p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-top-2 nhsuk-u-margin-bottom-5">By continuing, you ({{ data.currentUser.firstName }} {{ data.currentUser.lastName }}) are authorising images to be taken</p> |
| name: "irmerAuthoriser", | ||
| fieldset: { | ||
| legend: { | ||
| text: "Select an authoriser" |
There was a problem hiding this comment.
| text: "Select an authoriser" | |
| text: "Who is authorising that images can be taken for this appointment?" |
|
|
||
| {{ appModal({ | ||
| id: "choose-authoriser-modal", | ||
| title: "Choose an authoriser", |
There was a problem hiding this comment.
| title: "Choose an authoriser", | |
| title: "Nominate a mammographer", |
| const selected = modal.querySelector("input[name='irmerAuthoriser']:checked") | ||
| if (selected) { | ||
| document.querySelectorAll(".js-irmer-authorise-button").forEach((btn) => { | ||
| btn.textContent = "Authorise with " + selected.value + " and continue" |
There was a problem hiding this comment.
| btn.textContent = "Authorise with " + selected.value + " and continue" | |
| btn.textContent = "Complete all and continue" |
| legend: { | ||
| text: "Select an authoriser" | ||
| } | ||
| }, |
There was a problem hiding this comment.
| }, | |
| }, | |
| hint: { | |
| text: "The person selected must be present while images are being taken" | |
| }, |
There was a problem hiding this comment.
Hint text below the question clarifying the role of the person being picked
| btn.classList.add("js-complete-all-sections") | ||
| btn.classList.remove("js-choose-authoriser-link") | ||
| }) | ||
| // Show the alternative authoriser links |
There was a problem hiding this comment.
| // Show the alternative authoriser links | |
| document.querySelectorAll(".js-authoriser-confirmation").forEach((p) => { | |
| p.textContent = `By continuing, ${selected.value} is authorising images to be taken`; | |
| }); | |
| // Show the alternative authoriser links |
This updates the content on the medical information page to cover IRMER authorisation, both for when the mammographer has permission to authorise, and when they need to sign the authorisation with another mammographer's name.
When the mammographer has permission to authorise imaging
When the mammographer doesn't have permission and needs to authorise using another's name