@ukhomeoffice/cop-react-form-renderer 6.15.7-alpha → 6.15.7
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-hidden-component-show-when-in-component-and-page.json +62 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-page-same-component-reused.json +61 -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/cop-airpax-change-what-happened-before.json +300 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-component-show-when-in-component-and-page.json +6 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-page-same-component-reused.json +6 -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/cop-airpax-change-what-happened-after.json +280 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-component-show-when-in-component-and-page-removed.json +5 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-page-same-component-reused-removed.json +5 -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 +259 -289
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.test.js +89 -27
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.js +389 -0
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.test.js +559 -0
- 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 +4 -4
- package/dist/components/FormRenderer/helpers/deleteNodeByPath.js +0 -29
- package/dist/components/FormRenderer/helpers/deleteNodeByPath.test.js +0 -56
|
@@ -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,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "example-form",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"name": "example-form",
|
|
5
|
+
"title": "Example form",
|
|
6
|
+
"type": "form",
|
|
7
|
+
"components": [
|
|
8
|
+
{
|
|
9
|
+
"id": "alpha",
|
|
10
|
+
"fieldId": "alpha",
|
|
11
|
+
"label": "Alpha",
|
|
12
|
+
"type": "text"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "bravo",
|
|
16
|
+
"fieldId": "bravo",
|
|
17
|
+
"label": "Bravo",
|
|
18
|
+
"type": "text"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "charlie",
|
|
22
|
+
"fieldId": "charlie",
|
|
23
|
+
"label": "Charlie",
|
|
24
|
+
"type": "text"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"pages": [
|
|
28
|
+
{
|
|
29
|
+
"id": "general",
|
|
30
|
+
"name": "general",
|
|
31
|
+
"title": "General information",
|
|
32
|
+
"components": [
|
|
33
|
+
{
|
|
34
|
+
"use": "alpha"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"use": "bravo",
|
|
38
|
+
"show_when": {
|
|
39
|
+
"op": "=",
|
|
40
|
+
"field": "alpha",
|
|
41
|
+
"value": "NOT-alpha-value"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"show_when": {
|
|
46
|
+
"op": "=",
|
|
47
|
+
"field": "charlie",
|
|
48
|
+
"value": "charlie-value"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "Charlie-page",
|
|
53
|
+
"name": "Charlie-page",
|
|
54
|
+
"title": "Charlie-page",
|
|
55
|
+
"components": [
|
|
56
|
+
{
|
|
57
|
+
"use": "charlie"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "example-form",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"name": "example-form",
|
|
5
|
+
"title": "Example form",
|
|
6
|
+
"type": "form",
|
|
7
|
+
"components": [
|
|
8
|
+
{
|
|
9
|
+
"id": "alpha",
|
|
10
|
+
"fieldId": "alpha",
|
|
11
|
+
"label": "Alpha",
|
|
12
|
+
"type": "text"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "bravo",
|
|
16
|
+
"fieldId": "bravo",
|
|
17
|
+
"label": "Bravo",
|
|
18
|
+
"type": "text"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"pages": [
|
|
22
|
+
{
|
|
23
|
+
"id": "visiblePage",
|
|
24
|
+
"name": "visiblePage",
|
|
25
|
+
"title": "Visible Page",
|
|
26
|
+
"components": [
|
|
27
|
+
{
|
|
28
|
+
"use": "alpha"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "hiddenPage",
|
|
34
|
+
"name": "hiddenPage",
|
|
35
|
+
"title": "Hidden Page",
|
|
36
|
+
"components": [
|
|
37
|
+
{
|
|
38
|
+
"use": "bravo",
|
|
39
|
+
"show_when": {
|
|
40
|
+
"op": "=",
|
|
41
|
+
"field": "externalCondition1",
|
|
42
|
+
"value": "externalCondition1-value"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"use": "bravo",
|
|
47
|
+
"show_when": {
|
|
48
|
+
"op": "=",
|
|
49
|
+
"field": "externalCondition2",
|
|
50
|
+
"value": "externalCondition2-value"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"show_when": {
|
|
55
|
+
"op": "=",
|
|
56
|
+
"field": "alpha",
|
|
57
|
+
"value": "NOT-alpha-value"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "example-form",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"name": "example-form",
|
|
5
|
+
"title": "Example form",
|
|
6
|
+
"type": "form",
|
|
7
|
+
"components": [
|
|
8
|
+
{
|
|
9
|
+
"id": "alpha",
|
|
10
|
+
"fieldId": "alpha",
|
|
11
|
+
"label": "Alpha",
|
|
12
|
+
"type": "text"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "bravo",
|
|
16
|
+
"fieldId": "bravo",
|
|
17
|
+
"label": "Bravo",
|
|
18
|
+
"type": "text"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"pages": [
|
|
22
|
+
{
|
|
23
|
+
"id": "visiblePage",
|
|
24
|
+
"name": "visiblePage",
|
|
25
|
+
"title": "Visible Page",
|
|
26
|
+
"show_when": {
|
|
27
|
+
"op": "=",
|
|
28
|
+
"field": "makePageVisibleField",
|
|
29
|
+
"value": "makePageVisibleField-value"
|
|
30
|
+
},
|
|
31
|
+
"components": [
|
|
32
|
+
{
|
|
33
|
+
"use": "bravo",
|
|
34
|
+
"show_when": {
|
|
35
|
+
"op": "=",
|
|
36
|
+
"field": "externalCondition1",
|
|
37
|
+
"value": "NOT-externalCondition1-value"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"use": "bravo",
|
|
42
|
+
"show_when": {
|
|
43
|
+
"op": "=",
|
|
44
|
+
"field": "externalCondition2",
|
|
45
|
+
"value": "NOT-externalCondition2-value"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"use": "bravo",
|
|
50
|
+
"show_when": {
|
|
51
|
+
"op": "=",
|
|
52
|
+
"field": "externalCondition3",
|
|
53
|
+
"value": "externalCondition3-value"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "hiddenPage",
|
|
60
|
+
"name": "hiddenPage",
|
|
61
|
+
"title": "Hidden Page",
|
|
62
|
+
"components": [
|
|
63
|
+
{
|
|
64
|
+
"use": "alpha"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"show_when": {
|
|
68
|
+
"op": "=",
|
|
69
|
+
"field": "makePageVisibleField",
|
|
70
|
+
"value": "NOT-makePageVisibleField-value"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|