Skip to content

Commit dee8749

Browse files
Improve workflow
1 parent f3278cf commit dee8749

File tree

7 files changed

+71
-75
lines changed

7 files changed

+71
-75
lines changed

app/lib/generators/address-generator.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,20 @@ const generateNearbyAreas = (bsu) => {
9494
* @returns {Object} Generated address object
9595
*/
9696
const generateBSUAppropriateAddress = (bsu) => {
97-
const nearbyAreas = generateNearbyAreas(bsu);
97+
const nearbyAreas = generateNearbyAreas(bsu)
9898

99+
// Helper to capitalize first letter of each word
100+
const capitalise = (str) => str.split(' ')
101+
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
102+
.join(' ')
103+
99104
return {
100105
line1: `${faker.number.int({ min: 1, max: 300 })} ${faker.helpers.arrayElement(STREETS)}`,
101-
line2: Math.random() < 0.3 ? `${faker.word.adjective()} House` : null,
106+
line2: Math.random() < 0.3 ? `${capitalise(faker.word.adjective())} House` : null,
102107
city: faker.helpers.arrayElement(nearbyAreas),
103108
postcode: generateNearbyPostcode(bsu.address.postcode)
104-
};
105-
};
109+
}
110+
}
106111

107112
module.exports = {
108113
generateBSUAppropriateAddress

app/lib/generators/participant-generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { generateBSUAppropriateAddress } = require('./address-generator');
77
// List of possible extra needs
88
const EXTRA_NEEDS = [
99
'Agoraphobia',
10-
'Implants',
10+
'Breast implants',
1111
'Learning difficulties',
1212
'Physical restriction',
1313
'Registered disabled',

app/views/dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ <h1>
4747
clickable: true,
4848
heading: "Messages",
4949
headingClasses: "nhsuk-heading-m",
50-
href: "/patients",
50+
href: "#",
5151
descriptionHtml: false
5252
}) }}
5353
</li>

app/views/events/mammography/attended-not-screened-reason.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% extends 'layout-app.html' %}
33

44

5-
{% set pageHeading = "Screening suspended" %}
5+
{% set pageHeading = "Screening cannot proceed" %}
66

77
{# {% set gridColumn = "nhsuk-grid-column-full" %} #}
88

app/views/events/mammography/imaging.html

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ <h1 class="nhsuk-heading-l">
205205
}) }}
206206

207207
{{ button({
208-
text: "Confirm all images and complete imaging"
208+
text: "Confirm all images and complete screening"
209209
}) }}
210210
</div>
211211
</div>
@@ -221,35 +221,32 @@ <h1 class="nhsuk-heading-l">
221221
const loadingSpinner = document.getElementById('loading-spinner')
222222
const imageCards = document.querySelectorAll('.app-image-card')
223223
const imagingForm = document.getElementById('imaging-form')
224-
let lastLoadTime = 0
225224

226225
// Hide spinner after initial delay
227226
setTimeout(() => {
228227
loadingSpinner.classList.add('app-hidden')
229228

230229
// Show each image sequentially
231230
imageCards.forEach((card, index) => {
232-
const loadTime = 1000 + (index * 1600)
231+
// Increased time between images to 2 seconds
232+
const loadTime = 1000 + (index * 2000)
233233

234234
setTimeout(() => {
235235
card.classList.remove('app-hidden')
236-
// Add fade-in effect
237236
card.style.opacity = 0
238237
card.style.transition = 'opacity 0.5s ease-in'
239238
setTimeout(() => card.style.opacity = 1, 50)
240239

241-
// Show form after first image is loaded
240+
// Show form at same time as first image
242241
if (index === 0) {
243-
setTimeout(() => {
244-
imagingForm.classList.remove('app-hidden')
245-
imagingForm.style.opacity = 0
246-
imagingForm.style.transition = 'opacity 0.5s ease-in'
247-
setTimeout(() => imagingForm.style.opacity = 1, 50)
248-
}, 400) // Show form slightly after first image
242+
imagingForm.classList.remove('app-hidden')
243+
imagingForm.style.opacity = 0
244+
imagingForm.style.transition = 'opacity 0.5s ease-in'
245+
setTimeout(() => imagingForm.style.opacity = 1, 50)
249246
}
250247
}, loadTime)
251248
})
252-
}, 2000)
249+
}, 1000)
253250
})
254251
</script>
255252
{% endblock %}

app/views/events/mammography/medical-information.html

Lines changed: 37 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{% set pageHeading = "Medical information" %}
66

7-
{% set gridColumn = "nhsuk-grid-column-full" %}
7+
{% set gridColumn = "nhsuk-grid-column-two-thirds" %}
88

99
{% set formAction = './imaging' %}
1010

@@ -14,6 +14,15 @@
1414
} %}
1515
#}
1616

17+
{% macro makeRow(params) %}
18+
<h3>{{ params.title }}</h3>
19+
20+
<p>{{params.content}}</p>
21+
22+
<p><a href="#">Provide details</a></p>
23+
24+
{% endmacro %}
25+
1726

