@hmcts/ccd-case-ui-toolkit 7.3.53-ngrx-upgrade → 7.3.53-pofcc-10

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.
@@ -11487,7 +11487,7 @@ class CaseEditPageComponent {
11487
11487
  CaseEditPageComponent.setFocusToTop();
11488
11488
  }
11489
11489
  // Adding validation message to show it as Error Summary
11490
- generateErrorMessage(fields, container, path) {
11490
+ generateErrorMessage(fields, container, path, sourceFromComplexField) {
11491
11491
  const group = container || this.editForm.controls['data'];
11492
11492
  let validErrorFieldFound = false;
11493
11493
  let validationErrorAmount = this.validationErrors.length;
@@ -11504,7 +11504,7 @@ class CaseEditPageComponent {
11504
11504
  if (fieldElement) {
11505
11505
  const label = casefield.label || 'Field';
11506
11506
  let id = casefield.id;
11507
- if (fieldElement['component'] && fieldElement['component'].parent) {
11507
+ if (fieldElement['component'] && (fieldElement['component'].parent || sourceFromComplexField)) {
11508
11508
  if (fieldElement['component'].idPrefix.indexOf(`_${id}_`) === -1) {
11509
11509
  id = `${fieldElement['component'].idPrefix}${id}`;
11510
11510
  }
@@ -11516,7 +11516,7 @@ class CaseEditPageComponent {
11516
11516
  if (casefield.id === 'AddressLine1') {
11517
11517
  // EUI-1067 - Display more relevant error message to user and correctly navigate to the field
11518
11518
  this.addressService.setMandatoryError(true);
11519
- this.caseEditDataService.addFormValidationError({ id: `${path}_${path}`, message: `An address is required` });
11519
+ this.caseEditDataService.addFormValidationError({ id, message: `An address is required` });
11520
11520
  }
11521
11521
  else {
11522
11522
  this.caseEditDataService.addFormValidationError({ id, message: `%FIELDLABEL% is required`, label });
@@ -11542,7 +11542,7 @@ class CaseEditPageComponent {
11542
11542
  }
11543
11543
  else if (fieldElement.invalid) {
11544
11544
  if (casefield.isComplex()) {
11545
- errorPresent = this.generateErrorMessage(casefield.field_type.complex_fields, fieldElement, id);
11545
+ errorPresent = this.generateErrorMessage(casefield.field_type.complex_fields, fieldElement, id, true);
11546
11546
  }
11547
11547
  else if (casefield.isCollection() && casefield.field_type.collection_field_type.type === 'Complex') {
11548
11548
  const fieldArray = fieldElement;