hof 22.4.0-fix-textarea-error-message-beta → 22.4.0-title-update-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
- ## 2025-03-17, Version 22.4.0 (Stable), @Rhodine-orleans-lindsay
1
+ ## 2025-04-15, Version 22.4.0 (Stable), @Rhodine-orleans-lindsay
2
+ ### Changed
3
+ - Amends page title format to follow the govuk design system so that the service name is now included in the the title by setting the `header` or `serviceName` in journey.json.
4
+ - Where page titles need to be different from page headings, if `title` is set pages.json, it can be used in the page title instead of `header`.
5
+ ### Security
6
+ - Updates patch and minor dependencies
7
+
8
+ ## 2025-03-17, Version 22.3.2 (Stable), @Rhodine-orleans-lindsay
2
9
  ### Fixed
3
10
  - Error message now shows above textarea field if label is hidden
4
11
  ### Security
@@ -121,6 +121,7 @@ module.exports = class Controller extends BaseController {
121
121
  title: this.getTitle(route, lookup, req.form.options.fields, res.locals),
122
122
  journeyHeaderURL: this.getJourneyHeaderURL(req.baseUrl),
123
123
  header: this.getHeader(route, lookup, res.locals),
124
+ serviceName: this.getServiceName(lookup, res.locals),
124
125
  captionHeading: this.getCaptionHeading(route, lookup, res.locals),
125
126
  warning: this.getWarning(route, lookup, res.locals),
126
127
  subHeading: this.getSubHeading(route, lookup, res.locals),
@@ -147,6 +148,13 @@ module.exports = class Controller extends BaseController {
147
148
  return lookup(`pages.${route}.header`, locals);
148
149
  }
149
150
 
151
+ getServiceName(lookup, locals) {
152
+ return lookup([
153
+ 'journey.serviceName',
154
+ 'journey.header'
155
+ ], locals);
156
+ }
157
+
150
158
  getCaptionHeading(route, lookup, locals) {
151
159
  return lookup(`pages.${route}.captionHeading`, locals);
152
160
  }
@@ -165,6 +173,7 @@ module.exports = class Controller extends BaseController {
165
173
  fieldName = Object.keys(fields)[0];
166
174
  }
167
175
  return lookup([
176
+ `pages.${route}.title`,
168
177
  `pages.${route}.header`,
169
178
  `fields.${fieldName}.label`,
170
179
  `fields.${fieldName}.legend`
@@ -185,12 +194,12 @@ module.exports = class Controller extends BaseController {
185
194
  // get first option for radios and checkbox
186
195
  if (field.mixin === 'radio-group' || field.mixin === 'checkbox-group') {
187
196
  // get first option for radios and checkbox where there is a toggle
188
- if(typeof field.options[0] === 'object') {
197
+ if (typeof field.options[0] === 'object') {
189
198
  req.form.errors[key].errorLinkId = key + '-' + field.options[0].value;
190
199
  } else {
191
200
  req.form.errors[key].errorLinkId = key + '-' + field.options[0];
192
201
  }
193
- // eslint-disable-next-line brace-style
202
+ // eslint-disable-next-line brace-style
194
203
  }
195
204
  // get first field for date input control
196
205
  else if (field && field.mixin === 'input-date') {
@@ -3,7 +3,7 @@
3
3
  {{> partials-head}}
4
4
  {{/head}}
5
5
  {{$pageTitle}}
6
- {{#errorlist.length}}{{#t}}errorlist.prefix{{/t}}{{/errorlist.length}}{{$header}}{{/header}} – GOV.UK
6
+ {{#errorlist.length}}{{#t}}errorlist.prefix{{/t}}{{/errorlist.length}}{{#title}}{{title}}{{/title}}{{^title}}{{$header}}{{/header}}{{/title}}{{#serviceName}} – {{serviceName}}{{/serviceName}} – GOV.UK
7
7
  {{/pageTitle}}
8
8
  {{$bodyStart}}
9
9
  <a href="#{{#skipToMain}}{{skipToMain}}{{/skipToMain}}{{^skipToMain}}main-content{{/skipToMain}}" class="govuk-skip-link" id="skip-to-main">Skip to main content</a>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hof",
3
3
  "description": "A bootstrap for HOF projects",
4
- "version": "22.4.0-fix-textarea-error-message-beta",
4
+ "version": "22.4.0-title-update-beta.2",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "author": "HomeOffice",
@@ -0,0 +1,239 @@
1
+ {
2
+ "exit": {
3
+ "header": "You have left this form",
4
+ "title": "You have left this form"
5
+ },
6
+ "fields": {
7
+ "landing-page-radio": {
8
+ "legend": "Which form would you like to explore?",
9
+ "hint": "Choose one of the options below and press continue.",
10
+ "options": {
11
+ "basic-form": {
12
+ "label": "Basic form"
13
+ },
14
+ "complex-form": {
15
+ "label": "Complex form"
16
+ },
17
+ "build-your-own-form": {
18
+ "label": "Build your own form"
19
+ }
20
+ }
21
+ },
22
+ "name": {
23
+ "label": "Full name"
24
+ },
25
+ "dateOfBirth": {
26
+ "legend": "What is your date of birth?",
27
+ "hint": "For example, 31 10 1990"
28
+ },
29
+ "building": {
30
+ "label": "Building and street"
31
+ },
32
+ "street": {
33
+ "label": "Address line 2"
34
+ },
35
+ "townOrCity": {
36
+ "label": "Town or city"
37
+ },
38
+ "postcode": {
39
+ "label": "Postcode"
40
+ },
41
+ "incomeTypes": {
42
+ "label": "Sources of income",
43
+ "legend": "Select the options where you receive income from",
44
+ "hint": "Select all options that apply to you.",
45
+ "options": {
46
+ "salary": {
47
+ "label": "Salary"
48
+ },
49
+ "universal_credit": {
50
+ "label": "Universal Credit"
51
+ },
52
+ "child_benefit": {
53
+ "label": "Child Benefit"
54
+ },
55
+ "housing_benefit": {
56
+ "label": "Housing Benefit"
57
+ },
58
+ "other": {
59
+ "label": "Other"
60
+ }
61
+ }
62
+ },
63
+ "countryOfHearing": {
64
+ "legend": "What country was the appeal lodged?",
65
+ "options": {
66
+ "englandAndWales": {
67
+ "label": "England and Wales"
68
+ },
69
+ "scotland": {
70
+ "label": "Scotland"
71
+ },
72
+ "northernIreland": {
73
+ "label": "Northern Ireland"
74
+ }
75
+ }
76
+ },
77
+ "email": {
78
+ "label": "Email address"
79
+ },
80
+ "phone": {
81
+ "label": "Phone number",
82
+ "hint": "International phone numbers require the international dialling code, for example +33235066182"
83
+ },
84
+ "int-phone-number": {
85
+ "legend": "International phone number"
86
+ },
87
+ "complaintDetails": {
88
+ "label": "Complaint details",
89
+ "hint": "Briefly summarise your complaint. Include anything that can help our investigation."
90
+ },
91
+ "whatHappened": {
92
+ "label": "What happened",
93
+ "hint": "Briefly summarise what happened."
94
+ },
95
+ "countrySelect": {
96
+ "label": "Which country are you based in?",
97
+ "hint": "Start to type the country name and options will appear"
98
+ },
99
+ "appealStages": {
100
+ "label": "Appeal stage",
101
+ "hint": "Choose an appeal stage from the drop down menu",
102
+ "options": {
103
+ "null": "Select..."
104
+ }
105
+ }
106
+ },
107
+ "journey": {
108
+ "header": "HOF Bootstrap Sandbox Form",
109
+ "confirmation": {
110
+ "details": "Your reference number <br><strong>HDJ2123F</strong>"
111
+ }
112
+ },
113
+ "pages": {
114
+ "landing-page": {
115
+ "header": "Landing page"
116
+ },
117
+ "build-your-own-form": {
118
+ "title": "Build your own form",
119
+ "subheader": "Access the build your own form guidance link"
120
+ },
121
+ "address": {
122
+ "header": "What is your address in the UK?",
123
+ "intro": "If you have no fixed address, enter an address where we can contact you."
124
+ },
125
+ "name": {
126
+ "header": "What is your full name?"
127
+ },
128
+ "email": {
129
+ "header": "Enter your email address"
130
+ },
131
+ "phone-number": {
132
+ "header": "Enter your phone number"
133
+ },
134
+ "confirm": {
135
+ "header": "Check your answers before submitting your application.",
136
+ "sections": {
137
+ "applicantsDetails": {
138
+ "header": "Applicant's details"
139
+ },
140
+ "address": {
141
+ "header": "Address"
142
+ },
143
+ "income": {
144
+ "header": "Income"
145
+ },
146
+ "appealDetails": {
147
+ "header": "Appeal details"
148
+ },
149
+ "countrySelect": {
150
+ "header": "Country of residence"
151
+ },
152
+ "contactDetails": {
153
+ "header": "Contact details"
154
+ },
155
+ "complaintDetails": {
156
+ "header": "Complaint details"
157
+ },
158
+ "whatHappened": {
159
+ "header": "What happened"
160
+ }
161
+ }
162
+ },
163
+ "confirmation": {
164
+ "title": "Application sent",
165
+ "alert": "Application sent",
166
+ "subheader": "What happens next",
167
+ "content": "We’ll contact you with the decision of your application or if we need more information from you."
168
+ },
169
+ "exit": {
170
+ "message": "We have cleared your information to keep it secure. Your information has not been saved."
171
+ },
172
+ "session-timeout-warning": {
173
+ "dialog-title": "{{^showSaveAndExit}}Your application will close soon{{/showSaveAndExit}}{{#showSaveAndExit}}You will be signed out soon{{/showSaveAndExit}}",
174
+ "dialog-text": "{{^showSaveAndExit}}If that happens, your progress will not be saved.{{/showSaveAndExit}}{{#showSaveAndExit}}Any answers you have saved will not be affected, but your progress on this page will not be saved.{{/showSaveAndExit}}",
175
+ "timeout-continue-button": "{{^showSaveAndExit}}Stay on this page{{/showSaveAndExit}}{{#showSaveAndExit}}Stay signed in{{/showSaveAndExit}}",
176
+ "dialog-exit-link": "{{^showSaveAndExit}}Exit this form{{/showSaveAndExit}}{{#showSaveAndExit}}Sign out{{/showSaveAndExit}}"
177
+ },
178
+ "save-and-exit": {
179
+ "header": "You have been signed out",
180
+ "paragraph-1": "Your form doesn't appear to have been worked on for 30 minutes so we closed it for security.",
181
+ "paragraph-2": "Any answers you saved have not been affected.",
182
+ "paragraph-3": "You can sign back in to your application at any time by returning to the <a href='/' class='govuk-link'>start page</a>."
183
+ }
184
+ },
185
+ "validation": {
186
+ "landing-page-radio": {
187
+ "required": "Select an option below and press continue"
188
+ },
189
+ "name": {
190
+ "default": "Enter your full name"
191
+ },
192
+ "dateOfBirth": {
193
+ "default": "Enter your date of birth in the correct format; for example, 31 10 1990",
194
+ "after": "Enter a date after 1 1 1900",
195
+ "before": "Enter a date that is in the past"
196
+ },
197
+ "building": {
198
+ "default": "Enter details of your building and street"
199
+ },
200
+ "townOrCity": {
201
+ "default": "Enter a town or city",
202
+ "regex": "Enter a town or city without including digits"
203
+ },
204
+ "postcode": {
205
+ "default": "Enter your postcode"
206
+ },
207
+ "incomeTypes": {
208
+ "default": "Select all options that apply to you."
209
+ },
210
+ "countryOfHearing": {
211
+ "default": "Select where the appeal hearing is to be held"
212
+ },
213
+ "countrySelect": {
214
+ "default": "Enter a valid country of residence",
215
+ "required": "Enter your country of residence"
216
+ },
217
+ "email": {
218
+ "default": "Enter your email address in the correct format"
219
+ },
220
+ "phone": {
221
+ "default": "Enter your phone number"
222
+ },
223
+ "int-phone-number": {
224
+ "required": "Enter an international phone number",
225
+ "internationalPhoneNumber": "Enter a valid international phone number"
226
+ },
227
+ "complaintDetails": {
228
+ "default": "Enter details about why you are making a complaint",
229
+ "maxlength": "Keep to the {{maxlength}} character limit"
230
+ },
231
+ "whatHappened": {
232
+ "default": "Enter details about what happened",
233
+ "maxword": "Keep to the {{maxword}} word limit"
234
+ },
235
+ "appealStages": {
236
+ "required": "Select an appeal stage from the list"
237
+ }
238
+ }
239
+ }