Skip to content

Commit 8be9397

Browse files
Fix record vaccine done page (#382)
1 parent 960f95b commit 8be9397

File tree

3 files changed

+32
-52
lines changed

3 files changed

+32
-52
lines changed

app/routes/record-vaccinations.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,16 @@ router.get('/record-vaccinations/check', (req, res) => {
978978
})
979979
})
980980

981+
router.get('/record-vaccinations/review-previous', (req, res) => {
982+
const data = req.session.data
983+
const vaccinator = data.users.find((user) => user.id === data.vaccinatorId)
984+
985+
res.render('record-vaccinations/review-previous', {
986+
vaccinator
987+
})
988+
})
989+
990+
981991
router.post('/record-vaccinations/answer-injection-site', (req, res) => {
982992
const data = req.session.data
983993
const injectionSite = data.injectionSite

app/views/record-vaccinations/done.html

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,6 @@
2727
html: panelHtml
2828
}) }}
2929

30-
{% if 1==1 %}
31-
32-
{{ radios({
33-
idPrefix: "next-step",
34-
name: "nextStep",
35-
fieldset: {
36-
legend: {
37-
text: "What would you like to do next?",
38-
classes: "nhsuk-fieldset__legend--m"
39-
}
40-
},
41-
errorMessage: {
42-
text: error.text
43-
} if error,
44-
items: [
45-
{
46-
value: "same-patient-another-vaccination",
47-
text: "Record a second vaccination for " + patientName
48-
},
49-
{
50-
value: "same-vaccination-another-patient",
51-
text: "Return to Today’s appointments"
52-
}
53-
]
54-
}) }}
55-
56-
{{ button({
57-
text: "Continue"
58-
})}}
59-
60-
61-
{% else %}
62-
6330
<form action="/record-vaccinations/what-next" method="post" novalidate>
6431

6532
{% set lowercaseVaccineName %}
@@ -76,6 +43,26 @@
7643
{% endif %}
7744
{% endset %}
7845

46+
{% set items = [] %}
47+
{% set items = (items.push({
48+
value: "same-patient-another-vaccination",
49+
text: patientName + "’s next vaccination"
50+
}), items) %}
51+
52+
{% set items = (items.push({
53+
value: "same-vaccination-another-patient",
54+
text: lowercaseVaccineName + " vaccination for another patient"
55+
}), items) %}
56+
57+
{% set items = (items.push({
58+
divider: "or"
59+
}), items) %}
60+
61+
{% set items = (items.push({
62+
value: "different-vaccination-another-patient",
63+
text: "A different vaccination for another patient"
64+
}), items) %}
65+
7966
{{ radios({
8067
idPrefix: "next-step",
8168
name: "nextStep",
@@ -88,30 +75,13 @@
8875
errorMessage: {
8976
text: error.text
9077
} if error,
91-
items: [
92-
{
93-
value: "same-patient-another-vaccination",
94-
text: patientName + "’s next vaccination"
95-
},
96-
{
97-
value: "same-vaccination-another-patient",
98-
text: lowercaseVaccineName + " vaccination for another patient"
99-
},
100-
{
101-
divider: "or"
102-
},
103-
{
104-
value: "different-vaccination-another-patient",
105-
text: "A different vaccination for another patient"
106-
}
107-
]
78+
items: items
10879
}) }}
10980

11081
{{ button({
11182
text: "Continue"
11283
})}}
11384
</form>
114-
{% endif %}
11585

11686
</div>
11787
</div>

app/views/record-vaccinations/review-previous.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ <h1 class="nhsuk-heading-l">Review your previous answers</h1>
8989
text: "Vaccinator"
9090
},
9191
value: {
92-
html: data.vaccinator
92+
html: (vaccinator.firstName + " " + vaccinator.lastName)
9393
},
9494
actions: {
9595
items: [

0 commit comments

Comments
 (0)