@ukhomeoffice/cop-react-form-renderer 6.15.2-alpha → 6.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/components/CollectionSummary/BannerStrip.scss +4 -0
  2. package/dist/components/CollectionSummary/CollectionSummary.js +2 -2
  3. package/dist/components/CollectionSummary/SummaryCard.js +2 -2
  4. package/dist/components/FormComponent/Collection.js +2 -2
  5. package/dist/components/FormComponent/Container.js +2 -2
  6. package/dist/components/FormComponent/FormComponent.js +2 -2
  7. package/dist/components/FormPage/FormPage.js +8 -10
  8. package/dist/components/FormRenderer/FormRenderer.js +7 -12
  9. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-component-show-when-in-component-and-page.json +62 -0
  10. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-page-same-component-reused.json +61 -0
  11. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-page-same-component-reused-one-shown.json +74 -0
  12. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-airpax-change-what-happened-before.json +300 -0
  13. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-mandec-remove-unspent-convictions-before.json +143 -0
  14. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-component-show-when-in-component-and-page.json +6 -0
  15. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-page-same-component-reused.json +6 -0
  16. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-page-same-component-reused-one-shown.json +8 -0
  17. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/cop-airpax-change-what-happened-after.json +280 -0
  18. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/cop-mandec-remove-unspent-convictions-after.json +127 -0
  19. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-component-show-when-in-component-and-page-removed.json +5 -0
  20. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-page-same-component-reused-removed.json +5 -0
  21. package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-page-same-component-reused-one-shown-removed.json +7 -0
  22. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.js +259 -282
  23. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.test.js +77 -26
  24. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.js +381 -0
  25. package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.test.js +559 -0
  26. package/dist/components/FormRenderer/onCYAAction.js +12 -0
  27. package/dist/components/FormRenderer/onCYAAction.test.js +5 -0
  28. package/dist/components/PageActions/ActionButton.js +2 -2
  29. package/dist/components/SummaryList/SummaryList.js +2 -2
  30. package/dist/components/TaskList/TaskList.js +2 -2
  31. package/dist/hooks/useGetRequest.js +15 -15
  32. package/dist/hooks/useRefData.js +3 -2
  33. package/dist/utils/CollectionPage/getQuickEditPage.js +2 -2
  34. package/dist/utils/Component/getComponentTests/getComponent.multifile.test.js +2 -1
  35. package/dist/utils/Component/getDefaultValueFromConfig.js +2 -1
  36. package/dist/utils/Condition/meetsCondition.js +26 -12
  37. package/dist/utils/Condition/meetsCondition.test.js +21 -0
  38. package/dist/utils/Data/getAutocompleteSource.js +68 -51
  39. package/dist/utils/Data/getAutocompleteSource.test.js +31 -18
  40. package/dist/utils/Operate/doesContainValue.js +34 -0
  41. package/dist/utils/Operate/doesContainValue.test.js +75 -0
  42. package/dist/utils/Operate/runPageOperations.js +2 -0
  43. package/dist/utils/Validate/validateOnPageLoad.js +23 -0
  44. package/dist/utils/Validate/validateOnPageLoad.test.js +88 -0
  45. package/package.json +4 -4
  46. package/dist/components/FormRenderer/helpers/deleteNodeByPath.js +0 -26
  47. package/dist/components/FormRenderer/helpers/deleteNodeByPath.test.js +0 -56
