@hmcts/ccd-case-ui-toolkit 7.3.53-pofcc-10 → 7.3.53-pofcc-78
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) {
|
|
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'] &&
|
|
11507
|
+
if (fieldElement['component'] && fieldElement['component'].parent) {
|
|
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
|
|
11519
|
+
this.caseEditDataService.addFormValidationError({ id: `${path}_${path}`, 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);
|
|
11546
11546
|
}
|
|
11547
11547
|
else if (casefield.isCollection() && casefield.field_type.collection_field_type.type === 'Complex') {
|
|
11548
11548
|
const fieldArray = fieldElement;
|
|
@@ -15306,9 +15306,20 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
|
|
|
15306
15306
|
}
|
|
15307
15307
|
}
|
|
15308
15308
|
focusLastItem() {
|
|
15309
|
-
const
|
|
15310
|
-
if (
|
|
15311
|
-
|
|
15309
|
+
const root = this.items.last?.nativeElement;
|
|
15310
|
+
if (!root) {
|
|
15311
|
+
return;
|
|
15312
|
+
}
|
|
15313
|
+
const controls = Array.from(root.querySelectorAll('.form-control'));
|
|
15314
|
+
const focusTarget = controls.find(control => {
|
|
15315
|
+
if (!(control instanceof HTMLInputElement)) {
|
|
15316
|
+
return true;
|
|
15317
|
+
}
|
|
15318
|
+
const type = (control.type || '').toLowerCase();
|
|
15319
|
+
return type !== 'radio';
|
|
15320
|
+
});
|
|
15321
|
+
if (focusTarget) {
|
|
15322
|
+
focusTarget.focus();
|
|
15312
15323
|
}
|
|
15313
15324
|
}
|
|
15314
15325
|
removeItem(index) {
|