Skip to content

Commit 8033cc0

Browse files
authored
Merge pull request #16 from NHSDigital/d-03-break-flow-polish
D-03: refine add-break flow entry points and check answers
2 parents 12cc007 + 350ef56 commit 8033cc0

5 files changed

Lines changed: 57 additions & 52 deletions

File tree

app/routes/bookings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function bookings (router, shared) {
4949
return {
5050
availId: avail.id,
5151
label: avail.label,
52+
addBreakHref: `/sites/${site.id}/session/${avail.id}/${ctx.anchorDate}/breaks/add`,
5253
type: avail.type,
5354
startTime: avail.startTime,
5455
endTime: avail.endTime,

app/routes/sessions.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,10 @@ function sessions (router, shared) {
436436
sessionLabel: avail.label,
437437
date: req.params.date,
438438
draft,
439+
affectedCount: (draft.affectedBookingIds || []).length,
439440
formAction: `${getSessionBreaksBaseHref(req.site.id, avail.id, req.params.date)}/check`,
440441
backHref,
442+
bookingsHref: `${getSessionBreaksBaseHref(req.site.id, avail.id, req.params.date)}/warning`,
441443
changeHref: draft.breakAction === 'change' && Number.isInteger(draft.breakIndex)
442444
? `${getSessionBreaksBaseHref(req.site.id, avail.id, req.params.date)}/${draft.breakIndex}/change`
443445
: (draft.breakAction === 'add' ? `${getSessionBreaksBaseHref(req.site.id, avail.id, req.params.date)}/add` : null)

app/views/sites/bookings.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ <h1 class="nhsuk-heading-l">
5151
<div class="app-session__header">
5252
<h2 class="app-session__title nhsuk-heading-m">{{ session.label }}</h2>
5353
<div class="app-session__actions">
54+
<a href="{{ session.addBreakHref }}" class="nhsuk-button nhsuk-button--secondary nhsuk-button--small">Add break</a>
5455
<a href="/sites/{{ site.id }}/session/{{ session.availId }}/{{ date }}" class="nhsuk-button nhsuk-button--secondary nhsuk-button--small">Change</a>
5556
</div>
5657
</div>

app/views/sites/session-break-check.html

Lines changed: 51 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends 'layout.html' %}
22

3-
{% set pageName = "Check break changes — " + site.name %}
3+
{% set pageName = "Check your answers — " + site.name %}
44

55
{% block beforeContent %}
66
{{ backLink({ href: backHref }) }}
@@ -10,60 +10,59 @@
1010
<div class="nhsuk-grid-row">
1111
<div class="nhsuk-grid-column-two-thirds">
1212

13-
<h1 class="nhsuk-heading-xl">Check break changes</h1>
13+
<h1 class="nhsuk-heading-xl">Check your answers</h1>
1414

15-
<div class="app-summary-card">
16-
<div class="app-summary-card__title-wrapper">
17-
<h2 class="app-summary-card__title">Session details</h2>
18-
</div>
19-
<div class="app-summary-card__content">
20-
{{ summaryList({ rows: [
21-
{
22-
key: { text: "Session" },
23-
value: { text: sessionLabel }
24-
},
25-
{
26-
key: { text: "Date" },
27-
value: { text: date | formatDateLong }
28-
}
29-
] }) }}
30-
</div>
31-
</div>
15+
<p class="nhsuk-body">Review the break changes before saving.</p>
3216

33-
<div class="app-summary-card">
34-
<div class="app-summary-card__title-wrapper">
35-
<h2 class="app-summary-card__title">Break details</h2>
36-
{% if changeHref %}
37-
<ul class="app-summary-card__actions">
38-
<li class="app-summary-card__action">
39-
<a href="{{ changeHref }}">Change<span class="nhsuk-u-visually-hidden"> break details</span></a>
40-
</li>
41-
</ul>
42-
{% endif %}
43-
</div>
44-
<div class="app-summary-card__content">
45-
{{ summaryList({ rows: [
46-
{
47-
key: { text: "Action" },
48-
value: { text: "Remove break" if draft.breakAction === "remove" else ("Change break" if draft.breakAction === "change" else "Add break") }
49-
},
50-
{
51-
key: { text: "Time" },
52-
value: { text: (draft.breakStart | formatTime) + " to " + (draft.breakEnd | formatTime) }
53-
}
54-
] }) }}
55-
</div>
56-
</div>
17+
{% set summaryRows = [
18+
{
19+
key: { text: "Session" },
20+
value: { text: sessionLabel }
21+
},
22+
{
23+
key: { text: "Date" },
24+
value: { text: date | formatDateLong }
25+
},
26+
{
27+
key: { text: "Action" },
28+
value: { text: "Remove break" if draft.breakAction === "remove" else ("Change break" if draft.breakAction === "change" else "Add break") }
29+
},
30+
{
31+
key: { text: "Time" },
32+
value: { text: (draft.breakStart | formatTime) + " to " + (draft.breakEnd | formatTime) },
33+
actions: {
34+
items: [{
35+
href: changeHref,
36+
text: "Change",
37+
visuallyHiddenText: "break details"
38+
}]
39+
} if changeHref
40+
}
41+
] %}
5742

58-
{% if draft.affectedBookingIds.length > 0 %}
59-
{% call insetText({}) %}
60-
<p>
61-
{% if draft.bookingsChoice === "cancel" %}
62-
{{ draft.affectedBookingIds.length }} {{ "booking will" if draft.affectedBookingIds.length === 1 else "bookings will" }} be cancelled when you save these changes.
63-
{% else %}
64-
{{ 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.
65-
{% endif %}
66-
</p>
43+
{% if affectedCount > 0 %}
44+
{% set summaryRows = (summaryRows.push({
45+
key: { text: "Bookings affected" },
46+
value: { text: affectedCount }
47+
}), summaryRows) %}
48+
{% set summaryRows = (summaryRows.push({
49+
key: { text: "What do you want to do with bookings" },
50+
value: { text: "Keep bookings" if draft.bookingsChoice === "keep" else ("Cancel " + affectedCount + " " + ("booking" if affectedCount === 1 else "bookings")) },
51+
actions: {
52+
items: [{
53+
href: bookingsHref,
54+
text: "Change",
55+
visuallyHiddenText: "what to do with bookings"
56+
}]
57+
}
58+
}), summaryRows) %}
59+
{% endif %}
60+
61+
{{ summaryList({ rows: summaryRows }) }}
62+
63+
{% if affectedCount > 0 and draft.bookingsChoice === "cancel" %}
64+
{% call warningCallout({ heading: "You are about to remove " + affectedCount + " " + ("booking" if affectedCount === 1 else "bookings") }) %}
65+
<p>This cannot be undone.</p>
6766
{% endcall %}
6867
{% endif %}
6968

docs/decisions/round-1.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ This log captures the decisions indicated by round 1 research findings and notes
2424
- Impact: This should make break creation and day-level adjustments more discoverable and reduce avoidable editing errors.
2525
- 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.
2626
- Recommendation: Introduce an add-breaks flow that takes users directly from the daily availability view into a simpler break-editing journey.
27+
- 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.
28+
- 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.
2729
- Priority: High
2830

2931
## D-04: Test a schedule pattern that supports different times on different days

0 commit comments

Comments
 (0)