From 1d67a91749e6259f5698c281c8d1e0c908eebb05 Mon Sep 17 00:00:00 2001 From: rivalee Date: Mon, 10 Aug 2026 13:47:29 +0100 Subject: [PATCH 1/3] Update button content to authorise --- app/assets/javascript/expandable-sections.js | 6 +++--- app/views/appointments/review-medical-information.html | 4 ++-- tests/e2e/appointment.spec.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/assets/javascript/expandable-sections.js b/app/assets/javascript/expandable-sections.js index ea2ba2d7..31ffa0b0 100644 --- a/app/assets/javascript/expandable-sections.js +++ b/app/assets/javascript/expandable-sections.js @@ -123,7 +123,7 @@ document.addEventListener('DOMContentLoaded', function () { // Initialize progress updateProgress(sections, completedSections) - // Handle "Complete all and continue" button + // Handle "Authorise" button const completeAllButtons = document.querySelectorAll( '.js-complete-all-sections' ) @@ -322,7 +322,7 @@ function openNextIncompleteSection(currentIndex, sections, completedSections) { // Function to highlight the completion button when all sections are done function highlightCompletionButton() { const completeButton = document.querySelector( - 'button:contains("Complete all and continue")' + 'button:contains("Authorise")' ) if (!completeButton) { @@ -330,7 +330,7 @@ function highlightCompletionButton() { const buttons = document.querySelectorAll('button') buttons.forEach((btn) => { - if (btn.textContent.includes('Complete all and continue')) { + if (btn.textContent.includes('Authorise')) { btn.classList.add('nhsuk-button--green') // Highlight in green btn.style.animation = 'pulse 2s infinite' // Add a subtle animation } diff --git a/app/views/appointments/review-medical-information.html b/app/views/appointments/review-medical-information.html index b61b10a5..95668f08 100644 --- a/app/views/appointments/review-medical-information.html +++ b/app/views/appointments/review-medical-information.html @@ -32,7 +32,7 @@

{{ button({ - text: "Complete all and continue" if appointment.workflowStatus['review-medical-information'] != 'completed' else "Next section", + text: "Authorise and continue" if appointment.workflowStatus['review-medical-information'] != 'completed' else "Next section", classes: "nhsuk-u-margin-bottom-0 nhsuk-button js-complete-all-sections" }) }}
@@ -44,7 +44,7 @@

{{ button({ - text: "Complete all and continue", + text: "Authorise and continue", classes: "js-complete-all-sections" }) }} diff --git a/tests/e2e/appointment.spec.js b/tests/e2e/appointment.spec.js index 68e2d5f1..56452935 100644 --- a/tests/e2e/appointment.spec.js +++ b/tests/e2e/appointment.spec.js @@ -132,7 +132,7 @@ test.describe('Screening appointment', () => { await expect(page.getByText('Lump').first()).toBeVisible() await page - .getByRole('button', { name: 'Complete all and continue' }) + .getByRole('button', { name: 'Authorise' }) .first() .click() @@ -162,7 +162,7 @@ test.describe('Screening appointment', () => { page.getByRole('heading', { name: 'Review medical information' }) ).toBeVisible() await page - .getByRole('button', { name: 'Complete all and continue' }) + .getByRole('button', { name: 'Authorise' }) .first() .click() From ac1c972812e1dcaad1736bd40629c449a4c5f1a3 Mon Sep 17 00:00:00 2001 From: rivalee Date: Mon, 10 Aug 2026 14:55:37 +0100 Subject: [PATCH 2/3] add line of text with mammographer name --- app/views/appointments/review-medical-information.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/appointments/review-medical-information.html b/app/views/appointments/review-medical-information.html index 95668f08..95d7c068 100644 --- a/app/views/appointments/review-medical-information.html +++ b/app/views/appointments/review-medical-information.html @@ -35,6 +35,7 @@

text: "Authorise and continue" if appointment.workflowStatus['review-medical-information'] != 'completed' else "Next section", classes: "nhsuk-u-margin-bottom-0 nhsuk-button js-complete-all-sections" }) }} +

This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}

@@ -45,8 +46,9 @@

{{ button({ text: "Authorise and continue", - classes: "js-complete-all-sections" + classes: "js-complete-all-sections nhsuk-u-margin-bottom-0" }) }} +

This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}

{% include "screening-cannot-proceed-link.njk" %}
From 4d181826bb2e9c444fd38038881176acd0e1e780 Mon Sep 17 00:00:00 2001 From: rivalee Date: Wed, 12 Aug 2026 10:55:17 +0100 Subject: [PATCH 3/3] fix bug --- app/routes/clinics.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/routes/clinics.js b/app/routes/clinics.js index faad4200..491a80e7 100644 --- a/app/routes/clinics.js +++ b/app/routes/clinics.js @@ -182,6 +182,9 @@ module.exports = (router) => { } const clinicData = getClinicData(req.session.data, req.params.id) + if (!clinicData) { + return res.redirect('/clinics') + } let remainingCount = filterAppointmentsByStatus( clinicData.appointments, 'remaining'