@ukhomeoffice/cop-react-form-renderer 4.22.2 → 4.22.3

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.
@@ -240,7 +240,7 @@ describe('utils.Validate.Component', function () {
240
240
  }
241
241
  };
242
242
  expect((0, _validateComponent.default)(COMPONENT, undefined, FORMDATA)).toEqual([{
243
- id: "undefined.nestedId",
243
+ id: "nestedId",
244
244
  error: "Field is required"
245
245
  }]);
246
246
  });
@@ -44,7 +44,10 @@ var validateContainer = function validateContainer(container, outerData, formDat
44
44
  if (Array.isArray(container.components)) {
45
45
  var containerData = outerData && container.fieldId ? outerData[container.fieldId] : outerData;
46
46
  container.components.forEach(function (component) {
47
- var full_path = "".concat(container.full_path || container.fieldId, ".").concat(component.fieldId);
47
+ // It is possible that the container being passed in is a
48
+ // dummy container just for validation. In that scenario we want
49
+ // to ignore the full_path and just use the component's fieldId.
50
+ var full_path = container.full_path || container.fieldId ? "".concat(container.full_path || container.fieldId, ".").concat(component.fieldId) : component.fieldId;
48
51
  errors.push((0, _validateComponent.default)(_objectSpread(_objectSpread({}, component), {}, {
49
52
  full_path: full_path
50
53
  }), containerData, fd));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "4.22.2",
3
+ "version": "4.22.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",