@hmcts/ccd-case-ui-toolkit 6.18.3-ConsoleLogs.1 → 6.18.3-hotfix-EUI-8738

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.
@@ -11082,6 +11082,10 @@
11082
11082
  _this.handleError(error);
11083
11083
  });
11084
11084
  CaseEditPageComponent.scrollToTop();
11085
+ // Remove all JudicialUser FormControls with the ID suffix "_judicialUserControl" because these are not
11086
+ // intended to be present in the Case Event data (they are added only for value selection and validation
11087
+ // purposes)
11088
+ this.removeAllJudicialUserFormControls(this.currentPage, this.editForm);
11085
11089
  }
11086
11090
  CaseEditPageComponent.setFocusToTop();
11087
11091
  };
@@ -11353,6 +11357,13 @@
11353
11357
  submit: this.caseEdit.submit,
11354
11358
  });
11355
11359
  };
11360
+ CaseEditPageComponent.prototype.removeAllJudicialUserFormControls = function (page, editForm) {
11361
+ page.case_fields.forEach(function (caseField) {
11362
+ if (FieldsUtils.isCaseFieldOfType(caseField, ['JudicialUser'])) {
11363
+ editForm.controls['data'].removeControl(caseField.id + "_judicialUserControl");
11364
+ }
11365
+ });
11366
+ };
11356
11367
  return CaseEditPageComponent;
11357
11368
  }());
11358
11369
  CaseEditPageComponent.RESUMED_FORM_DISCARD = 'RESUMED_FORM_DISCARD';