@ukhomeoffice/cop-react-form-renderer 2.7.3 → 2.7.4

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.
@@ -638,7 +638,7 @@ describe('components', function () {
638
638
  _react.fireEvent.click(cyaPage.childNodes[5].childNodes[0], {}); //Should be back at task list
639
639
 
640
640
 
641
- expect(container.childNodes[0].childNodes[0].textContent).toEqual('Event at the border'); //Check status's are correct
641
+ expect(container.childNodes[0].childNodes[0].textContent).toEqual('Task List Form'); //Check status's are correct
642
642
 
643
643
  firstTaskStatus = container.childNodes[0].childNodes[1].childNodes[5].childNodes[0].childNodes[1];
644
644
  expect(firstTaskStatus.textContent).toEqual(_models.TaskStates.DETAILS[_models.TaskStates.TYPES.COMPLETE].label);
@@ -32,6 +32,7 @@ var ActionButton = function ActionButton(_ref) {
32
32
  attrs = _objectWithoutProperties(_ref, _excluded);
33
33
 
34
34
  var action = typeof _action === 'string' ? _models.PageAction.DEFAULTS[_action] : _action;
35
+ var actionLabel = _models.PageAction.DEFAULTS[_action.type];
35
36
 
36
37
  if (!action) {
37
38
  return null;
@@ -44,7 +45,7 @@ var ActionButton = function ActionButton(_ref) {
44
45
  onClick: function onClick() {
45
46
  return onAction(action);
46
47
  }
47
- }), action.label || DEFAULT_LABEL);
48
+ }), action.label || (actionLabel === null || actionLabel === void 0 ? void 0 : actionLabel.label) || DEFAULT_LABEL);
48
49
  };
49
50
 
50
51
  ActionButton.propTypes = {
@@ -1,8 +1,8 @@
1
1
  {
2
- "id": "eventAtTheBorder",
2
+ "id": "cop-taskListForm",
3
3
  "version": "1",
4
- "name": "Event at the border",
5
- "title": "Event at the border",
4
+ "name": "cop-taskListForm",
5
+ "title": "Task List Form",
6
6
  "type": "task-list",
7
7
  "components": [
8
8
  {
@@ -57,6 +57,13 @@
57
57
  ]
58
58
  },
59
59
  "required": true
60
+ },
61
+ {
62
+ "id": "journeyDetails",
63
+ "fieldId": "journeyDetails",
64
+ "label": "Input the details of the journey",
65
+ "type": "textarea",
66
+ "required": true
60
67
  }
61
68
  ],
62
69
  "pages": [
@@ -72,8 +79,7 @@
72
79
  "actions": [
73
80
  {
74
81
  "type": "saveAndNavigate",
75
- "page": "eventMode",
76
- "label": "Save and continue"
82
+ "page": "eventMode"
77
83
  },
78
84
  "saveAndReturn"
79
85
  ],
@@ -186,6 +192,26 @@
186
192
  "page": "surname",
187
193
  "aria_suffix": "Surname"
188
194
  }
195
+ },
196
+ {
197
+ "id": "journeyDetails",
198
+ "name": "journeyDetails",
199
+ "title": "Journey Details",
200
+ "components": [
201
+ {
202
+ "use": "journeyDetails"
203
+ }
204
+ ],
205
+ "actions": [
206
+ {
207
+ "type": "saveAndNavigate",
208
+ "page": "cya"
209
+ }
210
+ ],
211
+ "cya_link": {
212
+ "page": "journeyDetails",
213
+ "aria_suffix": "Journey Details"
214
+ }
189
215
  }
190
216
  ],
191
217
  "hub": {
@@ -217,12 +243,13 @@
217
243
  },
218
244
  {
219
245
  "name": "Immigration details",
246
+ "firstPage": "immigrationDate",
220
247
  "pages": ["immigrationDate"],
221
248
  "state": "inProgress"
222
249
  },
223
250
  {
224
251
  "name": "Journey details",
225
- "pages": ["none"],
252
+ "pages": ["journeyDetails"],
226
253
  "state": "cannotStartYet"
227
254
  }
228
255
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "2.7.3",
3
+ "version": "2.7.4",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",