@ukhomeoffice/cop-react-form-renderer 6.15.5 → 6.15.6

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.
@@ -0,0 +1,407 @@
1
+ {
2
+ "id": "09064153-0a33-11f0-b54d-da358d052ce4",
3
+ "businessKey": "DEV-20250326-890",
4
+ "port": {
5
+ "id": 3415,
6
+ "name": "Luton",
7
+ "sea": false,
8
+ "air": true,
9
+ "land": false,
10
+ "rail": false,
11
+ "countryid": 234,
12
+ "iata": "LTN",
13
+ "value": "3415",
14
+ "label": "Luton",
15
+ "hint": ""
16
+ },
17
+ "modeOfTransport": {
18
+ "id": 2,
19
+ "mode": "Scheduled Air Passenger",
20
+ "modecode": "airpass",
21
+ "crossingtype": [
22
+ "air"
23
+ ],
24
+ "value": "Scheduled Air Passenger",
25
+ "label": "Scheduled Air Passenger"
26
+ },
27
+ "formStatus": {
28
+ "tasks": {
29
+ "undefined": {},
30
+ "event-summary-airpassenger": {
31
+ "complete": true,
32
+ "currentPage": "event-summary-check-answers"
33
+ },
34
+ "people": {
35
+ "complete": true,
36
+ "currentPage": "people"
37
+ },
38
+ "item-seals-itemsOnAPerson": {
39
+ "complete": true,
40
+ "currentPage": "what-happens-next"
41
+ },
42
+ "journey-details-airpax": {
43
+ "complete": false,
44
+ "currentPage": "how-paid-for-flight"
45
+ }
46
+ },
47
+ "taskPage": "how-paid-for-flight"
48
+ },
49
+ "whatHappened": "itemsOnAPerson",
50
+ "formInstanceId": "691fabd3-1d6d-4e57-8eb6-7181fed25bf1",
51
+ "links": [
52
+ {
53
+ "method": "GET",
54
+ "href": "https://www.dev.cop.homeoffice.gov.uk/camunda/engine-rest/process-instance/09064153-0a33-11f0-b54d-da358d052ce4",
55
+ "rel": "self"
56
+ }
57
+ ],
58
+ "definitionId": "cop-addABorderEvent:9:2b437400-bd57-11ef-94a0-ce371e0b1bc5",
59
+ "caseInstanceId": null,
60
+ "ended": false,
61
+ "suspended": false,
62
+ "tenantId": null,
63
+ "eventDateTime": {
64
+ "eventDate": "26-03-2023",
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
+ "whoDecidedSelection": "borderForceOfficer",
98
+ "whyWasPassengerStoppedArray": [
99
+ {
100
+ "id": "b3093dc6-eac7-4cf3-b9d9-6794d1d82f2a",
101
+ "reason": {
102
+ "label": "Baggage - abandoned baggage",
103
+ "value": "baggageAbandoned",
104
+ "synonyms": [
105
+ "luggage",
106
+ "left",
107
+ "leave",
108
+ "without"
109
+ ],
110
+ "hint": ""
111
+ }
112
+ }
113
+ ],
114
+ "form": {
115
+ "formVersionId": "1ffd96b40fcdfb4b8679ee761525fde0e4dc0a44-1",
116
+ "title": "Add a border event",
117
+ "name": "cop-addABorderEvent",
118
+ "submissionDate": "2025-03-26T11:17:55.770Z",
119
+ "submittedBy": "philip.harvey@digital.homeoffice.gov.uk",
120
+ "submittingUsersName": "Phil",
121
+ "draftForm": true,
122
+ "submissionStartDate": "2025-03-26T11:12:48.744Z",
123
+ "formInstanceId": "691fabd3-1d6d-4e57-8eb6-7181fed25bf1",
124
+ "submissionTeam": "cf576f61-26cd-4862-92e1-2d5cfc050c2d"
125
+ },
126
+ "peopleActiveId": "6a09d0b3-2f60-4029-80ec-e0249abf4c48",
127
+ "people": [
128
+ {
129
+ "id": "6a09d0b3-2f60-4029-80ec-e0249abf4c48",
130
+ "hasIdentityDocuments": [
131
+ "no"
132
+ ],
133
+ "claimedGivenNames": "Phillip",
134
+ "claimedSurname": "Harvey",
135
+ "estimatedDob": "12-12-1970",
136
+ "claimedCountryOfBirth": {
137
+ "id": 13,
138
+ "name": "Aruba",
139
+ "iso31661alpha3": "ABW",
140
+ "value": "13",
141
+ "label": "Aruba",
142
+ "hint": ""
143
+ },
144
+ "howDidYouVerifyTheirIdentity": "asd asd asd asd asd",
145
+ "noAddresses": "Person has no addresses",
146
+ "noAddressDetails": [
147
+ "none"
148
+ ],
149
+ "travellingRole": {
150
+ "id": 2,
151
+ "roletype": "Crew",
152
+ "value": "2",
153
+ "label": "Crew",
154
+ "hint": ""
155
+ },
156
+ "arrested": "yes",
157
+ "governmentOrBorderForceEmployee": "no",
158
+ "personSearched": "no"
159
+ }
160
+ ],
161
+ "itemsActiveId": "645db8c1-25a4-436f-a711-dbdb6e839525",
162
+ "items": [
163
+ {
164
+ "id": "645db8c1-25a4-436f-a711-dbdb6e839525",
165
+ "itemHolders": [
166
+ {
167
+ "label": "Phillip Harvey (12 Dec 1970)",
168
+ "value": "Phillip Harvey",
169
+ "id": "6a09d0b3-2f60-4029-80ec-e0249abf4c48"
170
+ }
171
+ ],
172
+ "sealNumber": "E123567",
173
+ "itemCategory": {
174
+ "id": 6,
175
+ "category": "Alcohol",
176
+ "description": "Beers, Wines, Spirits etc.",
177
+ "validfrom": "2023-01-10T00:00:01.000Z",
178
+ "validto": null,
179
+ "updatedby": "Mohammed Abdul Odud",
180
+ "synonyms": [
181
+ "'Beer'",
182
+ "'Wines'",
183
+ "'Spirits'"
184
+ ],
185
+ "value": "6",
186
+ "label": "Alcohol",
187
+ "hint": ""
188
+ },
189
+ "itemSubCategory": {
190
+ "id": 1795,
191
+ "name": "Alcohol distiller",
192
+ "description": null,
193
+ "itemcategoriesid": 6,
194
+ "cites": false,
195
+ "poao": false,
196
+ "cbrn": false,
197
+ "document": false,
198
+ "tobacco": false,
199
+ "alcohol": true,
200
+ "weapons": false,
201
+ "firearms": false,
202
+ "ipr": true,
203
+ "strategic": false,
204
+ "avtc": false,
205
+ "oils": false,
206
+ "commodity": false,
207
+ "good": true,
208
+ "plant": false,
209
+ "animal": false,
210
+ "drugs": false,
211
+ "financial": false,
212
+ "indecent": false,
213
+ "vehicle": false,
214
+ "medical": false,
215
+ "unitid": 5,
216
+ "seizureqty": null,
217
+ "ienqty": null,
218
+ "validfrom": "2023-01-10T00:00:01.000Z",
219
+ "validto": null,
220
+ "updatedby": "Mohammed Abdul Odud",
221
+ "uof": false,
222
+ "epmscode": 1037,
223
+ "epmscategory": "ALP",
224
+ "unitarray": [
225
+ 5
226
+ ],
227
+ "categoryarray": [
228
+ 6,
229
+ 9,
230
+ 14
231
+ ],
232
+ "lethalfirearm": null,
233
+ "nonlethalfirearm": null,
234
+ "value": "1795",
235
+ "label": "Alcohol distiller",
236
+ "hint": ""
237
+ },
238
+ "seizedOrDetained": "seized",
239
+ "legalReasonForSeizing": {
240
+ "id": 2,
241
+ "epmsvalue": 21,
242
+ "reason": "CITES",
243
+ "description": "Convention on International Trade in Endangered Species",
244
+ "validfrom": "2022-09-21T00:00:01.000Z",
245
+ "validto": null,
246
+ "updatedby": "Mohammed Abdul Odud",
247
+ "value": "2",
248
+ "label": "Convention on International Trade in Endangered Species",
249
+ "hint": ""
250
+ },
251
+ "detectionTechnologies": [
252
+ {
253
+ "id": "8d29a2b5-df74-4024-b5ff-a860b01f90d6",
254
+ "detectionTechnology": {
255
+ "id": 5,
256
+ "name": "Automatic number plate recognition (ANPR)",
257
+ "value": "5",
258
+ "label": "Automatic number plate recognition (ANPR)",
259
+ "hint": ""
260
+ }
261
+ }
262
+ ],
263
+ "searchTechniques": [
264
+ {
265
+ "id": "8d29a2b5-df74-4024-b5ff-a860b01f90d6",
266
+ "searchTechnique": {
267
+ "id": 27,
268
+ "type": "Baggage",
269
+ "value": "27",
270
+ "label": "Baggage",
271
+ "hint": ""
272
+ }
273
+ }
274
+ ],
275
+ "concealmentMethods": [
276
+ {
277
+ "id": "4399dbaf-f77c-40da-821a-1f7e382b5eb4",
278
+ "concealmentMethod": {
279
+ "id": 24,
280
+ "method": "Air filter",
281
+ "value": "24",
282
+ "label": "Air filter",
283
+ "hint": ""
284
+ }
285
+ }
286
+ ],
287
+ "specialStorageConditions": {
288
+ "epmsvalue": 4,
289
+ "description": "Drum",
290
+ "id": 4,
291
+ "value": "4",
292
+ "label": "Drum",
293
+ "hint": ""
294
+ },
295
+ "brandText": "asd",
296
+ "unitOfMeasure": {
297
+ "id": 13,
298
+ "unit": "Number of items",
299
+ "validfrom": "2023-02-21T00:00:01.000Z",
300
+ "validto": null,
301
+ "updatedby": "Mohammed Abdul Odud",
302
+ "code": 5,
303
+ "epmsid": 9,
304
+ "decimal": false,
305
+ "shortname": null,
306
+ "value": "13",
307
+ "label": "Number of items"
308
+ },
309
+ "quantity": "1",
310
+ "itemDescription": "asd asd asd asd sa",
311
+ "willTheItemBeStored": "no",
312
+ "whatIsTheInitialMovement?": {
313
+ "id": 2,
314
+ "epmscode": 4,
315
+ "description": "Retained by case officer",
316
+ "inuse": true,
317
+ "validfrom": "2022-08-18T00:00:01.000Z",
318
+ "validto": null,
319
+ "updatedby": "Mohammed Abdul Odud",
320
+ "value": "2",
321
+ "label": "Retained by case officer",
322
+ "hint": ""
323
+ },
324
+ "shouldThisItemBeDestroyed": "no",
325
+ "giveAReason": "asd asd asd asd",
326
+ "specialHandlingInstructions": "no",
327
+ "hasAnotherAgencyAdoptedTheItem": "no",
328
+ "constructedOrAdapted": "no",
329
+ "doYouHavePhotosOfTheItemToAdd": "no"
330
+ }
331
+ ],
332
+ "lockup": {
333
+ "value": "LTN",
334
+ "label": "Luton Airport Lockup",
335
+ "hidden": true
336
+ },
337
+ "meta": {},
338
+ "epmsSubmitted": true,
339
+ "doYouHaveTheirFlightNumber": "yes",
340
+ "flights": [
341
+ {
342
+ "id": "676ce6f7-41f5-44e5-9d03-4841075f5839",
343
+ "flightDepartureDateTime": {
344
+ "flightDepartureDate": "26-12-2024",
345
+ "flightDepartureTime": "12:12"
346
+ },
347
+ "flightArrivalDateTimeNonUKDeparture": {
348
+ "flightArrivalDate": "26-12-2024",
349
+ "flightArrivalTime": "12:12"
350
+ },
351
+ "countryOfArrival": {
352
+ "iso31661alpha3": "GBR",
353
+ "name": "United Kingdom of Great Britain and Northern Ireland",
354
+ "id": 234
355
+ },
356
+ "arrivalPort": {
357
+ "rail": "port.rail",
358
+ "name": "Luton",
359
+ "land": "port.land",
360
+ "id": 3415,
361
+ "air": true,
362
+ "label": "Luton",
363
+ "value": "3415",
364
+ "sea": "port.sea",
365
+ "countryid": 234
366
+ },
367
+ "flightNumber": "BA12345",
368
+ "carrierOrOperator": {
369
+ "id": 35,
370
+ "name": "British Airways",
371
+ "twolettercode": "BA",
372
+ "threelettercode": "BAW",
373
+ "designator": 125,
374
+ "alliance": "Oneworld",
375
+ "aviation": true,
376
+ "sea": false,
377
+ "land": false,
378
+ "rail": false,
379
+ "parcel": false,
380
+ "validfrom": "2019-01-01T00:00:00.000Z",
381
+ "validto": null,
382
+ "updatedby": null,
383
+ "cruise": false,
384
+ "value": "35",
385
+ "label": "British Airways",
386
+ "hint": ""
387
+ },
388
+ "countryOfDeparture": {
389
+ "id": 13,
390
+ "name": "Aruba",
391
+ "iso31661alpha3": "ABW",
392
+ "value": "13",
393
+ "label": "Aruba",
394
+ "hint": ""
395
+ },
396
+ "departurePort": {
397
+ "id": 15637,
398
+ "name": "Aruba",
399
+ "iata": null,
400
+ "value": "15637",
401
+ "label": "Aruba",
402
+ "hint": ""
403
+ }
404
+ }
405
+ ],
406
+ "flightsActiveId": "676ce6f7-41f5-44e5-9d03-4841075f5839"
407
+ }
@@ -92,6 +92,7 @@ var _copAirpaxRemovePhotosBefore = _interopRequireDefault(require("../clear-unco
92
92
  var _copAirpaxRemovePhotosAfter = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/cop-airpax-remove-photos-after.json"));
93
93
  var _copAirpaxChangeWhatHappenedBefore = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/cop-airpax-change-what-happened-before.json"));
94
94
  var _copAirpaxChangeWhatHappenedAfter = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/output/cop-airpax-change-what-happened-after.json"));
95
+ var _copAirpaxCarrier = _interopRequireDefault(require("../clear-uncompleted-routes/test-data/input/cop-airpax-carrier.json"));
95
96
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
96
97
  // Hidden component
97
98
 
@@ -155,6 +156,10 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
155
156
 
156
157
  // Airpax photos
157
158
 
159
+ // Who decided
160
+
161
+ // Carrier not removed
162
+
158
163
  describe('FormRenderer', () => {
159
164
  describe('helpers', () => {
160
165
  describe('clearOutUncompletedRoutes', () => {
@@ -348,6 +353,12 @@ describe('FormRenderer', () => {
348
353
  const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
349
354
  expect(result).toEqual(_copAirpaxRemovePhotosAfter.default);
350
355
  });
356
+ it('carrier not removed from airpax.', () => {
357
+ const submissionData = JSON.parse(JSON.stringify(_copAirpaxCarrier.default));
358
+ const form = JSON.parse(JSON.stringify(_formCopAirpax.default));
359
+ const result = _index.default.clearOutUncompletedRoutes(form, submissionData);
360
+ expect(result).toEqual(_copAirpaxCarrier.default);
361
+ });
351
362
  it('airpax change whatHappened to hide whoDecidedSelection.', () => {
352
363
  const submissionData = JSON.parse(JSON.stringify(_copAirpaxChangeWhatHappenedBefore.default));
353
364
  const form = JSON.parse(JSON.stringify(_formCopAirpax.default));
@@ -243,11 +243,13 @@ exports.isShowEntity = isShowEntity;
243
243
  const findComponentDefinitionInForm = (pageComponentDef, componentByIdMap, componentByFieldIdMap) => {
244
244
  var _ref, _componentByIdMap$get;
245
245
  const componentInForm = (_ref = (_componentByIdMap$get = componentByIdMap.get(pageComponentDef.use)) !== null && _componentByIdMap$get !== void 0 ? _componentByIdMap$get : componentByFieldIdMap.get(pageComponentDef.use)) !== null && _ref !== void 0 ? _ref : pageComponentDef;
246
+
247
+ // Create clone of component, so processing can make changes to it without changing the form
248
+ let componentInFormClone = JSON.parse(JSON.stringify(componentInForm));
246
249
  if (pageComponentDef.use && pageComponentDef.show_when) {
247
- componentInForm.show_when = pageComponentDef.show_when;
250
+ componentInFormClone.show_when = pageComponentDef.show_when;
248
251
  }
249
- // Retun clone of component, so subsequent processing can make changes to it without changing the form
250
- return JSON.parse(JSON.stringify(componentInForm));
252
+ return componentInFormClone;
251
253
  };
252
254
 
253
255
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "6.15.5",
3
+ "version": "6.15.6",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",