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/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' diff --git a/app/views/appointments/review-medical-information.html b/app/views/appointments/review-medical-information.html index b61b10a5..95d7c068 100644 --- a/app/views/appointments/review-medical-information.html +++ b/app/views/appointments/review-medical-information.html @@ -32,9 +32,10 @@
This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}
This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}
{% include "screening-cannot-proceed-link.njk" %}