1827
{% block pageContent %}
1928

@@ -55,46 +64,9 @@ <h1 class="nhsuk-heading-l">
5564

5665
{% endif %}
5766

58-
{# {{ taskList({
59-
idPrefix: "your-health",
60-
items: [
61-
{
62-
title: {
63-
text: "History of breast cancer"
64-
},
65-
href: "#",
66-
status: taskStatus
67-
},
68-
{
69-
title: {
70-
text: "Other breast diagnosis or proceedures"
71-
},
72-
href: "#",
73-
status: taskStatus
74-
},
75-
{
76-
title: {
77-
text: "Scars"
78-
},
79-
href: "#",
80-
status: taskStatus
81-
},
82-
{
83-
title: {
84-
text: "Current health status"
85-
},
86-
href: "#",
87-
status: taskStatus
88-
},
89-
{
90-
title: {
91-
text: "Breast symptoms"
92-
},
93-
href: "#",
94-
status: taskStatus
95-
}
96-
]
97-
}) }} #}
67+
{# {{ makeRow({
68+
title: "Breast implants"
69+
})}} #}
9870

9971
{{ summaryList({
10072
rows: [
@@ -117,10 +89,12 @@ <h1 class="nhsuk-heading-l">
11789
},
11890
{
11991
key: {
120-
text: "Implanted medical devices and pacemakers"
92+
text: "Implanted medical devices and pacemakers",
93+
classes: "nhsuk-u-width-one-half"
12194
},
12295
value: {
123-
html: valueHtml
96+
html: valueHtml,
97+
classes: "nhsuk-u-width-one-half"
12498
},
12599
actions: {
126100
items: [
@@ -148,7 +122,7 @@ <h1 class="nhsuk-heading-l">
148122
}
149123
]
150124
}
151-
},
125+
} if false,
152126
{
153127
key: {
154128
text: "Pregnancy and breastfeeding"
@@ -202,7 +176,7 @@ <h1 class="nhsuk-heading-l">
202176
},
203177
{
204178
key: {
205-
text: "Scars"
179+
text: "Scars and other visual features"
206180
},
207181
value: {
208182
html: valueHtml
@@ -234,6 +208,23 @@ <h1 class="nhsuk-heading-l">
234208
]
235209
}
236210
},
211+
{
212+
key: {
213+
text: "Hormone replacement therapy (HRT)"
214+
},
215+
value: {
216+
html: valueHtml
217+
},
218+
actions: {
219+
items: [
220+
{
221+
href: "#",
222+
text: "Change",
223+
visuallyHiddenText: "contact details"
224+
}
225+
]
226+
}
227+
},
237228
{
238229
key: {
239230
text: "Breast symptoms"
@@ -274,7 +265,7 @@ <h1 class="nhsuk-heading-l">
274265
{% if query.taskStatus !== 'complete' %}
275266
<div class="nhsuk-form-group">
276267
{{ button({
277-
text: "Answer incomplete as 'No' / 'None'",
268+
text: "Answer all incomplete as 'No' / 'None'",
278269
classes: "nhsuk-button--secondary",
279270
href: "./medical-information?taskStatus=complete"
280271
}) }}

app/views/events/show.html

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
{% block pageContent %}
1717

18-
{{ participant | log }}
18+
{{ participant | log("Participant:") }}
1919

2020
{% include "event-header.njk" %}
2121

@@ -203,7 +203,7 @@ <h3>Last known mammogram</h3>
203203
<p>{{ "No details" | asHint }}</p>
204204
{% endif %}
205205

206-
{{clinicHistory | log("clinic history") }}
206+
{{clinicHistory | log("Clinic history") }}
207207

208208
{{ button({
209209
text: "Record additional screening history",
@@ -263,7 +263,7 @@ <h3>Last known mammogram</h3>
263263

264264
{% set screeningHtml %}
265265

266-
<h3>Confirm the following before continuing</h3>
266+
<h3 class="nhsuk-heading-s">Confirm the following before continuing</h3>
267267

268268
<ul>
269269
<li>Identity has been confirmed</li>
@@ -275,20 +275,23 @@ <h3>Confirm the following before continuing</h3>
275275
</li>
276276
</ul>
277277

278-
{# <h3>Special status reviewed</h3>
279-
280-
<ul>
281-
<li>Breast implants</li>
282-
<li>Date of last mammogram</li>
283-
</ul> #}
284278
<form action="./{{eventId}}/start" method="post">
279+
280+
{# {{ input({
281+
label: {
282+
text: "Full name"
283+
},
284+
id: "example",
285+
name: "save[participant--" + participantId + "][first-name]"
286+
}) }} #}
287+
285288
{{ radios({
286289
idPrefix: "beginScreening",
287290
name: "beginScreening",
288291
fieldset: {
289292
legend: {
290293
text: "Can screening proceed?",
291-
classes: "nhsuk-fieldset__legend--m",
294+
classes: "nhsuk-fieldset__legend--s",
292295
isPageHeading: false
293296
}
294297
},

0 commit comments

Comments
 (0)