Skip to content

Commit 4457b09

Browse files
committed
Rewording of clinic invite content for individual children
Also: - stop using a warning callout if that's the only content on the page - offer a back-out link if none of the clinic-ready programmes currently has a scheduled clinic
1 parent 98ac1fe commit 4457b09

2 files changed

Lines changed: 56 additions & 30 deletions

File tree

app/locales/en.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,27 +1334,27 @@ export const en = {
13341334
title: {
13351335
multiple:
13361336
'Which programmes do you want to send a clinic booking invitation for?',
1337-
single:
1338-
'Send a clinic booking invitation for {{firstName}} {{lastName}}'
1337+
single: {
1338+
clinicsScheduled:
1339+
'Send a clinic booking invitation for {{firstName}} {{lastName}}',
1340+
noClinicsScheduled:
1341+
'Are you sure you want to send a clinic booking invitation for {{firstName}} {{lastName}}?'
1342+
}
13391343
},
13401344
clinicCount: {
13411345
hint: '{count, plural, =0 {No clinics are scheduled for {programmeName}} one {1 clinic is scheduled for {programmeName}} other {# clinics are scheduled for {programmeName}}}',
1342-
paragraph:
1343-
'{count, plural, one {There is 1 clinic scheduled for the {programmeName} programme.} other {There are # clinics scheduled for the {programmeName} programme.}}'
1346+
someParagraph:
1347+
'{count, plural, one {There is 1 clinic scheduled for the {programmeName} programme.} other {There are # clinics scheduled for the {programmeName} programme.}}',
1348+
noneParagraph:
1349+
'No clinics are scheduled for the {{programmeName}} programme. Only send an invitation if you can offer {{programmeName}} alongside other vaccinations.'
13441350
},
13451351
scheduledClinicWarning: {
1346-
multiple: {
1347-
title: 'Programmes without clinics',
1348-
description:
1349-
'{count, plural, one {No clinics are scheduled for <b>{programmeNames}</b> vaccinations. Only select this option if you’re able to offer it as a catch-up alongside other vaccinations.} other {No clinics are scheduled for <b>{programmeNames}</b> vaccinations. Only select these options if you’re able to offer them as a catch-up alongside other vaccinations.}}'
1350-
},
1351-
single: {
1352-
title: 'Programmes without clinics',
1353-
description:
1354-
'{count, plural, one {No clinics are scheduled for <b>{programmeNames}</b> vaccinations. Only send an invitation if you’re able to offer it as a catch-up alongside other vaccinations.} other {No clinics are scheduled for <b>{programmeNames}</b> vaccinations. Only send an invitation if you’re able to offer them as a catch-up alongside other vaccinations.}}'
1355-
}
1352+
title: 'Programmes without clinics',
1353+
description:
1354+
'{count, plural, one {No clinics are scheduled for the <b>{programmeNames}</b> programme. Only select this option if you can offer it alongside other vaccinations.} other {No clinics are scheduled for the <b>{programmeNames}</b> programmes. Only select these options if you can offer them alongside other vaccinations.}}'
13561355
},
13571356
confirm: 'Send clinic invitation',
1357+
cancel: 'Go back to child record',
13581358
success:
13591359
'{{patientName}} has been invited to attend a clinic for {{selectedProgrammes}} vaccination'
13601360
},

app/views/patient/invite-to-clinic.njk

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
{% extends "_layouts/form.njk" %}
22

33
{% set paths = { back: patient.uri } %}
4+
{% set confirmButtonText = __("patient.inviteToClinic.confirm") %}
5+
46
{% if clinicReadyProgrammes.length > 1 %}
57
{% set title = __("patient.inviteToClinic.title.multiple") %}
68
{% else %}
7-
{% set title = __("patient.inviteToClinic.title.single", { firstName: patient.firstName, lastName: patient.lastName }) %}
9+
{% if clinicReadyProgrammesWithoutClinics.count === 0 %}
10+
{% set title = __("patient.inviteToClinic.title.single.clinicsScheduled", { firstName: patient.firstName, lastName: patient.lastName }) %}
11+
{% else %}
12+
{% set title = __("patient.inviteToClinic.title.single.noClinicsScheduled", { firstName: patient.firstName, lastName: patient.lastName }) %}
13+
{% endif %}
814
{% endif %}
9-
{% set confirmButtonText = __("patient.inviteToClinic.confirm") %}
1015

