@ukhomeoffice/cop-react-form-renderer 6.15.8-alpha → 6.15.8
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/dist/components/CollectionSummary/BannerStrip.scss +4 -0
- package/dist/components/FormComponent/FormComponent.js +6 -0
- package/dist/components/FormComponent/helpers/addLabel.js +3 -2
- package/dist/components/FormPage/FormPage.js +28 -17
- package/dist/components/FormPage/FormPage.test.js +53 -0
- package/dist/components/FormRenderer/FormRenderer.js +5 -10
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/cop-reassign-task-to-rcc.json +445 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-page-nested-radio-component.json +200 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-page-same-component-reused-one-shown.json +74 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-airpax-carrier.json +407 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-page-nested-radio-component.json +45 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-page-same-component-reused-one-shown.json +8 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/reassign-to-rcc.json +72 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-page-nested-radio-component-removed.json +45 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-page-same-component-reused-one-shown-removed.json +7 -0
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.js +248 -171
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.test.js +43 -7
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.js +139 -40
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.test.js +64 -7
- package/dist/components/FormRenderer/onCYAAction.js +0 -2
- package/dist/components/FormRenderer/onCYAAction.test.js +5 -0
- package/dist/components/FormRenderer/onPageAction.js +0 -1
- package/dist/hooks/useGetRequest.js +15 -15
- package/dist/hooks/useRefData.js +3 -2
- package/dist/utils/Component/getComponentTests/getComponent.multifile.test.js +2 -1
- package/dist/utils/Component/getDefaultValueFromConfig.js +2 -1
- package/dist/utils/Condition/meetsCondition.js +26 -12
- package/dist/utils/Condition/meetsCondition.test.js +21 -0
- package/dist/utils/Data/getAutocompleteSource.js +68 -51
- package/dist/utils/Data/getAutocompleteSource.test.js +31 -18
- package/dist/utils/Operate/doesContainValue.js +34 -0
- package/dist/utils/Operate/doesContainValue.test.js +75 -0
- package/dist/utils/Operate/runPageOperations.js +2 -0
- package/dist/utils/Validate/validateOnPageLoad.js +23 -0
- package/dist/utils/Validate/validateOnPageLoad.test.js +88 -0
- package/package.json +5 -4
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cya": {
|
|
3
|
+
"actions": [
|
|
4
|
+
{
|
|
5
|
+
"type": "submit",
|
|
6
|
+
"label": "Submit",
|
|
7
|
+
"validate": true
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"confirm": [
|
|
11
|
+
{
|
|
12
|
+
"title": "Task kept with NCC",
|
|
13
|
+
"message": [
|
|
14
|
+
"<h2 class='govuk-heading-m'>What happens next</h2>",
|
|
15
|
+
"<p class='govuk-body'>Review the task by ${reviewTimeP} on ${reviewDateP}.</p>",
|
|
16
|
+
"<p class='govuk-body'>To view the task, go to <a href='/tms/open-tasks'>open NCC tasks</a>. You can track updates in the task's timeline.</p>",
|
|
17
|
+
"<p class='govuk-body'><a href='/'>Go to homepage</a></p>",
|
|
18
|
+
"<p class='govuk-body'><a href='https://lssiprod.service-now.com/ess?id=take_survey&type_id=e0e2125b1bdd1110f8655946464bcbf7'>What do you think of this service?</a></p>"
|
|
19
|
+
],
|
|
20
|
+
"show_when": [
|
|
21
|
+
{
|
|
22
|
+
"op": "=",
|
|
23
|
+
"field": "assignWhere",
|
|
24
|
+
"value": "NCC"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"title": "Task assigned to RCC",
|
|
30
|
+
"message": [
|
|
31
|
+
"<h2 class='govuk-heading-m'>What happens next</h2>",
|
|
32
|
+
"<p>This task will automatically close at 23:59 on ${autoClose} - the day after the event date.</p>",
|
|
33
|
+
"<p>To view the task, go to <a href='/tms/open-tasks'>open NCC tasks</a>. You can track updates in the task's timeline.</p>",
|
|
34
|
+
"<p>You can only work on the task when it is assigned to NCC.</p>",
|
|
35
|
+
"<p><a href='/'>Go to homepage</a></p>",
|
|
36
|
+
"<p><a href='https://lssiprod.service-now.com/ess?id=take_survey&type_id=e0e2125b1bdd1110f8655946464bcbf7'>What do you think of this service?</a></p>"
|
|
37
|
+
],
|
|
38
|
+
"show_when": [
|
|
39
|
+
{
|
|
40
|
+
"type": "and",
|
|
41
|
+
"conditions": [
|
|
42
|
+
{
|
|
43
|
+
"op": "=",
|
|
44
|
+
"field": "assignWhere",
|
|
45
|
+
"value": "RCC"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"op": "=",
|
|
49
|
+
"field": "responseNeeded",
|
|
50
|
+
"value": "No"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"title": "Task assigned to RCC",
|
|
58
|
+
"message": [
|
|
59
|
+
"<h2 class='govuk-heading-m'>What happens next</h2>",
|
|
60
|
+
"<p class='govuk-body'>You set a review date of ${reviewTimeP} on ${reviewDateP}.</p>",
|
|
61
|
+
"<p class='govuk-body'>To view the task, go to <a href='/tms/open-tasks'>open NCC tasks</a>. You can track updates in the task's timeline.</p>",
|
|
62
|
+
"<p class='govuk-body'>You can only work on the task when it is assigned to NCC.</p>",
|
|
63
|
+
"<p class='govuk-body'><a href='/'>Go to homepage</a></p>",
|
|
64
|
+
"<p class='govuk-body'><a href='https://lssiprod.service-now.com/ess?id=take_survey&type_id=e0e2125b1bdd1110f8655946464bcbf7'>What do you think of this service?</a></p>"
|
|
65
|
+
],
|
|
66
|
+
"show_when": [
|
|
67
|
+
{
|
|
68
|
+
"type": "and",
|
|
69
|
+
"conditions": [
|
|
70
|
+
{
|
|
71
|
+
"op": "=",
|
|
72
|
+
"field": "assignWhere",
|
|
73
|
+
"value": "RCC"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"op": "=",
|
|
77
|
+
"field": "responseNeeded",
|
|
78
|
+
"value": "Yes"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"title": "Task assigned to RCC",
|
|
86
|
+
"message": [
|
|
87
|
+
"<h2 class='govuk-heading-m'>What happens next</h2>",
|
|
88
|
+
"<p class='govuk-body'>RCC will review this task.</p>",
|
|
89
|
+
"<p class='govuk-body'><a href='/'>Go to homepage</a></p>",
|
|
90
|
+
"<p class='govuk-body'><a href='https://lssiprod.service-now.com/ess?id=take_survey&type_id=e0e2125b1bdd1110f8655946464bcbf7'>What do you think of this service?</a></p>"
|
|
91
|
+
],
|
|
92
|
+
"show_when": [
|
|
93
|
+
{
|
|
94
|
+
"type": "and",
|
|
95
|
+
"conditions": [
|
|
96
|
+
{
|
|
97
|
+
"op": "!includes",
|
|
98
|
+
"field": "keycloakContext.groups",
|
|
99
|
+
"value": "/BFNCC"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"insertDateTime": true
|
|
107
|
+
},
|
|
108
|
+
"name": "cop-reassign-task-to-rcc",
|
|
109
|
+
"type": "cya",
|
|
110
|
+
"pages": [
|
|
111
|
+
{
|
|
112
|
+
"id": "assignTask",
|
|
113
|
+
"name": "assignTask",
|
|
114
|
+
"title": "Assign Task",
|
|
115
|
+
"actions": [
|
|
116
|
+
{
|
|
117
|
+
"page": "assignTaskToRCC",
|
|
118
|
+
"type": "next",
|
|
119
|
+
"label": "Continue",
|
|
120
|
+
"validate": true,
|
|
121
|
+
"show_when": {
|
|
122
|
+
"type": "or",
|
|
123
|
+
"conditions": [
|
|
124
|
+
{
|
|
125
|
+
"op": "=",
|
|
126
|
+
"field": "assignWhere",
|
|
127
|
+
"value": "RCC"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"page": "reviewDateAndTime",
|
|
134
|
+
"type": "saveAndNavigate",
|
|
135
|
+
"label": "Continue",
|
|
136
|
+
"validate": true,
|
|
137
|
+
"show_when": {
|
|
138
|
+
"type": "or",
|
|
139
|
+
"conditions": [
|
|
140
|
+
{
|
|
141
|
+
"op": "!=",
|
|
142
|
+
"field": "assignWhere",
|
|
143
|
+
"value": "RCC"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"cya_link": {},
|
|
150
|
+
"show_when": [
|
|
151
|
+
{
|
|
152
|
+
"op": "includes",
|
|
153
|
+
"field": "keycloakContext.groups",
|
|
154
|
+
"value": "/BFNCC"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"components": [
|
|
158
|
+
{
|
|
159
|
+
"use": "assignWhere"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "assignTaskToRCC",
|
|
165
|
+
"name": "assignTaskToRCC",
|
|
166
|
+
"title": "Assign task to RCC",
|
|
167
|
+
"actions": [
|
|
168
|
+
{
|
|
169
|
+
"type": "next",
|
|
170
|
+
"label": "Continue",
|
|
171
|
+
"validate": true
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"cya_link": {},
|
|
175
|
+
"show_when": {
|
|
176
|
+
"conditions": [
|
|
177
|
+
{
|
|
178
|
+
"op": "=",
|
|
179
|
+
"field": "assignWhere",
|
|
180
|
+
"value": "RCC"
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
"components": [
|
|
185
|
+
{
|
|
186
|
+
"use": "regionalCommandCentre",
|
|
187
|
+
"show_when": {
|
|
188
|
+
"type": "and",
|
|
189
|
+
"conditions": [
|
|
190
|
+
{
|
|
191
|
+
"op": "!=",
|
|
192
|
+
"field": "definitionKey",
|
|
193
|
+
"value": "cop-variance-breach-v2"
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"use": "regionalCommandCentreDisplay",
|
|
200
|
+
"show_when": {
|
|
201
|
+
"type": "or",
|
|
202
|
+
"conditions": [
|
|
203
|
+
{
|
|
204
|
+
"op": "=",
|
|
205
|
+
"field": "definitionKey",
|
|
206
|
+
"value": "cop-variance-breach-v2"
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"use": "responseNeeded",
|
|
213
|
+
"show_when": {
|
|
214
|
+
"type": "or",
|
|
215
|
+
"conditions": [
|
|
216
|
+
{
|
|
217
|
+
"op": "includes",
|
|
218
|
+
"field": "keycloakContext.groups",
|
|
219
|
+
"value": "/BFNCC"
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"use": "assignMessage"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"operations": [
|
|
229
|
+
{
|
|
230
|
+
"field": "reviewDateTime",
|
|
231
|
+
"function": "deleteValueInFormData",
|
|
232
|
+
"run_when": {
|
|
233
|
+
"field": "responseNeeded",
|
|
234
|
+
"condition": "changes"
|
|
235
|
+
},
|
|
236
|
+
"component": " "
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"id": "reviewDateAndTime",
|
|
242
|
+
"name": "reviewDateAndTime",
|
|
243
|
+
"title": "Set a review date and time",
|
|
244
|
+
"actions": [
|
|
245
|
+
{
|
|
246
|
+
"type": "next",
|
|
247
|
+
"label": "Continue",
|
|
248
|
+
"validate": true
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
"cya_link": {},
|
|
252
|
+
"show_when": [
|
|
253
|
+
{
|
|
254
|
+
"type": "or",
|
|
255
|
+
"conditions": [
|
|
256
|
+
{
|
|
257
|
+
"op": "=",
|
|
258
|
+
"field": "responseNeeded",
|
|
259
|
+
"value": "Yes"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"op": "=",
|
|
263
|
+
"field": "assignWhere",
|
|
264
|
+
"value": "NCC"
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
"components": [
|
|
270
|
+
{
|
|
271
|
+
"use": "reviewDateTime"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"use": "responseNeeded",
|
|
275
|
+
"label": "",
|
|
276
|
+
"value": "Yes",
|
|
277
|
+
"hidden": true,
|
|
278
|
+
"required": true,
|
|
279
|
+
"show_on_cya": false,
|
|
280
|
+
"defaultValue": "Yes"
|
|
281
|
+
}
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
"title": "Assign task to RCC",
|
|
286
|
+
"components": [
|
|
287
|
+
{
|
|
288
|
+
"id": "assignMessage",
|
|
289
|
+
"type": "textarea",
|
|
290
|
+
"label": "Message",
|
|
291
|
+
"fieldId": "assignMessage",
|
|
292
|
+
"cya_link": {},
|
|
293
|
+
"required": true,
|
|
294
|
+
"custom_errors": [
|
|
295
|
+
{
|
|
296
|
+
"type": "required",
|
|
297
|
+
"message": "Enter a message"
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"id": "assignWhere",
|
|
303
|
+
"data": {
|
|
304
|
+
"options": [
|
|
305
|
+
{
|
|
306
|
+
"hint": "Set a review date and time.",
|
|
307
|
+
"label": "Keep task with NCC",
|
|
308
|
+
"value": "NCC"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"hint": "Either set a review date and time or set the task to automatically close.",
|
|
312
|
+
"label": "Assign task to RCC",
|
|
313
|
+
"value": "RCC"
|
|
314
|
+
}
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
"type": "radios",
|
|
318
|
+
"label": " ",
|
|
319
|
+
"fieldId": "assignWhere",
|
|
320
|
+
"preserveInPayload": true,
|
|
321
|
+
"required": true,
|
|
322
|
+
"cya_label": "Assign task",
|
|
323
|
+
"custom_errors": [
|
|
324
|
+
{
|
|
325
|
+
"type": "required",
|
|
326
|
+
"message": "Select where you want to assign this task"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"showAllValues": "true"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"id": "regionalCommandCentre",
|
|
333
|
+
"data": {
|
|
334
|
+
"url": "${environmentContext.referenceDataUrl}/v2/entities/branch?mode=dataOnly&filter=directorateid.eq=2&filter=code=in.(BFSEEU,BFHROW,BFSOUTH,BFNORTH,BFCENT)"
|
|
335
|
+
},
|
|
336
|
+
"hint": "Type to search",
|
|
337
|
+
"item": {
|
|
338
|
+
"label": "name",
|
|
339
|
+
"value": "id"
|
|
340
|
+
},
|
|
341
|
+
"type": "autocomplete",
|
|
342
|
+
"label": "Regional Command Centre",
|
|
343
|
+
"fieldId": "regionalCommandCentre",
|
|
344
|
+
"required": true,
|
|
345
|
+
"cya_label": "RCC",
|
|
346
|
+
"custom_errors": [
|
|
347
|
+
{
|
|
348
|
+
"type": "required",
|
|
349
|
+
"message": "Select a Regional Command Centre"
|
|
350
|
+
}
|
|
351
|
+
],
|
|
352
|
+
"showAllValues": true
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"id": "regionalCommandCentreDisplay",
|
|
356
|
+
"data": {
|
|
357
|
+
"url": "${environmentContext.referenceDataUrl}/v2/entities/branch?mode=dataOnly&filter=directorateid.eq=2&filter=code=in.(BFSEEU,BFHROW,BFSOUTH,BFNORTH,BFCENT)"
|
|
358
|
+
},
|
|
359
|
+
"item": {
|
|
360
|
+
"label": "name",
|
|
361
|
+
"value": "id"
|
|
362
|
+
},
|
|
363
|
+
"type": "autocomplete",
|
|
364
|
+
"label": "Regional Command Centre",
|
|
365
|
+
"fieldId": "regionalCommandCentre",
|
|
366
|
+
"disabled": true,
|
|
367
|
+
"required": true,
|
|
368
|
+
"cya_label": "RCC",
|
|
369
|
+
"showAllValues": true
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"id": "reviewDateTime",
|
|
373
|
+
"type": "container",
|
|
374
|
+
"label": " ",
|
|
375
|
+
"fieldId": "reviewDateTime",
|
|
376
|
+
"required": true,
|
|
377
|
+
"components": [
|
|
378
|
+
{
|
|
379
|
+
"type": "html",
|
|
380
|
+
"content": "The review date and time will display on the open NCC tasks screen."
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"id": "reviewDate",
|
|
384
|
+
"hint": "For example, 20 2 2023.",
|
|
385
|
+
"type": "date",
|
|
386
|
+
"label": "Review date",
|
|
387
|
+
"fieldId": "reviewDate",
|
|
388
|
+
"cya_link": {},
|
|
389
|
+
"required": true,
|
|
390
|
+
"custom_errors": [
|
|
391
|
+
{
|
|
392
|
+
"type": "required",
|
|
393
|
+
"message": "Enter a review date"
|
|
394
|
+
}
|
|
395
|
+
],
|
|
396
|
+
"additionalValidation": [
|
|
397
|
+
{
|
|
398
|
+
"message": "Review date must be today or in the future",
|
|
399
|
+
"function": "mustBeInTheFuture",
|
|
400
|
+
"todayAllowed": true
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"id": "reviewTime",
|
|
406
|
+
"hint": "Use 24-hour. For example, 19:45.",
|
|
407
|
+
"type": "time",
|
|
408
|
+
"label": "Review time",
|
|
409
|
+
"fieldId": "reviewTime",
|
|
410
|
+
"cya_link": {},
|
|
411
|
+
"required": true,
|
|
412
|
+
"custom_errors": [
|
|
413
|
+
{
|
|
414
|
+
"type": "required",
|
|
415
|
+
"message": "Enter a review time"
|
|
416
|
+
}
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
]
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"id": "responseNeeded",
|
|
423
|
+
"data": {
|
|
424
|
+
"options": [
|
|
425
|
+
{
|
|
426
|
+
"hint": "Set a review date for the task.",
|
|
427
|
+
"label": "Yes",
|
|
428
|
+
"value": "Yes"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"hint": "The task will automatically close at 23:59 on ${autoClose} - the day after the event date.",
|
|
432
|
+
"label": "No",
|
|
433
|
+
"value": "No"
|
|
434
|
+
}
|
|
435
|
+
]
|
|
436
|
+
},
|
|
437
|
+
"type": "radios",
|
|
438
|
+
"label": "Do you need a response?",
|
|
439
|
+
"fieldId": "responseNeeded",
|
|
440
|
+
"required": true,
|
|
441
|
+
"showAllValues": "true"
|
|
442
|
+
}
|
|
443
|
+
],
|
|
444
|
+
"version": "7b941ec0bb281e2b93ba32058b81e1a88f0f0a9a"
|
|
445
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cop-addABorderEvent",
|
|
3
|
+
"title": "Add a border event",
|
|
4
|
+
"type": "form",
|
|
5
|
+
"components":[],
|
|
6
|
+
"pages": [
|
|
7
|
+
{
|
|
8
|
+
"id": "vehicle-owner-details",
|
|
9
|
+
"name": "vehicle-owner-details",
|
|
10
|
+
"title": "Vehicle owner details",
|
|
11
|
+
"show_when": [
|
|
12
|
+
{
|
|
13
|
+
"field": "driverOwnVehicle",
|
|
14
|
+
"op": "=",
|
|
15
|
+
"value": "noSomeoneElseOwns"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"field": "modeOfTransport.id",
|
|
19
|
+
"op": "eq",
|
|
20
|
+
"value": 9
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"field": "whatHappened",
|
|
24
|
+
"op": "in",
|
|
25
|
+
"values": [
|
|
26
|
+
"roroItems",
|
|
27
|
+
"sams",
|
|
28
|
+
"peopleHidingTrailer",
|
|
29
|
+
"peopleHidingVehicle",
|
|
30
|
+
"unsecuredGoods"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"components": [
|
|
35
|
+
{
|
|
36
|
+
"id": "otherVehicleOwner",
|
|
37
|
+
"fieldId": "otherVehicleOwner",
|
|
38
|
+
"type": "container",
|
|
39
|
+
"show_on_cya": true,
|
|
40
|
+
"components": [
|
|
41
|
+
{
|
|
42
|
+
"id": "fullName",
|
|
43
|
+
"fieldId": "fullName",
|
|
44
|
+
"type": "text",
|
|
45
|
+
"label": "Full name",
|
|
46
|
+
"required": true,
|
|
47
|
+
"custom_errors": [
|
|
48
|
+
{
|
|
49
|
+
"type": "required",
|
|
50
|
+
"message": "Enter the full name of the owner"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"additionalValidation": [
|
|
54
|
+
{
|
|
55
|
+
"function": "mustBeShorterThan",
|
|
56
|
+
"value": 256,
|
|
57
|
+
"message": "Full name must be 255 characters or less"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": "vehicleOwnerAddress",
|
|
63
|
+
"fieldId": "vehicleOwnerAddress",
|
|
64
|
+
"label": "Do you have an address for the owner?",
|
|
65
|
+
"cya_label": "Do you have an address for the owner?",
|
|
66
|
+
"type": "radios",
|
|
67
|
+
"required": true,
|
|
68
|
+
"custom_errors": [
|
|
69
|
+
{
|
|
70
|
+
"type": "required",
|
|
71
|
+
"message": "Select whether you have an address for the owner"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"data": {
|
|
75
|
+
"options": [
|
|
76
|
+
{
|
|
77
|
+
"label": "Yes - a UK address",
|
|
78
|
+
"value": "Yes",
|
|
79
|
+
"nested": [
|
|
80
|
+
{
|
|
81
|
+
"id": "ukAddress",
|
|
82
|
+
"fieldId": "ukAddress",
|
|
83
|
+
"hint": "Enter part of the address and select a result",
|
|
84
|
+
"type": "addressLookup",
|
|
85
|
+
"label": "Search UK address",
|
|
86
|
+
"cya_label": "Address",
|
|
87
|
+
"required": true,
|
|
88
|
+
"isEditable": true
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"label": "Yes - a non-UK address",
|
|
94
|
+
"value": "no",
|
|
95
|
+
"nested": [
|
|
96
|
+
{
|
|
97
|
+
"id": "nonUkAddressText",
|
|
98
|
+
"fieldId": "nonUkAddressText",
|
|
99
|
+
"type": "textarea",
|
|
100
|
+
"label": "International address",
|
|
101
|
+
"cya_label": "Address",
|
|
102
|
+
"required": true,
|
|
103
|
+
"custom_errors": [
|
|
104
|
+
{
|
|
105
|
+
"type": "required",
|
|
106
|
+
"message": "Enter an international address"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"additionalValidation": [
|
|
110
|
+
{
|
|
111
|
+
"function": "mustBeShorterThan",
|
|
112
|
+
"value": "1001",
|
|
113
|
+
"message": "International address must be 1000 characters or less"
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "country",
|
|
119
|
+
"fieldId": "country",
|
|
120
|
+
"type": "autocomplete",
|
|
121
|
+
"showAllValues": true,
|
|
122
|
+
"label": "Country",
|
|
123
|
+
"required": true,
|
|
124
|
+
"custom_errors": [
|
|
125
|
+
{
|
|
126
|
+
"type": "required",
|
|
127
|
+
"message": "Select a country"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"item": {
|
|
131
|
+
"value": "id",
|
|
132
|
+
"label": "name",
|
|
133
|
+
"format": "${iso31661alpha3} - ${name}"
|
|
134
|
+
},
|
|
135
|
+
"data": {
|
|
136
|
+
"url": "refdata/v2/entities/country?sort=name.asc&mode=dataOnly&validDateTime=true&filter=id=neq.234&select=id,name,iso31661alpha3"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"label": "No",
|
|
143
|
+
"value": "false"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"id": "telephoneNumber",
|
|
150
|
+
"fieldId": "telephoneNumber",
|
|
151
|
+
"type": "text",
|
|
152
|
+
"label": "Telephone number",
|
|
153
|
+
"hint": "For international numbers include the country code",
|
|
154
|
+
"pattern": "^[\\+]?[\\s\\d]+$",
|
|
155
|
+
"additionalValidation": [
|
|
156
|
+
{
|
|
157
|
+
"function": "mustBeShorterThan",
|
|
158
|
+
"value": 16,
|
|
159
|
+
"message": "Telephone number must be 15 characters or less"
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"custom_errors": [
|
|
163
|
+
{
|
|
164
|
+
"type": "pattern",
|
|
165
|
+
"message": "Telephone number can only contain a + symbol at the start and numbers"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"id": "emailAddress",
|
|
171
|
+
"fieldId": "emailAddress",
|
|
172
|
+
"type": "text",
|
|
173
|
+
"label": "Email address",
|
|
174
|
+
"additionalValidation": [
|
|
175
|
+
{
|
|
176
|
+
"function": "mustBeShorterThan",
|
|
177
|
+
"value": 101,
|
|
178
|
+
"message": "Email address must be 100 characters or less"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"actions": [
|
|
186
|
+
{
|
|
187
|
+
"type": "saveAndContinue",
|
|
188
|
+
"page": "vehicle-details-cya"
|
|
189
|
+
},
|
|
190
|
+
"saveAndReturn"
|
|
191
|
+
],
|
|
192
|
+
"cya_link": {
|
|
193
|
+
"page": "vehicle-owner-details",
|
|
194
|
+
"singleChangeLink": true,
|
|
195
|
+
"aria_suffix": "Vehicle owner details"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
|