Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/assets/javascript/expandable-sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
Expand Down Expand Up @@ -322,15 +322,15 @@ 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) {
// Try a more specific selector if the above doesn't work
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
}
Expand Down
3 changes: 3 additions & 0 deletions app/routes/clinics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 5 additions & 3 deletions app/views/appointments/review-medical-information.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ <h1 class="nhsuk-heading-l">
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
{{ 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"
}) }}
<p class="nhsuk-body-s nhsuk-u-secondary-text-color nhsuk-u-margin-top-2">This will authorise imaging by {{ data.currentUser.firstName }} {{ data.currentUser.lastName }}</p>
</div>
</div>

Expand All @@ -44,9 +45,10 @@ <h1 class="nhsuk-heading-l">

<div class="nhsuk-form-group">
{{ button({
text: "Complete all and continue",
classes: "js-complete-all-sections"
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>

{% include "screening-cannot-proceed-link.njk" %}
</div>
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/appointment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down