Skip to content

Commit 909d8c7

Browse files
Updating after session.
1 parent 8ea9758 commit 909d8c7

6 files changed

+37
-47
lines changed

app/data/session-data-defaults.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22

3-
debug: 'false'
3+
debug: 'false',
4+
userRecordFound: 'true'
45

56
}

app/views/v1/_routes.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// External dependencies
22
const express = require('express');
3-
43
const router = express.Router();
54

65
//
@@ -29,8 +28,7 @@ router.post(/name/, function (req, res) {
2928
//
3029
router.post(/postcode/, function (req, res) {
3130

32-
const choice = Math.round(Math.random()); // Either 0 or 1...
33-
const nextPage = ( choice === 0 ) ? 'record-found' : 'no-record-found';
31+
const nextPage = ( req.session.data.userRecordFound === 'true' || req.session.data.userRecordFound === true ) ? 'record-found' : 'no-record-found';
3432

3533
res.redirect(nextPage);
3634

app/views/v1/date-of-birth.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
items: [
3838
{
3939
name: 'day',
40-
classes: 'nhsuk-input--width-2'
40+
classes: 'nhsuk-input--width-2',
41+
value: data.dateOfBirth.day
4142
},
4243
{
4344
name: 'month',

app/views/v1/name.html

+14-12
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,23 @@
3333
}) %}
3434

3535
{{ input({
36-
label: {
37-
text: "First name"
38-
},
39-
classes: "nhsuk-u-width-two-thirds",
40-
id: "first-name",
41-
name: "first-name"
36+
label: {
37+
text: "First name"
38+
},
39+
classes: "nhsuk-u-width-two-thirds",
40+
id: 'firstName',
41+
name: 'firstName',
42+
value: data.firstName
4243
}) }}
4344

4445
{{ input({
45-
label: {
46-
text: "Last name"
47-
},
48-
classes: "nhsuk-u-width-two-thirds",
49-
id: "last-name",
50-
name: "last-name"
46+
label: {
47+
text: "Last name"
48+
},
49+
classes: "nhsuk-u-width-two-thirds",
50+
id: 'lastName',
51+
name: 'lastName',
52+
value: data.lastName
5153
}) }}
5254

5355
{% endcall %}

app/views/v1/no-record-found.html

+16-28
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h2 class="nhsuk-heading-m">The details you gave:</h2>
3434
text: "Name"
3535
},
3636
value: {
37-
text: "Karen Francis"
37+
text: data.firstName + ' ' + data.lastName
3838
},
3939
actions: {
4040
items: [
@@ -99,47 +99,35 @@ <h2 class="nhsuk-heading-l">We cannot find you for one of these reasons:</h2>
9999
}) }}
100100
<!-- ----------- -->
101101
{{ details({
102-
text: "You've recently become entitled to help with NHS costs",
103-
HTML: "
104-
<p>We may not have all your details yet. Our records can take up to 6 weeks to update.</p>
105-
"
102+
text: 'You\'ve recently become entitled to help with NHS costs',
103+
HTML: '<p>We may not have all your details yet. Our records can take up to 6 weeks to update.</p>'
106104
}) }}
107105
<!-- ----------- -->
108106
{{ details({
109-
text: "You're no longer entitled to help with NHS costs",
110-
HTML: "
111-
<p>Your eligibility for free NHS treatment may have ended.</p>
112-
"
107+
text: 'You\'re no longer entitled to help with NHS costs',
108+
HTML: '<p>Your eligibility for free NHS treatment may have ended.</p>'
113109
}) }}
110+
114111
<!-- ----------- -->
112+
115113
{{ details({
116-
text: "Your prescription prepayment certificate (PPC) has expired",
117-
HTML: "
118-
<p>You can <a class=\"nhsuk-link\">buy another PPC online.</a><span>(Opens in a new
119-
tab)</span>
120-
</p>
121-
<p>A PPC lets you get as many NHS prescriptions as you need for a set price. If you regularly
122-
pay prescription charges, a PPC could save you money.</p>
123-
"
114+
text: 'Your prescription prepayment certificate (PPC) has expired',
115+
HTML: '<p>You can <a target="_blank" class="nhsuk-link" href="https://buy-prescription-prepayment-certificate.nhsbsa.nhs.uk/start">buy another PPC online.</a> <span>(Opens in a new tab)</span></p><p>A PPC lets you get as many NHS prescriptions as you need for a set price. If you regularly pay prescription charges, a PPC could save you money.</p>'
124116
}) }}
117+
118+
125119
<!-- ----------- -->
126120
{{ details({
127-
text: "You have a hormone replacement therapy prescription prepayment
128-
certificate (HRT PPC)",
129-
HTML: "
130-
<p>Our NHS exemption checker service cannot currently check for an HRT PPC exemption. We aim
131-
to change this in the future.
132-
</p>
133-
"
121+
text: 'You have a hormone replacement therapy prescription prepayment certificate (HRT PPC)',
122+
HTML: '<p>Our NHS exemption checker service cannot currently check for an HRT PPC exemption. We aim to change this in the future.</p>'
134123
}) }}
135124

136125
<h2 class="nhsuk-heading-m">Check if you should be entitled</h2>
137-
<p class="nhsuk-body">Answer a few more questions to check if you could get help to pay for prescriptions and other
138-
NHS costs.</p>
126+
<p class="nhsuk-body">Answer a few more questions to check if you could get help to pay for prescriptions and other NHS costs.</p>
139127

140128
{{ button({
141-
text: "Check now",
142-
href: '/v1/start'
129+
text: 'Check now',
130+
href: '/v1/start'
143131
}) }}
144132

145133
<!-- <span class="nhsuk-u-visually-hidden"> (Opens in a new tab)</span> -->

app/views/v1/postcode.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
text: "Postcode"
3838
},
3939
classes: "nhsuk-input--width-10",
40-
id: "address-postcode",
41-
name: "address-postcode"
40+
id: "addressPostcode",
41+
name: "addressPostcode"
4242
}) }}
4343

4444
{% endcall %}

0 commit comments

Comments
 (0)