@hmcts/ccd-case-ui-toolkit 6.19.16-rc1 → 6.19.16-rc2

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.
@@ -6409,7 +6409,7 @@
6409
6409
  if (!FormValueService.isLabel(field) && FormValueService.isReadOnly(field)) {
6410
6410
  return "continue";
6411
6411
  }
6412
- if (field.hidden === true && field.display_context !== 'HIDDEN' && field.id !== 'caseLinks' && !field.retain_hidden_value) {
6412
+ if (field.hidden === true && field.display_context !== 'HIDDEN' && field.display_context !== 'HIDDEN_TEMP' && field.id !== 'caseLinks' && !field.retain_hidden_value) {
6413
6413
  // Delete anything that is hidden (that is NOT readonly), and that
6414
6414
  // hasn't had its display_context overridden to make it hidden.
6415
6415
  delete data[field.id];
@@ -8642,7 +8642,7 @@
8642
8642
  var caseFieldLeaf;
8643
8643
  var children = this.getCaseFieldChildren(caseField);
8644
8644
  if (children.length > 0) {
8645
- var _b = __read(caseFieldIds), _ = _b[0], tail = _b.slice(1);
8645
+ var _a = __read(caseFieldIds), _ = _a[0], tail = _a.slice(1);
8646
8646
  caseFieldLeaf = this.getCaseFieldLeaf(tail, children);
8647
8647
  }
8648
8648
  else {
@@ -8680,7 +8680,7 @@
8680
8680
  return pathPrefix.length === 0 ? caseField : pathPrefix + "." + caseField;
8681
8681
  };
8682
8682
  WizardPageFieldToCaseFieldMapper.prototype.getCaseFieldLeaf = function (caseFieldId, caseFields) {
8683
- var _b = __read(caseFieldId), head = _b[0], tail = _b.slice(1);
8683
+ var _a = __read(caseFieldId), head = _a[0], tail = _a.slice(1);
8684
8684
  if (caseFieldId.length === 1) {
8685
8685
  var caseLeaf = caseFields.find(function (e) { return e.id === head; });
8686
8686
  if (!caseLeaf) {
@@ -8702,15 +8702,12 @@
8702
8702
  };
8703
8703
  WizardPageFieldToCaseFieldMapper.prototype.hideParentIfAllChildrenHidden = function (caseField) {
8704
8704
  var _this = this;
8705
- var _a;
8706
8705
  var childrenCaseFields = this.getCaseFieldChildren(caseField);
8707
8706
  childrenCaseFields.forEach(function (e) { return _this.hideParentIfAllChildrenHidden(e); });
8708
- // filter out judicialuser field to avoid issue with the field to be hide/unhide based on the selection
8709
8707
  if (childrenCaseFields.length > 0 && this.allCaseFieldsHidden(childrenCaseFields)) {
8710
8708
  caseField.hidden = true;
8711
- if (caseField.field_type.id !== 'JudicialUser' && ((_a = caseField.field_type.collection_field_type) === null || _a === void 0 ? void 0 : _a.id) !== 'JudicialUser') {
8712
- caseField.display_context = 'HIDDEN';
8713
- }
8709
+ // marking display_context as special hidden so field not being deleted in event submission
8710
+ caseField.display_context = 'HIDDEN_TEMP';
8714
8711
  }
8715
8712
  };
8716
8713
  WizardPageFieldToCaseFieldMapper.prototype.getCaseFieldChildren = function (caseField) {
@@ -8724,7 +8721,7 @@
8724
8721
  return childrenCaseFields;
8725
8722
  };
8726
8723
  WizardPageFieldToCaseFieldMapper.prototype.allCaseFieldsHidden = function (children) {
8727
- return children.every(function (e) { return e.display_context === 'HIDDEN'; });
8724
+ return children.every(function (e) { return e.display_context === 'HIDDEN' || e.display_context === 'HIDDEN_TEMP'; });
8728
8725
  };
8729
8726
  return WizardPageFieldToCaseFieldMapper;
8730
8727
  }());
@@ -14174,7 +14171,10 @@
14174
14171
  .filter(function (f) { return keepEmpty || FieldsFilterPipe.keepField(f); })
14175
14172
  .map(function (f) {
14176
14173
  if (!f.display_context) {
14177
- f.display_context = complexField.display_context;
14174
+ if (complexField.display_context === 'MANDATORY' || complexField.display_context === 'READONLY'
14175
+ || complexField.display_context === 'OPTIONAL' || complexField.display_context === 'HIDDEN') {
14176
+ f.display_context = complexField.display_context;
14177
+ }
14178
14178
  }
14179
14179
  return f;
14180
14180
  });
@@ -26591,7 +26591,10 @@
26591
26591
  })
26592
26592
  .map(function (f) {
26593
26593
  if (!f.display_context) {
26594
- f.display_context = complexField.display_context;
26594
+ if (complexField.display_context === 'MANDATORY' || complexField.display_context === 'READONLY'
26595
+ || complexField.display_context === 'OPTIONAL' || complexField.display_context === 'HIDDEN') {
26596
+ f.display_context = complexField.display_context;
26597
+ }
26595
26598
  }
26596
26599
  if (setupHidden) {
26597
26600
  ReadFieldsFilterPipe.evaluateConditionalShow(f, checkConditionalShowAgainst, path, formGroupAvailable, complexField.id);