@defra/forms-engine-plugin 0.1.10 → 0.1.11
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/.public/stylesheets/application.min.css +1 -1
- package/.public/stylesheets/application.min.css.map +1 -1
- package/.server/client/stylesheets/application.scss +10 -0
- package/.server/config/index.js +3 -14
- package/.server/config/index.js.map +1 -1
- package/.server/server/devserver/dxt-devtool-baselayout.html +71 -0
- package/.server/server/forms/register-as-a-unicorn-breeder.json +393 -0
- package/.server/server/forms/register-as-a-unicorn-breeder.yaml +251 -0
- package/.server/server/index.js +11 -16
- package/.server/server/index.js.map +1 -1
- package/.server/server/plugins/engine/configureEnginePlugin.js +16 -2
- package/.server/server/plugins/engine/configureEnginePlugin.js.map +1 -1
- package/.server/server/plugins/engine/plugin.js +27 -16
- package/.server/server/plugins/engine/plugin.js.map +1 -1
- package/.server/server/plugins/engine/services/formsService.js +15 -29
- package/.server/server/plugins/engine/services/formsService.js.map +1 -1
- package/.server/server/plugins/engine/services/localFormsService.js +52 -0
- package/.server/server/plugins/engine/services/localFormsService.js.map +1 -0
- package/.server/server/plugins/engine/views/confirmation.html +1 -1
- package/.server/server/plugins/engine/views/file-upload.html +1 -1
- package/.server/server/plugins/engine/views/index.html +1 -1
- package/.server/server/plugins/engine/views/item-delete.html +1 -1
- package/.server/server/plugins/engine/views/repeat-list-summary.html +1 -1
- package/.server/server/plugins/engine/views/summary.html +1 -1
- package/.server/server/plugins/errorPages.js +4 -26
- package/.server/server/plugins/errorPages.js.map +1 -1
- package/.server/server/plugins/nunjucks/context.js +37 -28
- package/.server/server/plugins/nunjucks/context.js.map +1 -1
- package/.server/server/plugins/nunjucks/context.test.js +23 -28
- package/.server/server/plugins/nunjucks/context.test.js.map +1 -1
- package/.server/server/plugins/nunjucks/types.js +3 -4
- package/.server/server/plugins/nunjucks/types.js.map +1 -1
- package/.server/server/routes/index.js +0 -1
- package/.server/server/routes/index.js.map +1 -1
- package/.server/typings/hapi/index.d.js.map +1 -1
- package/package.json +2 -1
- package/src/client/stylesheets/application.scss +10 -0
- package/src/config/index.ts +4 -17
- package/src/server/devserver/dxt-devtool-baselayout.html +71 -0
- package/src/server/forms/register-as-a-unicorn-breeder.json +393 -0
- package/src/server/forms/register-as-a-unicorn-breeder.yaml +251 -0
- package/src/server/index.test.ts +4 -37
- package/src/server/index.ts +13 -16
- package/src/server/plugins/engine/configureEnginePlugin.ts +19 -1
- package/src/server/plugins/engine/plugin.ts +43 -17
- package/src/server/plugins/engine/services/formsService.js +17 -35
- package/src/server/plugins/engine/services/localFormsService.js +49 -0
- package/src/server/plugins/engine/views/confirmation.html +1 -1
- package/src/server/plugins/engine/views/file-upload.html +1 -1
- package/src/server/plugins/engine/views/index.html +1 -1
- package/src/server/plugins/engine/views/item-delete.html +1 -1
- package/src/server/plugins/engine/views/repeat-list-summary.html +1 -1
- package/src/server/plugins/engine/views/summary.html +1 -1
- package/src/server/plugins/errorPages.ts +4 -26
- package/src/server/plugins/nunjucks/context.js +41 -31
- package/src/server/plugins/nunjucks/context.test.js +24 -27
- package/src/server/plugins/nunjucks/types.js +3 -4
- package/src/server/routes/index.ts +0 -1
- package/src/typings/hapi/index.d.ts +3 -9
- package/.server/common/cookies.js +0 -55
- package/.server/common/cookies.js.map +0 -1
- package/.server/common/cookies.test.js +0 -15
- package/.server/common/cookies.test.js.map +0 -1
- package/.server/common/types.js +0 -6
- package/.server/common/types.js.map +0 -1
- package/.server/server/forms/README.md +0 -10
- package/.server/server/forms/report-a-terrorist.json +0 -270
- package/.server/server/forms/runner-components-test.json +0 -365
- package/.server/server/forms/test.json +0 -581
- package/.server/server/forms/test.yaml +0 -363
- package/.server/server/plugins/blankie.js +0 -29
- package/.server/server/plugins/blankie.js.map +0 -1
- package/.server/server/plugins/engine/services/formsService.test.js +0 -71
- package/.server/server/plugins/engine/services/formsService.test.js.map +0 -1
- package/.server/server/plugins/engine/views/layout.html +0 -199
- package/.server/server/plugins/router.js +0 -169
- package/.server/server/plugins/router.js.map +0 -1
- package/.server/server/routes/health.js +0 -15
- package/.server/server/routes/health.js.map +0 -1
- package/.server/server/routes/health.test.js +0 -32
- package/.server/server/routes/health.test.js.map +0 -1
- package/.server/server/utils/file-form-service.test.js +0 -52
- package/.server/server/utils/file-form-service.test.js.map +0 -1
- package/.server/server/views/404.html +0 -16
- package/.server/server/views/500.html +0 -19
- package/.server/server/views/help/accessibility-statement.html +0 -58
- package/.server/server/views/help/cookie-preferences.html +0 -57
- package/.server/server/views/help/cookies.html +0 -71
- package/.server/server/views/help/get-support.html +0 -37
- package/.server/server/views/help/privacy-notice.html +0 -68
- package/.server/server/views/help/terms-and-conditions.html +0 -83
- package/src/common/cookies.js +0 -58
- package/src/common/cookies.test.js +0 -23
- package/src/common/types.js +0 -5
- package/src/server/forms/README.md +0 -10
- package/src/server/forms/report-a-terrorist.json +0 -270
- package/src/server/forms/runner-components-test.json +0 -365
- package/src/server/forms/test.json +0 -581
- package/src/server/forms/test.yaml +0 -363
- package/src/server/plugins/blankie.test.ts +0 -73
- package/src/server/plugins/blankie.ts +0 -48
- package/src/server/plugins/engine/services/formsService.test.js +0 -90
- package/src/server/plugins/engine/views/layout.html +0 -199
- package/src/server/plugins/router.ts +0 -201
- package/src/server/routes/health.js +0 -13
- package/src/server/routes/health.test.js +0 -35
- package/src/server/routes/index.test.ts +0 -125
- package/src/server/utils/file-form-service.test.js +0 -79
- package/src/server/views/404.html +0 -16
- package/src/server/views/500.html +0 -19
- package/src/server/views/help/accessibility-statement.html +0 -58
- package/src/server/views/help/cookie-preferences.html +0 -57
- package/src/server/views/help/cookies.html +0 -71
- package/src/server/views/help/get-support.html +0 -37
- package/src/server/views/help/privacy-notice.html +0 -68
- package/src/server/views/help/terms-and-conditions.html +0 -83
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
startPage: "/start"
|
|
3
|
-
pages:
|
|
4
|
-
- title: Start
|
|
5
|
-
path: "/start"
|
|
6
|
-
components: []
|
|
7
|
-
next:
|
|
8
|
-
- path: "/uk-passport"
|
|
9
|
-
controller: StartPageController
|
|
10
|
-
- path: "/uk-passport"
|
|
11
|
-
components:
|
|
12
|
-
- type: YesNoField
|
|
13
|
-
name: ukPassport
|
|
14
|
-
title: Do you have a UK passport?
|
|
15
|
-
options:
|
|
16
|
-
required: true
|
|
17
|
-
schema: {}
|
|
18
|
-
section: checkBeforeYouStart
|
|
19
|
-
next:
|
|
20
|
-
- path: "/how-many-people"
|
|
21
|
-
- path: "/no-uk-passport"
|
|
22
|
-
condition: doesntHaveUKPassport
|
|
23
|
-
title: Do you have a UK passport?
|
|
24
|
-
- path: "/no-uk-passport"
|
|
25
|
-
title: You're not eligible for this service
|
|
26
|
-
components:
|
|
27
|
-
- type: Html
|
|
28
|
-
name: html
|
|
29
|
-
title: Html
|
|
30
|
-
content: >-
|
|
31
|
-
<p class="govuk-body">
|
|
32
|
-
If you still think you're eligible please contact the Foreign and Commonwealth Office.
|
|
33
|
-
</p>
|
|
34
|
-
options: {}
|
|
35
|
-
schema: {}
|
|
36
|
-
next: []
|
|
37
|
-
- path: "/how-many-people"
|
|
38
|
-
section: applicantDetails
|
|
39
|
-
components:
|
|
40
|
-
- options:
|
|
41
|
-
classes: govuk-input--width-10
|
|
42
|
-
required: true
|
|
43
|
-
type: SelectField
|
|
44
|
-
name: numberOfApplicants
|
|
45
|
-
title: How many applicants are there?
|
|
46
|
-
list: numberOfApplicants
|
|
47
|
-
next:
|
|
48
|
-
- path: "/applicant-one"
|
|
49
|
-
title: How many applicants are there?
|
|
50
|
-
- path: "/applicant-one"
|
|
51
|
-
title: Applicant 1
|
|
52
|
-
section: applicantOneDetails
|
|
53
|
-
components:
|
|
54
|
-
- type: Html
|
|
55
|
-
name: html
|
|
56
|
-
title: Html
|
|
57
|
-
content: <p class="govuk-body">Provide the details as they appear on your passport.</p>
|
|
58
|
-
options: {}
|
|
59
|
-
schema: {}
|
|
60
|
-
- type: TextField
|
|
61
|
-
name: firstName
|
|
62
|
-
title: First name
|
|
63
|
-
options:
|
|
64
|
-
required: true
|
|
65
|
-
schema: {}
|
|
66
|
-
- options:
|
|
67
|
-
required: false
|
|
68
|
-
optionalText: false
|
|
69
|
-
type: TextField
|
|
70
|
-
name: middleName
|
|
71
|
-
title: Middle name
|
|
72
|
-
hint: If you have a middle name on your passport you must include it here
|
|
73
|
-
schema: {}
|
|
74
|
-
- type: TextField
|
|
75
|
-
name: lastName
|
|
76
|
-
title: Surname
|
|
77
|
-
options:
|
|
78
|
-
required: true
|
|
79
|
-
schema: {}
|
|
80
|
-
next:
|
|
81
|
-
- path: "/applicant-one-address"
|
|
82
|
-
- path: "/applicant-one-address"
|
|
83
|
-
section: applicantOneDetails
|
|
84
|
-
components:
|
|
85
|
-
- type: UkAddressField
|
|
86
|
-
name: address
|
|
87
|
-
title: Address
|
|
88
|
-
options:
|
|
89
|
-
required: true
|
|
90
|
-
schema: {}
|
|
91
|
-
next:
|
|
92
|
-
- path: "/applicant-two"
|
|
93
|
-
condition: moreThanOneApplicant
|
|
94
|
-
- path: "/contact-details"
|
|
95
|
-
title: Address
|
|
96
|
-
- path: "/applicant-two"
|
|
97
|
-
title: Applicant 2
|
|
98
|
-
section: applicantTwoDetails
|
|
99
|
-
components:
|
|
100
|
-
- type: Html
|
|
101
|
-
name: html
|
|
102
|
-
title: Html
|
|
103
|
-
content: <p class="govuk-body">Provide the details as they appear on your passport.</p>
|
|
104
|
-
options: {}
|
|
105
|
-
schema: {}
|
|
106
|
-
- type: TextField
|
|
107
|
-
name: firstName
|
|
108
|
-
title: First name
|
|
109
|
-
options:
|
|
110
|
-
required: true
|
|
111
|
-
schema: {}
|
|
112
|
-
- options:
|
|
113
|
-
required: false
|
|
114
|
-
optionalText: false
|
|
115
|
-
type: TextField
|
|
116
|
-
name: middleName
|
|
117
|
-
title: Middle name
|
|
118
|
-
hint: If you have a middle name on your passport you must include it here
|
|
119
|
-
schema: {}
|
|
120
|
-
- type: TextField
|
|
121
|
-
name: lastName
|
|
122
|
-
title: Surname
|
|
123
|
-
options:
|
|
124
|
-
required: true
|
|
125
|
-
schema: {}
|
|
126
|
-
next:
|
|
127
|
-
- path: "/applicant-two-address"
|
|
128
|
-
- path: "/applicant-two-address"
|
|
129
|
-
section: applicantTwoDetails
|
|
130
|
-
components:
|
|
131
|
-
- type: UkAddressField
|
|
132
|
-
name: address
|
|
133
|
-
title: Address
|
|
134
|
-
options:
|
|
135
|
-
required: true
|
|
136
|
-
schema: {}
|
|
137
|
-
next:
|
|
138
|
-
- path: "/applicant-three"
|
|
139
|
-
condition: moreThanTwoApplicants
|
|
140
|
-
- path: "/contact-details"
|
|
141
|
-
title: Address
|
|
142
|
-
- path: "/applicant-three"
|
|
143
|
-
title: Applicant 3
|
|
144
|
-
section: applicantThreeDetails
|
|
145
|
-
components:
|
|
146
|
-
- type: Html
|
|
147
|
-
name: html
|
|
148
|
-
title: Html
|
|
149
|
-
content: <p class="govuk-body">Provide the details as they appear on your passport.</p>
|
|
150
|
-
options: {}
|
|
151
|
-
schema: {}
|
|
152
|
-
- type: TextField
|
|
153
|
-
name: firstName
|
|
154
|
-
title: First name
|
|
155
|
-
options:
|
|
156
|
-
required: true
|
|
157
|
-
schema: {}
|
|
158
|
-
- options:
|
|
159
|
-
required: false
|
|
160
|
-
optionalText: false
|
|
161
|
-
type: TextField
|
|
162
|
-
name: middleName
|
|
163
|
-
title: Middle name
|
|
164
|
-
hint: If you have a middle name on your passport you must include it here
|
|
165
|
-
schema: {}
|
|
166
|
-
- type: TextField
|
|
167
|
-
name: lastName
|
|
168
|
-
title: Surname
|
|
169
|
-
options:
|
|
170
|
-
required: true
|
|
171
|
-
schema: {}
|
|
172
|
-
next:
|
|
173
|
-
- path: "/applicant-three-address"
|
|
174
|
-
- path: "/applicant-three-address"
|
|
175
|
-
section: applicantThreeDetails
|
|
176
|
-
components:
|
|
177
|
-
- type: UkAddressField
|
|
178
|
-
name: address
|
|
179
|
-
title: Address
|
|
180
|
-
options:
|
|
181
|
-
required: true
|
|
182
|
-
schema: {}
|
|
183
|
-
next:
|
|
184
|
-
- path: "/applicant-four"
|
|
185
|
-
condition: moreThanThreeApplicants
|
|
186
|
-
- path: "/contact-details"
|
|
187
|
-
title: Address
|
|
188
|
-
- path: "/applicant-four"
|
|
189
|
-
title: Applicant 4
|
|
190
|
-
section: applicantFourDetails
|
|
191
|
-
components:
|
|
192
|
-
- type: Html
|
|
193
|
-
name: html
|
|
194
|
-
title: Html
|
|
195
|
-
content: <p class="govuk-body">Provide the details as they appear on your passport.</p>
|
|
196
|
-
options: {}
|
|
197
|
-
schema: {}
|
|
198
|
-
- type: TextField
|
|
199
|
-
name: firstName
|
|
200
|
-
title: First name
|
|
201
|
-
options:
|
|
202
|
-
required: true
|
|
203
|
-
schema: {}
|
|
204
|
-
- options:
|
|
205
|
-
required: false
|
|
206
|
-
optionalText: false
|
|
207
|
-
type: TextField
|
|
208
|
-
name: middleName
|
|
209
|
-
title: Middle name
|
|
210
|
-
hint: If you have a middle name on your passport you must include it here
|
|
211
|
-
schema: {}
|
|
212
|
-
- type: TextField
|
|
213
|
-
name: lastName
|
|
214
|
-
title: Surname
|
|
215
|
-
options:
|
|
216
|
-
required: true
|
|
217
|
-
schema: {}
|
|
218
|
-
next:
|
|
219
|
-
- path: "/applicant-four-address"
|
|
220
|
-
- path: "/applicant-four-address"
|
|
221
|
-
section: applicantFourDetails
|
|
222
|
-
components:
|
|
223
|
-
- type: UkAddressField
|
|
224
|
-
name: address
|
|
225
|
-
title: Address
|
|
226
|
-
options:
|
|
227
|
-
required: true
|
|
228
|
-
schema: {}
|
|
229
|
-
next:
|
|
230
|
-
- path: "/contact-details"
|
|
231
|
-
title: Address
|
|
232
|
-
- path: "/contact-details"
|
|
233
|
-
section: applicantDetails
|
|
234
|
-
components:
|
|
235
|
-
- type: TelephoneNumberField
|
|
236
|
-
name: phoneNumber
|
|
237
|
-
title: Phone number
|
|
238
|
-
hint: If you haven't got a UK phone number, include country code
|
|
239
|
-
options:
|
|
240
|
-
required: true
|
|
241
|
-
schema: {}
|
|
242
|
-
- type: EmailAddressField
|
|
243
|
-
name: emailAddress
|
|
244
|
-
title: Your email address
|
|
245
|
-
options:
|
|
246
|
-
required: true
|
|
247
|
-
schema: {}
|
|
248
|
-
next:
|
|
249
|
-
- path: "/summary"
|
|
250
|
-
title: Applicant contact details
|
|
251
|
-
- path: "/summary"
|
|
252
|
-
controller: SummaryPageController
|
|
253
|
-
title: Summary
|
|
254
|
-
components: []
|
|
255
|
-
next: []
|
|
256
|
-
lists:
|
|
257
|
-
- name: numberOfApplicants
|
|
258
|
-
title: Number of people
|
|
259
|
-
type: number
|
|
260
|
-
items:
|
|
261
|
-
- text: '1'
|
|
262
|
-
value: 1
|
|
263
|
-
description: ''
|
|
264
|
-
condition: ''
|
|
265
|
-
- text: '2'
|
|
266
|
-
value: 2
|
|
267
|
-
description: ''
|
|
268
|
-
condition: ''
|
|
269
|
-
- text: '3'
|
|
270
|
-
value: 3
|
|
271
|
-
description: ''
|
|
272
|
-
condition: ''
|
|
273
|
-
- text: '4'
|
|
274
|
-
value: 4
|
|
275
|
-
description: ''
|
|
276
|
-
condition: ''
|
|
277
|
-
sections:
|
|
278
|
-
- name: checkBeforeYouStart
|
|
279
|
-
title: Check before you start
|
|
280
|
-
- name: applicantDetails
|
|
281
|
-
title: Applicant details
|
|
282
|
-
- name: applicantOneDetails
|
|
283
|
-
title: Applicant 1
|
|
284
|
-
- name: applicantTwoDetails
|
|
285
|
-
title: Applicant 2
|
|
286
|
-
- name: applicantThreeDetails
|
|
287
|
-
title: Applicant 3
|
|
288
|
-
- name: applicantFourDetails
|
|
289
|
-
title: Applicant 4
|
|
290
|
-
phaseBanner: {}
|
|
291
|
-
declaration: <p class="govuk-body">All the answers you have provided are true to the
|
|
292
|
-
best of your knowledge.</p>
|
|
293
|
-
conditions:
|
|
294
|
-
- name: hasUKPassport
|
|
295
|
-
displayName: hasUKPassport
|
|
296
|
-
value:
|
|
297
|
-
name: hasUKPassport
|
|
298
|
-
conditions:
|
|
299
|
-
- field:
|
|
300
|
-
name: checkBeforeYouStart.ukPassport
|
|
301
|
-
type: YesNoField
|
|
302
|
-
display: Do you have a UK passport?
|
|
303
|
-
operator: is
|
|
304
|
-
value:
|
|
305
|
-
type: Value
|
|
306
|
-
value: 'true'
|
|
307
|
-
display: 'true'
|
|
308
|
-
- name: doesntHaveUKPassport
|
|
309
|
-
displayName: doesntHaveUKPassport
|
|
310
|
-
value:
|
|
311
|
-
name: doesntHaveUKPassport
|
|
312
|
-
conditions:
|
|
313
|
-
- field:
|
|
314
|
-
name: checkBeforeYouStart.ukPassport
|
|
315
|
-
type: YesNoField
|
|
316
|
-
display: Do you have a UK passport?
|
|
317
|
-
operator: is
|
|
318
|
-
value:
|
|
319
|
-
type: Value
|
|
320
|
-
value: 'false'
|
|
321
|
-
display: 'false'
|
|
322
|
-
- name: moreThanOneApplicant
|
|
323
|
-
displayName: moreThanOneApplicant
|
|
324
|
-
value:
|
|
325
|
-
name: moreThanOneApplicant
|
|
326
|
-
conditions:
|
|
327
|
-
- field:
|
|
328
|
-
name: applicantDetails.numberOfApplicants
|
|
329
|
-
type: SelectField
|
|
330
|
-
display: How many applicants are there?
|
|
331
|
-
operator: is more than
|
|
332
|
-
value:
|
|
333
|
-
type: Value
|
|
334
|
-
value: '1'
|
|
335
|
-
display: '1'
|
|
336
|
-
- name: moreThanTwoApplicants
|
|
337
|
-
displayName: moreThanTwoApplicants
|
|
338
|
-
value:
|
|
339
|
-
name: moreThanTwoApplicants
|
|
340
|
-
conditions:
|
|
341
|
-
- field:
|
|
342
|
-
name: applicantDetails.numberOfApplicants
|
|
343
|
-
type: SelectField
|
|
344
|
-
display: How many applicants are there?
|
|
345
|
-
operator: is more than
|
|
346
|
-
value:
|
|
347
|
-
type: Value
|
|
348
|
-
value: '2'
|
|
349
|
-
display: '2'
|
|
350
|
-
- name: moreThanThreeApplicants
|
|
351
|
-
displayName: moreThanThreeApplicants
|
|
352
|
-
value:
|
|
353
|
-
name: moreThanThreeApplicants
|
|
354
|
-
conditions:
|
|
355
|
-
- field:
|
|
356
|
-
name: applicantDetails.numberOfApplicants
|
|
357
|
-
type: SelectField
|
|
358
|
-
display: How many applicants are there?
|
|
359
|
-
operator: is more than
|
|
360
|
-
value:
|
|
361
|
-
type: Value
|
|
362
|
-
value: '3'
|
|
363
|
-
display: '3'
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import Blankie from 'blankie';
|
|
2
|
-
import { config } from "../../config/index.js";
|
|
3
|
-
const googleAnalyticsOptions = {
|
|
4
|
-
scriptSrc: ['https://*.googletagmanager.com'],
|
|
5
|
-
imgSrc: ['https://*.google-analytics.com', 'https://*.googletagmanager.com'],
|
|
6
|
-
connectSrc: ['https://*.google-analytics.com', 'https://*.analytics.google.com', 'https://*.googletagmanager.com']
|
|
7
|
-
};
|
|
8
|
-
export const configureBlankiePlugin = () => {
|
|
9
|
-
const gaTrackingId = config.get('googleAnalyticsTrackingId');
|
|
10
|
-
const uploaderUrl = config.get('uploaderUrl');
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
Note that unsafe-inline is a fallback for old browsers that don't support nonces. It will be ignored by modern browsers as the nonce is provided.
|
|
14
|
-
*/
|
|
15
|
-
return {
|
|
16
|
-
plugin: Blankie,
|
|
17
|
-
options: {
|
|
18
|
-
defaultSrc: ['self'],
|
|
19
|
-
fontSrc: ['self', 'data:'],
|
|
20
|
-
connectSrc: [['self'], gaTrackingId ? googleAnalyticsOptions.connectSrc : [], uploaderUrl ? [uploaderUrl] : []].flat(),
|
|
21
|
-
scriptSrc: [['self', 'strict-dynamic', 'unsafe-inline'], gaTrackingId ? googleAnalyticsOptions.scriptSrc : []].flat(),
|
|
22
|
-
styleSrc: ['self', 'unsafe-inline'],
|
|
23
|
-
imgSrc: [['self'], gaTrackingId ? googleAnalyticsOptions.imgSrc : []].flat(),
|
|
24
|
-
frameSrc: ['self', 'data:'],
|
|
25
|
-
generateNonces: true
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=blankie.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blankie.js","names":["Blankie","config","googleAnalyticsOptions","scriptSrc","imgSrc","connectSrc","configureBlankiePlugin","gaTrackingId","get","uploaderUrl","plugin","options","defaultSrc","fontSrc","flat","styleSrc","frameSrc","generateNonces"],"sources":["../../../src/server/plugins/blankie.ts"],"sourcesContent":["import { type ServerRegisterPluginObject } from '@hapi/hapi'\nimport Blankie from 'blankie'\n\nimport { config } from '~/src/config/index.js'\n\nconst googleAnalyticsOptions = {\n scriptSrc: ['https://*.googletagmanager.com'],\n imgSrc: ['https://*.google-analytics.com', 'https://*.googletagmanager.com'],\n connectSrc: [\n 'https://*.google-analytics.com',\n 'https://*.analytics.google.com',\n 'https://*.googletagmanager.com'\n ]\n}\n\nexport const configureBlankiePlugin = (): ServerRegisterPluginObject<\n Record<string, boolean | string | string[]>\n> => {\n const gaTrackingId = config.get('googleAnalyticsTrackingId')\n const uploaderUrl = config.get('uploaderUrl')\n\n /*\n Note that unsafe-inline is a fallback for old browsers that don't support nonces. It will be ignored by modern browsers as the nonce is provided.\n */\n return {\n plugin: Blankie,\n options: {\n defaultSrc: ['self'],\n fontSrc: ['self', 'data:'],\n connectSrc: [\n ['self'],\n gaTrackingId ? googleAnalyticsOptions.connectSrc : [],\n uploaderUrl ? [uploaderUrl] : []\n ].flat(),\n scriptSrc: [\n ['self', 'strict-dynamic', 'unsafe-inline'],\n gaTrackingId ? googleAnalyticsOptions.scriptSrc : []\n ].flat(),\n styleSrc: ['self', 'unsafe-inline'],\n imgSrc: [\n ['self'],\n gaTrackingId ? googleAnalyticsOptions.imgSrc : []\n ].flat(),\n frameSrc: ['self', 'data:'],\n generateNonces: true\n }\n }\n}\n"],"mappings":"AACA,OAAOA,OAAO,MAAM,SAAS;AAE7B,SAASC,MAAM;AAEf,MAAMC,sBAAsB,GAAG;EAC7BC,SAAS,EAAE,CAAC,gCAAgC,CAAC;EAC7CC,MAAM,EAAE,CAAC,gCAAgC,EAAE,gCAAgC,CAAC;EAC5EC,UAAU,EAAE,CACV,gCAAgC,EAChC,gCAAgC,EAChC,gCAAgC;AAEpC,CAAC;AAED,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAEjC;EACH,MAAMC,YAAY,GAAGN,MAAM,CAACO,GAAG,CAAC,2BAA2B,CAAC;EAC5D,MAAMC,WAAW,GAAGR,MAAM,CAACO,GAAG,CAAC,aAAa,CAAC;;EAE7C;AACF;AACA;EACE,OAAO;IACLE,MAAM,EAAEV,OAAO;IACfW,OAAO,EAAE;MACPC,UAAU,EAAE,CAAC,MAAM,CAAC;MACpBC,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;MAC1BR,UAAU,EAAE,CACV,CAAC,MAAM,CAAC,EACRE,YAAY,GAAGL,sBAAsB,CAACG,UAAU,GAAG,EAAE,EACrDI,WAAW,GAAG,CAACA,WAAW,CAAC,GAAG,EAAE,CACjC,CAACK,IAAI,CAAC,CAAC;MACRX,SAAS,EAAE,CACT,CAAC,MAAM,EAAE,gBAAgB,EAAE,eAAe,CAAC,EAC3CI,YAAY,GAAGL,sBAAsB,CAACC,SAAS,GAAG,EAAE,CACrD,CAACW,IAAI,CAAC,CAAC;MACRC,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC;MACnCX,MAAM,EAAE,CACN,CAAC,MAAM,CAAC,EACRG,YAAY,GAAGL,sBAAsB,CAACE,MAAM,GAAG,EAAE,CAClD,CAACU,IAAI,CAAC,CAAC;MACRE,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;MAC3BC,cAAc,EAAE;IAClB;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { StatusCodes } from 'http-status-codes';
|
|
2
|
-
import { getFormDefinition, getFormMetadata } from "./formsService.js";
|
|
3
|
-
import { FormStatus } from "../../../routes/types.js";
|
|
4
|
-
import { getJson } from "../../../services/httpService.js";
|
|
5
|
-
import * as fixtures from "../../../../../test/fixtures/index.js";
|
|
6
|
-
const {
|
|
7
|
-
MANAGER_URL
|
|
8
|
-
} = process.env;
|
|
9
|
-
jest.mock("../../../services/httpService");
|
|
10
|
-
describe('Forms service', () => {
|
|
11
|
-
const {
|
|
12
|
-
definition,
|
|
13
|
-
metadata
|
|
14
|
-
} = fixtures.form;
|
|
15
|
-
describe('getFormMetadata', () => {
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
jest.mocked(getJson).mockResolvedValue({
|
|
18
|
-
res: (/** @type {IncomingMessage} */{
|
|
19
|
-
statusCode: StatusCodes.OK
|
|
20
|
-
}),
|
|
21
|
-
payload: metadata
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
it('requests JSON via form slug', async () => {
|
|
25
|
-
await getFormMetadata(metadata.slug);
|
|
26
|
-
expect(getJson).toHaveBeenCalledWith(`${MANAGER_URL}/forms/slug/${metadata.slug}`);
|
|
27
|
-
});
|
|
28
|
-
it('coerces timestamps from string to Date', async () => {
|
|
29
|
-
const payload = {
|
|
30
|
-
...structuredClone(metadata),
|
|
31
|
-
// JSON payload uses string dates in transit
|
|
32
|
-
createdAt: metadata.createdAt.toISOString(),
|
|
33
|
-
updatedAt: metadata.updatedAt.toISOString()
|
|
34
|
-
};
|
|
35
|
-
jest.mocked(getJson).mockResolvedValue({
|
|
36
|
-
res: (/** @type {IncomingMessage} */{
|
|
37
|
-
statusCode: StatusCodes.OK
|
|
38
|
-
}),
|
|
39
|
-
payload
|
|
40
|
-
});
|
|
41
|
-
await expect(getFormMetadata(metadata.slug)).resolves.toEqual({
|
|
42
|
-
...metadata,
|
|
43
|
-
createdAt: expect.any(Date),
|
|
44
|
-
updatedAt: expect.any(Date)
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
describe('getFormDefinition', () => {
|
|
49
|
-
beforeEach(() => {
|
|
50
|
-
jest.mocked(getJson).mockResolvedValue({
|
|
51
|
-
res: (/** @type {IncomingMessage} */{
|
|
52
|
-
statusCode: StatusCodes.OK
|
|
53
|
-
}),
|
|
54
|
-
payload: definition
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
it('requests JSON via form ID (draft)', async () => {
|
|
58
|
-
await getFormDefinition(metadata.id, FormStatus.Draft);
|
|
59
|
-
expect(getJson).toHaveBeenCalledWith(`${MANAGER_URL}/forms/${metadata.id}/definition/draft`);
|
|
60
|
-
});
|
|
61
|
-
it('requests JSON via form ID (live)', async () => {
|
|
62
|
-
await getFormDefinition(metadata.id, FormStatus.Live);
|
|
63
|
-
expect(getJson).toHaveBeenCalledWith(`${MANAGER_URL}/forms/${metadata.id}/definition`);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @import { IncomingMessage } from 'node:http'
|
|
70
|
-
*/
|
|
71
|
-
//# sourceMappingURL=formsService.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formsService.test.js","names":["StatusCodes","getFormDefinition","getFormMetadata","FormStatus","getJson","fixtures","MANAGER_URL","process","env","jest","mock","describe","definition","metadata","form","beforeEach","mocked","mockResolvedValue","res","statusCode","OK","payload","it","slug","expect","toHaveBeenCalledWith","structuredClone","createdAt","toISOString","updatedAt","resolves","toEqual","any","Date","id","Draft","Live"],"sources":["../../../../../src/server/plugins/engine/services/formsService.test.js"],"sourcesContent":["import { StatusCodes } from 'http-status-codes'\n\nimport {\n getFormDefinition,\n getFormMetadata\n} from '~/src/server/plugins/engine/services/formsService.js'\nimport { FormStatus } from '~/src/server/routes/types.js'\nimport { getJson } from '~/src/server/services/httpService.js'\nimport * as fixtures from '~/test/fixtures/index.js'\n\nconst { MANAGER_URL } = process.env\n\njest.mock('~/src/server/services/httpService')\n\ndescribe('Forms service', () => {\n const { definition, metadata } = fixtures.form\n\n describe('getFormMetadata', () => {\n beforeEach(() => {\n jest.mocked(getJson).mockResolvedValue({\n res: /** @type {IncomingMessage} */ ({\n statusCode: StatusCodes.OK\n }),\n payload: metadata\n })\n })\n\n it('requests JSON via form slug', async () => {\n await getFormMetadata(metadata.slug)\n\n expect(getJson).toHaveBeenCalledWith(\n `${MANAGER_URL}/forms/slug/${metadata.slug}`\n )\n })\n\n it('coerces timestamps from string to Date', async () => {\n const payload = {\n ...structuredClone(metadata),\n\n // JSON payload uses string dates in transit\n createdAt: metadata.createdAt.toISOString(),\n updatedAt: metadata.updatedAt.toISOString()\n }\n\n jest.mocked(getJson).mockResolvedValue({\n res: /** @type {IncomingMessage} */ ({\n statusCode: StatusCodes.OK\n }),\n payload\n })\n\n await expect(getFormMetadata(metadata.slug)).resolves.toEqual({\n ...metadata,\n createdAt: expect.any(Date),\n updatedAt: expect.any(Date)\n })\n })\n })\n\n describe('getFormDefinition', () => {\n beforeEach(() => {\n jest.mocked(getJson).mockResolvedValue({\n res: /** @type {IncomingMessage} */ ({\n statusCode: StatusCodes.OK\n }),\n payload: definition\n })\n })\n\n it('requests JSON via form ID (draft)', async () => {\n await getFormDefinition(metadata.id, FormStatus.Draft)\n\n expect(getJson).toHaveBeenCalledWith(\n `${MANAGER_URL}/forms/${metadata.id}/definition/draft`\n )\n })\n\n it('requests JSON via form ID (live)', async () => {\n await getFormDefinition(metadata.id, FormStatus.Live)\n\n expect(getJson).toHaveBeenCalledWith(\n `${MANAGER_URL}/forms/${metadata.id}/definition`\n )\n })\n })\n})\n\n/**\n * @import { IncomingMessage } from 'node:http'\n */\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
{% extends "govuk/template.njk" %}
|
|
2
|
-
|
|
3
|
-
{% from "govuk/components/back-link/macro.njk" import govukBackLink -%}
|
|
4
|
-
{% from "govuk/components/footer/macro.njk" import govukFooter -%}
|
|
5
|
-
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner -%}
|
|
6
|
-
{% from "govuk/components/skip-link/macro.njk" import govukSkipLink -%}
|
|
7
|
-
{% from "govuk/macros/attributes.njk" import govukAttributes -%}
|
|
8
|
-
{% from "components/service-banner/macro.njk" import appServiceBanner -%}
|
|
9
|
-
{% from "components/tag-env/macro.njk" import appTagEnv -%}
|
|
10
|
-
{% from "govuk/components/cookie-banner/macro.njk" import govukCookieBanner -%}
|
|
11
|
-
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner -%}
|
|
12
|
-
|
|
13
|
-
{% set productName %}
|
|
14
|
-
{% if config.cdpEnvironment !== "prod" %}
|
|
15
|
-
{{ appTagEnv({ env: config.cdpEnvironment }) }}
|
|
16
|
-
{% endif %}
|
|
17
|
-
{% endset %}
|
|
18
|
-
|
|
19
|
-
{% block head %}
|
|
20
|
-
<meta name="application-name" content="@defra/forms-runner" {{- govukAttributes({
|
|
21
|
-
"data-environment": {
|
|
22
|
-
value: config.cdpEnvironment,
|
|
23
|
-
optional: true
|
|
24
|
-
},
|
|
25
|
-
"data-version": {
|
|
26
|
-
value: config.serviceVersion,
|
|
27
|
-
optional: true
|
|
28
|
-
}
|
|
29
|
-
}) }}>
|
|
30
|
-
|
|
31
|
-
<link rel="preload" as="font" href="{{ assetPath }}/fonts/bold-b542beb274-v2.woff2" type="font/woff2" crossorigin="anonymous">
|
|
32
|
-
<link rel="preload" as="font" href="{{ assetPath }}/fonts/light-94a07e06a1-v2.woff2" type="font/woff2" crossorigin="anonymous">
|
|
33
|
-
<link rel="stylesheet" href="{{ getAssetPath("stylesheets/application.scss") }}">
|
|
34
|
-
{% endblock %}
|
|
35
|
-
|
|
36
|
-
{% block pageTitle -%}
|
|
37
|
-
{{ "Error: " if errors | length }}{{ pageTitle | evaluate }} - {{ name if name else config.serviceName }} - GOV.UK
|
|
38
|
-
{%- endblock %}
|
|
39
|
-
|
|
40
|
-
{% block skipLink %}
|
|
41
|
-
{{ govukSkipLink({
|
|
42
|
-
href: '#main-content',
|
|
43
|
-
text: 'Skip to main content'
|
|
44
|
-
}) }}
|
|
45
|
-
{% endblock %}
|
|
46
|
-
|
|
47
|
-
{% block header %}
|
|
48
|
-
{% if config.googleAnalyticsTrackingId and slug %}
|
|
49
|
-
<form method="post" action="/help/cookie-preferences/{{ slug }}?returnUrl={{ currentPath | urlencode }}">
|
|
50
|
-
<input type="hidden" name="crumb" value="{{ crumb }}">
|
|
51
|
-
|
|
52
|
-
{% set acceptHtml %}
|
|
53
|
-
<p class="govuk-body">You’ve accepted analytics cookies. You can <a class="govuk-link" href="/help/cookies/{{ slug }}">change your cookie settings</a> at any time.</p>
|
|
54
|
-
{% endset %}
|
|
55
|
-
|
|
56
|
-
{% set rejectedHtml %}
|
|
57
|
-
<p class="govuk-body">You’ve rejected analytics cookies. You can <a class="govuk-link" href="/help/cookies/{{ slug }}">change your cookie settings</a> at any time.</p>
|
|
58
|
-
{% endset %}
|
|
59
|
-
|
|
60
|
-
{% if cookieConsent.analytics !== true and cookieConsent.analytics !== false and cookieConsent.dismissed !== true %}
|
|
61
|
-
{% set html %}
|
|
62
|
-
<p class="govuk-body">We use some essential cookies to make this service work.</p>
|
|
63
|
-
<p class="govuk-body">We’d like to set analytics cookies so we can understand how people use the service and make improvements.</p>
|
|
64
|
-
{% endset %}
|
|
65
|
-
|
|
66
|
-
{{ govukCookieBanner({
|
|
67
|
-
ariaLabel: "Cookies on " + config.serviceName,
|
|
68
|
-
messages: [
|
|
69
|
-
{
|
|
70
|
-
headingText: config.serviceName,
|
|
71
|
-
html: html,
|
|
72
|
-
actions: [
|
|
73
|
-
{
|
|
74
|
-
text: "Accept analytics cookies",
|
|
75
|
-
type: "submit",
|
|
76
|
-
name: "cookies[analytics]",
|
|
77
|
-
value: "yes"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
text: "Reject analytics cookies",
|
|
81
|
-
type: "submit",
|
|
82
|
-
name: "cookies[analytics]",
|
|
83
|
-
value: "no"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
text: "View cookies",
|
|
87
|
-
href: "/help/cookies/" + slug
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
}) }}
|
|
93
|
-
{% elif cookieConsent.dismissed === false %}
|
|
94
|
-
{{ govukCookieBanner({
|
|
95
|
-
ariaLabel: "Cookies on " + config.serviceName,
|
|
96
|
-
messages: [
|
|
97
|
-
{
|
|
98
|
-
html: acceptHtml if cookieConsent.analytics === true else rejectedHtml,
|
|
99
|
-
actions: [
|
|
100
|
-
{
|
|
101
|
-
text: "Hide cookie message",
|
|
102
|
-
type: "submit",
|
|
103
|
-
name: "cookies[dismissed]",
|
|
104
|
-
value: "yes"
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
]
|
|
109
|
-
}) }}
|
|
110
|
-
{% endif %}
|
|
111
|
-
|
|
112
|
-
</form>
|
|
113
|
-
{% endif %}
|
|
114
|
-
|
|
115
|
-
{% if config.serviceBannerText | length %}
|
|
116
|
-
{{ appServiceBanner({
|
|
117
|
-
title: "Service status",
|
|
118
|
-
text: config.serviceBannerText
|
|
119
|
-
}) }}
|
|
120
|
-
{% endif %}
|
|
121
|
-
|
|
122
|
-
{{ govukHeader({
|
|
123
|
-
homepageUrl: currentPath if context.isForceAccess else "https://www.gov.uk",
|
|
124
|
-
containerClasses: "govuk-width-container",
|
|
125
|
-
productName: productName | safe | trim,
|
|
126
|
-
serviceName: name if name else config.serviceName,
|
|
127
|
-
serviceUrl: currentPath if context.isForceAccess else serviceUrl
|
|
128
|
-
}) }}
|
|
129
|
-
{% endblock %}
|
|
130
|
-
|
|
131
|
-
{% block beforeContent %}
|
|
132
|
-
{% set feedbackLink = feedbackLink or config.feedbackLink -%}
|
|
133
|
-
{% set phaseTag = phaseTag or config.phaseTag -%}
|
|
134
|
-
|
|
135
|
-
{% if phaseTag and feedbackLink %}
|
|
136
|
-
{% set feedbackLinkHtml -%}
|
|
137
|
-
<a href="{{ currentPath if context.isForceAccess else feedbackLink }}" class="govuk-link" {%- if not context.isForceAccess %} target="_blank" rel="noopener noreferrer" {%- endif %}>
|
|
138
|
-
{%- if "mailto:" in feedbackLink -%}
|
|
139
|
-
give your feedback by email
|
|
140
|
-
{%- else -%}
|
|
141
|
-
give your feedback (opens in new tab)
|
|
142
|
-
{%- endif -%}
|
|
143
|
-
</a>
|
|
144
|
-
{%- endset %}
|
|
145
|
-
|
|
146
|
-
{{ govukPhaseBanner({
|
|
147
|
-
tag: { text: phaseTag | capitalize },
|
|
148
|
-
html: "This is a new service. Help us improve it and " + feedbackLinkHtml | safe + "."
|
|
149
|
-
}) }}
|
|
150
|
-
{% endif %}
|
|
151
|
-
{% if backLink %}
|
|
152
|
-
{{ govukBackLink(backLink) }}
|
|
153
|
-
{% endif %}
|
|
154
|
-
{% endblock %}
|
|
155
|
-
|
|
156
|
-
{% block content %}
|
|
157
|
-
<h1 class="govuk-heading-l">Default page template</h1>
|
|
158
|
-
{% endblock %}
|
|
159
|
-
|
|
160
|
-
{% block bodyEnd %}
|
|
161
|
-
<script type="module" nonce="{{ cspNonce }}" src="{{ getAssetPath("application.js") }}"></script>
|
|
162
|
-
|
|
163
|
-
{% if config.googleAnalyticsTrackingId and cookieConsent.analytics === true %}
|
|
164
|
-
<script id="ga-tag-js-main" nonce="{{ cspNonce }}" src="https://www.googletagmanager.com/gtag/js?id={{ config.googleAnalyticsTrackingId }}" defer></script>
|
|
165
|
-
<script id="ga-tag-js-init" nonce="{{ cspNonce }}">
|
|
166
|
-
window.dataLayer = window.dataLayer || [];
|
|
167
|
-
function gtag(){dataLayer.push(arguments);}
|
|
168
|
-
gtag('js', new Date());
|
|
169
|
-
gtag('config', '{{ config.googleAnalyticsTrackingId }}');
|
|
170
|
-
</script>
|
|
171
|
-
{% endif %}
|
|
172
|
-
{% endblock %}
|
|
173
|
-
|
|
174
|
-
{% block footer %}
|
|
175
|
-
{% set meta = {
|
|
176
|
-
items: [
|
|
177
|
-
{
|
|
178
|
-
href: '/help/get-support/' + slug,
|
|
179
|
-
text: 'Get help with this form'
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
href: '/help/privacy/' + slug,
|
|
183
|
-
text: 'Privacy'
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
href: '/help/cookies/' + slug,
|
|
187
|
-
text: 'Cookies'
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
href: '/help/accessibility-statement/' + slug,
|
|
191
|
-
text: 'Accessibility Statement'
|
|
192
|
-
}
|
|
193
|
-
]
|
|
194
|
-
} if slug %}
|
|
195
|
-
|
|
196
|
-
{% if not context.isForceAccess %}
|
|
197
|
-
{{ govukFooter({ meta: meta }) }}
|
|
198
|
-
{% endif %}
|
|
199
|
-
{% endblock %}
|