diff --git a/app/routes/bookings.js b/app/routes/bookings.js index 1fe61ad..01b1d57 100644 --- a/app/routes/bookings.js +++ b/app/routes/bookings.js @@ -49,6 +49,7 @@ function bookings (router, shared) { return { availId: avail.id, label: avail.label, + addBreakHref: `/sites/${site.id}/session/${avail.id}/${ctx.anchorDate}/breaks/add`, type: avail.type, startTime: avail.startTime, endTime: avail.endTime, diff --git a/app/routes/sessions.js b/app/routes/sessions.js index c872c7f..ce1fd9c 100644 --- a/app/routes/sessions.js +++ b/app/routes/sessions.js @@ -436,8 +436,10 @@ function sessions (router, shared) { sessionLabel: avail.label, date: req.params.date, draft, + affectedCount: (draft.affectedBookingIds || []).length, formAction: `${getSessionBreaksBaseHref(req.site.id, avail.id, req.params.date)}/check`, backHref, + bookingsHref: `${getSessionBreaksBaseHref(req.site.id, avail.id, req.params.date)}/warning`, changeHref: draft.breakAction === 'change' && Number.isInteger(draft.breakIndex) ? `${getSessionBreaksBaseHref(req.site.id, avail.id, req.params.date)}/${draft.breakIndex}/change` : (draft.breakAction === 'add' ? `${getSessionBreaksBaseHref(req.site.id, avail.id, req.params.date)}/add` : null) diff --git a/app/views/sites/bookings.html b/app/views/sites/bookings.html index 2064a7f..b258b39 100644 --- a/app/views/sites/bookings.html +++ b/app/views/sites/bookings.html @@ -51,6 +51,7 @@

{{ session.label }}

diff --git a/app/views/sites/session-break-check.html b/app/views/sites/session-break-check.html index 441e42c..501a9bc 100644 --- a/app/views/sites/session-break-check.html +++ b/app/views/sites/session-break-check.html @@ -1,6 +1,6 @@ {% extends 'layout.html' %} -{% set pageName = "Check break changes — " + site.name %} +{% set pageName = "Check your answers — " + site.name %} {% block beforeContent %} {{ backLink({ href: backHref }) }} @@ -10,60 +10,59 @@
-

Check break changes

+

Check your answers

-
-
-

Session details

-
-
- {{ summaryList({ rows: [ - { - key: { text: "Session" }, - value: { text: sessionLabel } - }, - { - key: { text: "Date" }, - value: { text: date | formatDateLong } - } - ] }) }} -
-
+

Review the break changes before saving.

-
-
-

Break details

- {% if changeHref %} - - {% endif %} -
-
- {{ summaryList({ rows: [ - { - key: { text: "Action" }, - value: { text: "Remove break" if draft.breakAction === "remove" else ("Change break" if draft.breakAction === "change" else "Add break") } - }, - { - key: { text: "Time" }, - value: { text: (draft.breakStart | formatTime) + " to " + (draft.breakEnd | formatTime) } - } - ] }) }} -
-
+ {% set summaryRows = [ + { + key: { text: "Session" }, + value: { text: sessionLabel } + }, + { + key: { text: "Date" }, + value: { text: date | formatDateLong } + }, + { + key: { text: "Action" }, + value: { text: "Remove break" if draft.breakAction === "remove" else ("Change break" if draft.breakAction === "change" else "Add break") } + }, + { + key: { text: "Time" }, + value: { text: (draft.breakStart | formatTime) + " to " + (draft.breakEnd | formatTime) }, + actions: { + items: [{ + href: changeHref, + text: "Change", + visuallyHiddenText: "break details" + }] + } if changeHref + } + ] %} - {% if draft.affectedBookingIds.length > 0 %} - {% call insetText({}) %} -

- {% if draft.bookingsChoice === "cancel" %} - {{ draft.affectedBookingIds.length }} {{ "booking will" if draft.affectedBookingIds.length === 1 else "bookings will" }} be cancelled when you save these changes. - {% else %} - {{ draft.affectedBookingIds.length }} {{ "booking will" if draft.affectedBookingIds.length === 1 else "bookings will" }} move to Kept bookings so {{ "it can" if draft.affectedBookingIds.length === 1 else "they can" }} be rescheduled. - {% endif %} -

+ {% if affectedCount > 0 %} + {% set summaryRows = (summaryRows.push({ + key: { text: "Bookings affected" }, + value: { text: affectedCount } + }), summaryRows) %} + {% set summaryRows = (summaryRows.push({ + key: { text: "What do you want to do with bookings" }, + value: { text: "Keep bookings" if draft.bookingsChoice === "keep" else ("Cancel " + affectedCount + " " + ("booking" if affectedCount === 1 else "bookings")) }, + actions: { + items: [{ + href: bookingsHref, + text: "Change", + visuallyHiddenText: "what to do with bookings" + }] + } + }), summaryRows) %} + {% endif %} + + {{ summaryList({ rows: summaryRows }) }} + + {% if affectedCount > 0 and draft.bookingsChoice === "cancel" %} + {% call warningCallout({ heading: "You are about to remove " + affectedCount + " " + ("booking" if affectedCount === 1 else "bookings") }) %} +

This cannot be undone.

{% endcall %} {% endif %} diff --git a/docs/decisions/round-1.md b/docs/decisions/round-1.md index b222904..a2ebf0b 100644 --- a/docs/decisions/round-1.md +++ b/docs/decisions/round-1.md @@ -24,6 +24,8 @@ This log captures the decisions indicated by round 1 research findings and notes - Impact: This should make break creation and day-level adjustments more discoverable and reduce avoidable editing errors. - Related assumptions: A-08 time blocks are understood as availability; A-11 implicit breaks are understood; A-20 splitting time blocks to create breaks is discoverable. - Recommendation: Introduce an add-breaks flow that takes users directly from the daily availability view into a simpler break-editing journey. +- Implementation note: The daily bookings screen now includes an Add break button beside Change at session level. This opens the add-break flow with empty time fields. The row-level Add break link remains because it is still useful for prefilling the selected free period's time range. +- Implementation note: The add-break check answers step now uses a more standard NHS check answers layout so it is visually distinct from the change overview page and less likely to be mistaken for another edit screen. - Priority: High ## D-04: Test a schedule pattern that supports different times on different days