@ukhomeoffice/cop-react-form-renderer 6.15.0-alpha → 6.15.0-hotfix
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/FormPage/FormPage.js +8 -10
- 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-change-what-happened-before.json +300 -0
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-mandec-remove-unspent-convictions-before.json +143 -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/cop-mandec-remove-unspent-convictions-after.json +127 -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 -282
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.test.js +87 -26
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.js +387 -0
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.test.js +559 -0
- package/dist/components/FormRenderer/onCYAAction.js +12 -0
- package/dist/components/FormRenderer/onCYAAction.test.js +5 -0
- 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 -26
- package/dist/components/FormRenderer/helpers/deleteNodeByPath.test.js +0 -56
|
@@ -12,6 +12,7 @@ var _utils = _interopRequireDefault(require("../../utils"));
|
|
|
12
12
|
var _FormComponent = _interopRequireDefault(require("../FormComponent"));
|
|
13
13
|
var _PageActions = _interopRequireDefault(require("../PageActions"));
|
|
14
14
|
require("./FormPage.scss");
|
|
15
|
+
var _validateOnPageLoad = require("../../utils/Validate/validateOnPageLoad");
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -24,7 +25,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
24
25
|
// Styles
|
|
25
26
|
const DEFAULT_CLASS = exports.DEFAULT_CLASS = 'hods-form__page';
|
|
26
27
|
const FormPage = _ref => {
|
|
27
|
-
var
|
|
28
|
+
var _formPage$actions, _page$actions;
|
|
28
29
|
let {
|
|
29
30
|
page,
|
|
30
31
|
pages,
|
|
@@ -37,8 +38,7 @@ const FormPage = _ref => {
|
|
|
37
38
|
classModifiers,
|
|
38
39
|
className,
|
|
39
40
|
submitting,
|
|
40
|
-
pageId
|
|
41
|
-
fromTarget
|
|
41
|
+
pageId
|
|
42
42
|
} = _ref;
|
|
43
43
|
const [patch, setPatch] = (0, _react.useState)({});
|
|
44
44
|
const {
|
|
@@ -47,12 +47,12 @@ const FormPage = _ref => {
|
|
|
47
47
|
} = (0, _hooks.useValidation)();
|
|
48
48
|
const [patchLabel, setPatchLabel] = (0, _react.useState)({});
|
|
49
49
|
const [isPageRendered, setIsPageRendered] = (0, _react.useState)(false);
|
|
50
|
-
const runOnLoad =
|
|
50
|
+
const runOnLoad = (0, _react.useMemo)(() => (0, _validateOnPageLoad.doValidateOnPageLoad)(page), [page]);
|
|
51
51
|
(0, _react.useEffect)(() => {
|
|
52
52
|
setIsPageRendered(true);
|
|
53
53
|
}, []);
|
|
54
54
|
(0, _react.useEffect)(() => {
|
|
55
|
-
if (isPageRendered &&
|
|
55
|
+
if (isPageRendered && runOnLoad) {
|
|
56
56
|
validate.page(page);
|
|
57
57
|
}
|
|
58
58
|
}, [pageId, isPageRendered]);
|
|
@@ -120,9 +120,9 @@ const FormPage = _ref => {
|
|
|
120
120
|
}));
|
|
121
121
|
let errorMessages = null;
|
|
122
122
|
if (runOnLoad && (errors === null || errors === void 0 ? void 0 : errors.length) > 0) {
|
|
123
|
-
var _page$
|
|
123
|
+
var _page$customValidatio;
|
|
124
124
|
errorMessages = [{
|
|
125
|
-
error: page === null || page === void 0 || (_page$
|
|
125
|
+
error: page === null || page === void 0 || (_page$customValidatio = page.customValidation) === null || _page$customValidatio === void 0 || (_page$customValidatio = _page$customValidatio[0]) === null || _page$customValidatio === void 0 ? void 0 : _page$customValidatio.message
|
|
126
126
|
}];
|
|
127
127
|
} else if ((errors === null || errors === void 0 ? void 0 : errors.length) > 0 && !runOnLoad) {
|
|
128
128
|
errorMessages = errors;
|
|
@@ -174,7 +174,6 @@ FormPage.propTypes = {
|
|
|
174
174
|
}).isRequired,
|
|
175
175
|
pages: _propTypes.default.arrayOf(_propTypes.default.shape({})),
|
|
176
176
|
submitting: _propTypes.default.bool,
|
|
177
|
-
fromTarget: _propTypes.default.bool,
|
|
178
177
|
pageId: _propTypes.default.string.isRequired
|
|
179
178
|
};
|
|
180
179
|
FormPage.defaultProps = {
|
|
@@ -186,7 +185,6 @@ FormPage.defaultProps = {
|
|
|
186
185
|
onTopLevelChange: undefined,
|
|
187
186
|
onWrapperChange: undefined,
|
|
188
187
|
pages: [],
|
|
189
|
-
submitting: false
|
|
190
|
-
fromTarget: false
|
|
188
|
+
submitting: false
|
|
191
189
|
};
|
|
192
190
|
var _default = exports.default = FormPage;
|
|
@@ -54,8 +54,7 @@ const FormRenderer = _ref => {
|
|
|
54
54
|
noChangeAction,
|
|
55
55
|
newPageId,
|
|
56
56
|
viewOnly,
|
|
57
|
-
hideBlankRows
|
|
58
|
-
fromTarget
|
|
57
|
+
hideBlankRows
|
|
59
58
|
} = _ref;
|
|
60
59
|
return /*#__PURE__*/_react.default.createElement(_context.HooksContextProvider, {
|
|
61
60
|
overrides: hooks
|
|
@@ -76,8 +75,7 @@ const FormRenderer = _ref => {
|
|
|
76
75
|
noChangeAction: noChangeAction,
|
|
77
76
|
newPageId: newPageId,
|
|
78
77
|
viewOnly: viewOnly,
|
|
79
|
-
hideBlankRows: hideBlankRows
|
|
80
|
-
fromTarget: fromTarget
|
|
78
|
+
hideBlankRows: hideBlankRows
|
|
81
79
|
})));
|
|
82
80
|
};
|
|
83
81
|
const DEFAULT_CLASS = exports.DEFAULT_CLASS = 'hods-form';
|
|
@@ -100,8 +98,7 @@ const InternalFormRenderer = _ref2 => {
|
|
|
100
98
|
noChangeAction,
|
|
101
99
|
newPageId,
|
|
102
100
|
viewOnly,
|
|
103
|
-
hideBlankRows
|
|
104
|
-
fromTarget
|
|
101
|
+
hideBlankRows
|
|
105
102
|
} = _ref2;
|
|
106
103
|
// Set up the initial states.
|
|
107
104
|
const [data, setData] = (0, _react.useState)({});
|
|
@@ -326,8 +323,7 @@ const InternalFormRenderer = _ref2 => {
|
|
|
326
323
|
classModifiers: formState.page.classModifiers,
|
|
327
324
|
className: formState.page.className,
|
|
328
325
|
submitting: submitting,
|
|
329
|
-
pageId: pageId
|
|
330
|
-
fromTarget: fromTarget
|
|
326
|
+
pageId: pageId
|
|
331
327
|
}), formState.page && !formState.cya && formState.page.collection && /*#__PURE__*/_react.default.createElement(_CollectionPage.default, {
|
|
332
328
|
page: formState.page,
|
|
333
329
|
pages: pages,
|
|
@@ -370,8 +366,7 @@ const propTypes = {
|
|
|
370
366
|
/** See <a href="/?path=/docs/f-json--page#formtypes">FormTypes</a>. */
|
|
371
367
|
type: _propTypes.default.oneOf([_models.FormTypes.CYA, _models.FormTypes.FORM, _models.FormTypes.HUB, _models.FormTypes.TASK, _models.FormTypes.WIZARD, _models.FormTypes.TASK_CYA, _models.FormTypes.FORM_WITH_TASK]).isRequired,
|
|
372
368
|
viewOnly: _propTypes.default.bool,
|
|
373
|
-
hideBlankRows: _propTypes.default.bool
|
|
374
|
-
fromTarget: _propTypes.default.bool.isRequired
|
|
369
|
+
hideBlankRows: _propTypes.default.bool
|
|
375
370
|
};
|
|
376
371
|
const defaultProps = {
|
|
377
372
|
classBlock: DEFAULT_CLASS,
|
|
@@ -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
|
+
}
|