@@ -0,0 +1,280 @@
1
+ {
2
+ "id": "9a2aae86-e3c7-11ef-b502-56ecdccac0eb",
3
+ "businessKey": "DEV-20250205-1041",
4
+ "modeOfTransport": {
5
+ "id": 2,
6
+ "mode": "Scheduled Air Passenger",
7
+ "modecode": "airpass",
8
+ "crossingtype": [
9
+ "air"
10
+ ],
11
+ "value": "Scheduled Air Passenger",
12
+ "label": "Scheduled Air Passenger"
13
+ },
14
+ "port": {
15
+ "id": 3415,
16
+ "name": "Luton",
17
+ "sea": false,
18
+ "air": true,
19
+ "land": false,
20
+ "rail": false,
21
+ "countryid": 234,
22
+ "iata": "LTN",
23
+ "value": "3415",
24
+ "label": "Luton",
25
+ "hint": ""
26
+ },
27
+ "formStatus": {
28
+ "tasks": {
29
+ "undefined": {},
30
+ "event-summary-airpassenger": {
31
+ "complete": true,
32
+ "currentPage": "event-summary-check-answers"
33
+ },
34
+ "item-seals-abandoned": {
35
+ "complete": true,
36
+ "currentPage": "what-happens-next"
37
+ },
38
+ "journey-details-airpax": {
39
+ "complete": true,
40
+ "currentPage": "journey-check-answers"
41
+ },
42
+ "submit-airpax": {
43
+ "complete": false,
44
+ "currentPage": "submit-form"
45
+ }
46
+ },
47
+ "taskPage": "submit-form"
48
+ },
49
+ "whatHappened": "items",
50
+ "formInstanceId": "e1795627-b40e-4ac6-bfb2-5bf3f10ff126",
51
+ "links": [
52
+ {
53
+ "method": "GET",
54
+ "href": "https://green.dev.cop.homeoffice.gov.uk/camunda/engine-rest/process-instance/9a2aae86-e3c7-11ef-b502-56ecdccac0eb",
55
+ "rel": "self"
56
+ }
57
+ ],
58
+ "definitionId": "cop-addABorderEvent:3:08744e1c-8ba1-11ef-87e2-66391f301ad1",
59
+ "caseInstanceId": null,
60
+ "ended": false,
61
+ "suspended": false,
62
+ "tenantId": null,
63
+ "eventDateTime": {
64
+ "eventDate": "05-02-2025",
65
+ "eventTime": "12:12"
66
+ },
67
+ "terminal": {
68
+ "id": 8,
69
+ "name": "Eastern Docks",
70
+ "validfrom": "2019-01-01T00:01:00.000Z",
71
+ "validto": null,
72
+ "updatedby": null,
73
+ "value": "8",
74
+ "label": "Eastern Docks",
75
+ "hint": ""
76
+ },
77
+ "subLocation": {
78
+ "id": 19,
79
+ "sublocation": "Arrival Lounge",
80
+ "description": null,
81
+ "validfrom": "2021-05-07T00:00:03.000Z",
82
+ "validto": null,
83
+ "updatedby": "BethStephenson",
84
+ "uoflocation": false,
85
+ "value": "19",
86
+ "label": "Arrival Lounge",
87
+ "hint": ""
88
+ },
89
+ "operationOrExercise": "no",
90
+ "centaurReference": "E1234567",
91
+ "leadOfficerEmail": {
92
+ "email": "philip.harvey@digital.homeoffice.gov.uk",
93
+ "label": "philip.harvey@digital.homeoffice.gov.uk",
94
+ "value": "philip.harvey@digital.homeoffice.gov.uk",
95
+ "defaultteamid": "cf576f61-26cd-4862-92e1-2d5cfc050c2d"
96
+ },
97
+ "itemsActiveId": "5034aaef-010b-4cca-9b83-15a679da0049",
98
+ "items": [
99
+ {
100
+ "id": "5034aaef-010b-4cca-9b83-15a679da0049",
101
+ "sealNumber": "E1235612",
102
+ "itemCategory": {
103
+ "id": 6,
104
+ "category": "Alcohol",
105
+ "description": "Beers, Wines, Spirits etc.",
106
+ "validfrom": "2023-01-10T00:00:01.000Z",
107
+ "validto": null,
108
+ "updatedby": "Mohammed Abdul Odud",
109
+ "synonyms": [
110
+ "'Beer'",
111
+ "'Wines'",
112
+ "'Spirits'"
113
+ ],
114
+ "value": "6",
115
+ "label": "Alcohol",
116
+ "hint": ""
117
+ },
118
+ "itemSubCategory": {
119
+ "id": 1795,
120
+ "name": "Alcohol distiller",
121
+ "description": null,
122
+ "itemcategoriesid": 6,
123
+ "cites": false,
124
+ "poao": false,
125
+ "cbrn": false,
126
+ "document": false,
127
+ "tobacco": false,
128
+ "alcohol": true,
129
+ "weapons": false,
130
+ "firearms": false,
131
+ "ipr": true,
132
+ "strategic": false,
133
+ "avtc": false,
134
+ "oils": false,
135
+ "commodity": false,
136
+ "good": true,
137
+ "plant": false,
138
+ "animal": false,
139
+ "drugs": false,
140
+ "financial": false,
141
+ "indecent": false,
142
+ "vehicle": false,
143
+ "medical": false,
144
+ "unitid": 5,
145
+ "seizureqty": null,
146
+ "ienqty": null,
147
+ "validfrom": "2023-01-10T00:00:01.000Z",
148
+ "validto": null,
149
+ "updatedby": "Mohammed Abdul Odud",
150
+ "uof": false,
151
+ "epmscode": 1037,
152
+ "epmscategory": "ALP",
153
+ "unitarray": [
154
+ 5
155
+ ],
156
+ "categoryarray": [
157
+ 6,
158
+ 9,
159
+ 14
160
+ ],
161
+ "lethalfirearm": null,
162
+ "nonlethalfirearm": null,
163
+ "value": "1795",
164
+ "label": "Alcohol distiller",
165
+ "hint": ""
166
+ },
167
+ "seizedOrDetained": "seized",
168
+ "legalReasonForSeizing": {
169
+ "id": 1,
170
+ "epmsvalue": 2,
171
+ "reason": "CEMA",
172
+ "description": "Customs and excise management act 1979",
173
+ "validfrom": "2022-09-21T00:00:01.000Z",
174
+ "validto": null,
175
+ "updatedby": "Mohammed Abdul Odud",
176
+ "value": "1",
177
+ "label": "Customs and excise management act 1979",
178
+ "hint": ""
179
+ },
180
+ "detectionTechnologies": [
181
+ {
182
+ "id": "54600601-4f78-450d-bdee-2290b7aa4d09",
183
+ "detectionTechnology": {
184
+ "id": 5,
185
+ "name": "Automatic Number Plate Recognition",
186
+ "value": "5",
187
+ "label": "Automatic Number Plate Recognition",
188
+ "hint": ""
189
+ }
190
+ }
191
+ ],
192
+ "searchTechniques": [
193
+ {
194
+ "id": "54600601-4f78-450d-bdee-2290b7aa4d09",
195
+ "searchTechnique": {
196
+ "id": 27,
197
+ "type": "Baggage",
198
+ "value": "27",
199
+ "label": "Baggage",
200
+ "hint": ""
201
+ }
202
+ }
203
+ ],
204
+ "concealmentMethods": [
205
+ {
206
+ "id": "2e98b018-99ff-440d-88fa-ee630dbc7a19",
207
+ "concealmentMethod": {
208
+ "id": 24,
209
+ "method": "Air filter",
210
+ "value": "24",
211
+ "label": "Air filter",
212
+ "hint": ""
213
+ }
214
+ }
215
+ ],
216
+ "specialStorageConditions": {
217
+ "epmsvalue": 10,
218
+ "description": "Machinery",
219
+ "id": 10,
220
+ "value": "10",
221
+ "label": "Machinery",
222
+ "hint": ""
223
+ },
224
+ "brandText": "asd",
225
+ "make": "asd",
226
+ "unitOfMeasure": {
227
+ "id": 13,
228
+ "unit": "Number of items",
229
+ "validfrom": "2023-02-21T00:00:01.000Z",
230
+ "validto": null,
231
+ "updatedby": "Mohammed Abdul Odud",
232
+ "code": 5,
233
+ "epmsid": 9,
234
+ "decimal": false,
235
+ "shortname": null,
236
+ "value": "13",
237
+ "label": "Number of items"
238
+ },
239
+ "quantity": "122",
240
+ "itemDescription": "qwse qwe qwe qwe qwe qwe ",
241
+ "willTheItemBeStored": "no",
242
+ "whatIsTheInitialMovement?": {
243
+ "id": 2,
244
+ "epmscode": 4,
245
+ "description": "Retained by case officer",
246
+ "inuse": true,
247
+ "validfrom": "2022-08-18T00:00:01.000Z",
248
+ "validto": null,
249
+ "updatedby": "Mohammed Abdul Odud",
250
+ "value": "2",
251
+ "label": "Retained by case officer",
252
+ "hint": ""
253
+ },
254
+ "shouldThisItemBeDestroyed": "no",
255
+ "giveAReason": "sd asd asd asd ",
256
+ "specialHandlingInstructions": "no",
257
+ "hasAnotherAgencyAdoptedTheItem": "no",
258
+ "constructedOrAdapted": "no",
259
+ "doYouHavePhotosOfTheItemToAdd": "no"
260
+ }
261
+ ],
262
+ "lockup": {
263
+ "value": "LTN",
264
+ "label": "Luton Airport Lockup",
265
+ "hidden": true
266
+ },
267
+ "meta": {},
268
+ "epmsSubmitted": true,
269
+ "doYouHaveTheirFlightNumber": "no",
270
+ "form": {
271
+ "formVersionId": "b1009648bfc7df2e5dcc565e953f8c48037d2648-20",
272
+ "title": "Add a border event",
273
+ "name": "cop-addABorderEvent",
274
+ "submissionDate": "2025-02-05T13:53:07.633Z",
275
+ "submittedBy": "philip.harvey@digital.homeoffice.gov.uk",
276
+ "submittingUsersName": "Phil",
277
+ "submissionTeam": "cf576f61-26cd-4862-92e1-2d5cfc050c2d",
278
+ "formInstanceId": "e1795627-b40e-4ac6-bfb2-5bf3f10ff126"
279
+ }
280
+ }
@@ -0,0 +1,127 @@
1
+ {
2
+ "id": "f603bb71-dcac-11ef-b426-66612ab527d2",
3
+ "businessKey": "DEV-20250127-981",
4
+ "jobHolderStaffDetails": {
5
+ "email": "philip.harvey@digital.homeoffice.gov.uk",
6
+ "linemanagerEmail": "saskia.thompson7@homeoffice.gov.uk",
7
+ "name": "Phil Harvey",
8
+ "linemanagerApprovalStatus": "expired"
9
+ },
10
+ "officerDefaultTeam": {
11
+ "id": "cf576f61-26cd-4862-92e1-2d5cfc050c2d",
12
+ "name": "Aberdeen Management Team",
13
+ "code": "ABERDEAI",
14
+ "description": null,
15
+ "costcentrecode": "ABERDEAI",
16
+ "parentteamid": "d8240301-bc30-4c58-9826-d88b85d598f5",
17
+ "regionalintel": false,
18
+ "bffunctiontypeid": "63d59d5c-e1d0-4f16-9607-7aa2613cc695",
19
+ "ministryid": "1",
20
+ "departmentid": "1",
21
+ "directorateid": "2",
22
+ "branchid": "22",
23
+ "divisionid": "11",
24
+ "commandid": "38",
25
+ "validfrom": "2019-01-01T00:01:00.000Z",
26
+ "validto": null,
27
+ "updatedby": null
28
+ },
29
+ "preMandecQuestionsActiveId": "d8dbe2d0-d5e3-4bac-8e88-cd09377310ff",
30
+ "preMandecQuestions": [
31
+ {
32
+ "id": "d8dbe2d0-d5e3-4bac-8e88-cd09377310ff",
33
+ "teamCheck": "true",
34
+ "lineManagerCheck": "true",
35
+ "confirmReadGuidance": [
36
+ "yes"
37
+ ]
38
+ }
39
+ ],
40
+ "formStatus": {
41
+ "tasks": {
42
+ "undefined": {},
43
+ "Check your team": {
44
+ "complete": true,
45
+ "currentPage": "beginDeclarations"
46
+ },
47
+ "Check your line manager": {
48
+ "complete": true,
49
+ "currentPage": "beginDeclarations"
50
+ },
51
+ "Sponsorship": {
52
+ "complete": true,
53
+ "currentPage": "sponsorship"
54
+ },
55
+ "Employment": {
56
+ "complete": true,
57
+ "currentPage": "employment"
58
+ },
59
+ "Criminality": {
60
+ "complete": true,
61
+ "currentPage": "fixedPenaltyNotice"
62
+ },
63
+ "Personal Finance": {
64
+ "complete": true,
65
+ "currentPage": "personalFinance"
66
+ },
67
+ "Business Interests": {
68
+ "complete": true,
69
+ "currentPage": "businessInterests"
70
+ },
71
+ "Accept and send": {
72
+ "complete": false,
73
+ "currentPage": "partialCya"
74
+ }
75
+ },
76
+ "taskPage": "partialCya"
77
+ },
78
+ "formInstanceId": "18ef4323-4296-4eee-94cf-9bb13cdcbb00",
79
+ "links": [
80
+ {
81
+ "method": "GET",
82
+ "href": "https://green.dev.cop.homeoffice.gov.uk/camunda/engine-rest/process-instance/f603bb71-dcac-11ef-b426-66612ab527d2",
83
+ "rel": "self"
84
+ }
85
+ ],
86
+ "definitionId": "c9e1b788-647c-11ef-9760-b6e9c97aae49",
87
+ "caseInstanceId": null,
88
+ "ended": false,
89
+ "suspended": false,
90
+ "tenantId": null,
91
+ "sponsorship": "false",
92
+ "employmentNow": "false",
93
+ "employmentFuture": "false",
94
+ "criminality": "true",
95
+ "criminalityUnspentConvictions": "false",
96
+ "addAnotherRadio": "false",
97
+ "criminalityArrested": "false",
98
+ "criminalityCaution": "false",
99
+ "summonsToCourt": "false",
100
+ "sanction": "false",
101
+ "fixedPenaltyNotice": "false",
102
+ "personalFinanceInsolvent": "false",
103
+ "personalFinanceIVA": "false",
104
+ "personalFinanceBankrupt": "false",
105
+ "businessInterestsPresent": "false",
106
+ "businessInterestsFuture": "false",
107
+ "postMandecQuestionsActiveId": "4da9e7a8-f1d5-46bc-a2bb-5fa4f6304d26",
108
+ "postMandecQuestions": [
109
+ {
110
+ "id": "4da9e7a8-f1d5-46bc-a2bb-5fa4f6304d26",
111
+ "sendToLineManagerConditional": "true",
112
+ "understandAndAgree": [
113
+ "true"
114
+ ]
115
+ }
116
+ ],
117
+ "form": {
118
+ "formVersionId": "7df080994ce1605b5a64635f2d6faa5f605db3e01",
119
+ "title": "Make your mandatory declarations",
120
+ "name": "cop-make-your-mandatory-declarations",
121
+ "submissionDate": "2025-01-27T12:52:02.414Z",
122
+ "submittedBy": "philip.harvey@digital.homeoffice.gov.uk",
123
+ "submittingUsersName": "Phil",
124
+ "submissionTeam": "cf576f61-26cd-4862-92e1-2d5cfc050c2d",
125
+ "formInstanceId": "18ef4323-4296-4eee-94cf-9bb13cdcbb00"
126
+ }
127
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "type": "Example form",
3
+ "alpha": "alpha-value",
4
+ "charlie": "charlie-value"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "alpha": "alpha-value",
3
+ "externalCondition1": "externalCondition1-value",
4
+ "externalCondition2": "externalCondition2-value"
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "bravo": "bravo-value",
3
+ "externalCondition1": "externalCondition1-value",
4
+ "externalCondition2": "externalCondition2-value",
5
+ "externalCondition3": "externalCondition3-value",
6
+ "makePageVisibleField": "makePageVisibleField-value"
7
+ }