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..a2b44e12 100644 --- a/app/views/appointments/review-medical-information.html +++ b/app/views/appointments/review-medical-information.html @@ -13,6 +13,17 @@ {# Display format for medical information sections #} {% set displayFormat = "expander" %} +{# Check if participant has active (non-removed) breast implants #} +{% set hasActiveImplants = false %} +{% set implantRecords = appointment.medicalInformation.medicalHistory.breastImplantsAugmentation %} +{% if implantRecords | length %} + {% for implant in implantRecords %} + {% if not implant.hasBeenRemoved %} + {% set hasActiveImplants = true %} + {% endif %} + {% endfor %} +{% endif %} + {% block pageContent %}
You do not have permission to authorise some views.
" + }) }} + -This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}
+You do not have permission to authorise some views.
" + }) }} + + {% else %} + {{ button({ + text: "Authorise and continue", + classes: "js-complete-all-sections nhsuk-u-margin-bottom-0" + }) }} +This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}
+ {% endif %} - {% include "screening-cannot-proceed-link.njk" %} +