1116
{% set checkboxItems = [] %}
1217
{% for patientProgramme in clinicReadyProgrammes %}
@@ -32,7 +37,10 @@
3237
}) }}
3338

3439
{% if clinicReadyProgrammes.length > 1 %}
35-
{# Let the user choose which programmes to invite for, based on availability of clinics #}
40+
{#
41+
The child is clinic-ready for multiple programmes, so we'll offer checkboxes to invite to all of them,
42+
regardless of clinic availability — but warn if any don't have clinics available
43+
#}
3644
{{ checkboxes({
3745
fieldset: {
3846
attributes: {
@@ -44,36 +52,54 @@
4452
}) }}
4553

4654
{{ warningCallout({
47-
heading: __("patient.inviteToClinic.scheduledClinicWarning.multiple.title"),
48-
text: __mf("patient.inviteToClinic.scheduledClinicWarning.multiple.description",
55+
heading: __("patient.inviteToClinic.scheduledClinicWarning.title"),
56+
text: __mf("patient.inviteToClinic.scheduledClinicWarning.description",
4957
{
5058
programmeNames: clinicReadyProgrammesWithoutClinics.names,
5159
count: clinicReadyProgrammesWithoutClinics.count
5260
}) | safe
5361
}) if clinicReadyProgrammesWithoutClinics.count > 0 }}
5462
{% else %}
5563
{#
56-
There must be only 1 clinic ready programme, so only show the paragraph about number of clinics
64+
There must be exactly 1 clinic-ready programme, so only show the paragraph about number of clinics
5765
for this one programme if there actually are some. Otherwise, lean on the warning callout.
5866
#}
59-
{% if clinicReadyProgrammesWithoutClinics.length === 0 %}
60-
{{ __mf("patient.inviteToClinic.clinicCount.paragraph",
67+
{% if clinicReadyProgrammesWithoutClinics.count === 0 %}
68+
{# Tell the user how many clinics are available for this child's one clinic-ready programme #}
69+
{{ __mf("patient.inviteToClinic.clinicCount.someParagraph",
6170
{
6271
programmeName: clinicReadyProgrammes[0].programme.name | replace("Flu", "flu"),
6372
count: clinicReadyProgrammes[0].scheduledClinicCount
64-
}) }}
73+
}) | nhsukMarkdown }}
6574
{% else %}
66-
{{ warningCallout({
67-
heading: __("patient.inviteToClinic.scheduledClinicWarning.single.title"),
68-
text: __mf("patient.inviteToClinic.scheduledClinicWarning.single.description",
75+
{# Tell the user there are NO clinics available for this child's one clinic-ready programme #}
76+
{{ __("patient.inviteToClinic.clinicCount.noneParagraph",
6977
{
70-
programmeNames: clinicReadyProgrammesWithoutClinics.names,
71-
count: clinicReadyProgrammesWithoutClinics.count
72-
}) | safe
73-
}) if clinicReadyProgrammesWithoutClinics.count > 0 }}
78+
programmeName: clinicReadyProgrammesWithoutClinics.names
79+
}) | nhsukMarkdown
80+
}}
7481
{% endif %}
7582

7683
{# Fake the user's selection of a checkbox for this programme #}
7784
<input type="hidden" id="clinicProgramme_ids" name="clinicProgramme_ids" value="{{clinicReadyProgrammes[0].programme_id}}" />
7885
{% endif %}
7986
{% endblock %}
87+
88+
{% block afterForm %}
89+
{# Include a link to back out if there are no clinics available for the clinic-ready programmes #}
90+
{% if clinicReadyProgrammes.length === clinicReadyProgrammesWithoutClinics.count %}
91+
{{ appButtonGroup({
92+
buttons: [{
93+
text: confirmButtonText,
94+
variant: confirmButtonVariant
95+
}],
96+
links: [{
97+
text: __("patient.inviteToClinic.cancel"),
98+
href: paths.back
99+
}]
100+
}) }}
101+
{% else %}
102+
{{ super() }}
103+
{% endif %}
104+
{% endblock %}
105+

0 commit comments

Comments
 (0)