small reapply validator fix
This commit is contained in:
parent
1a6e776b41
commit
075573ffaf
|
@ -389,7 +389,7 @@ export class DescriptionPropertyDefinitionFieldSetItemEditorModel implements Des
|
|||
const control = fields?.get(key);
|
||||
DescriptionFieldEditorModel.reapplyValidators({
|
||||
formGroup: control as UntypedFormGroup,
|
||||
rootPath: `${rootPath}fields.`,
|
||||
rootPath: `${rootPath}fields[${key}].`,
|
||||
validationErrorModel: validationErrorModel
|
||||
})
|
||||
});
|
||||
|
|
|
@ -234,15 +234,16 @@ export class DmpPropertiesEditorModel implements DmpPropertiesPersist {
|
|||
}): void {
|
||||
|
||||
const { formGroup, rootPath, validationErrorModel } = params;
|
||||
const context = DmpPropertiesEditorModel.createValidationContext({
|
||||
rootPath,
|
||||
validationErrorModel
|
||||
});
|
||||
|
||||
['dmpBlueprintValues'].forEach(keyField => {
|
||||
const control = formGroup?.get(keyField);
|
||||
control?.clearValidators();
|
||||
control?.addValidators(context.getValidation(keyField).validators);
|
||||
const dmpBlueprintValues = formGroup?.get('dmpBlueprintValues') as UntypedFormGroup;
|
||||
const keys = Object.keys(dmpBlueprintValues.value as Object);
|
||||
keys.forEach((key) => {
|
||||
const control = dmpBlueprintValues?.get(key);
|
||||
DmpBlueprintValueEditorModel.reapplyValidators({
|
||||
formGroup: control as UntypedFormGroup,
|
||||
rootPath: `${rootPath}dmpBlueprintValues[${key}].`,
|
||||
validationErrorModel: validationErrorModel
|
||||
})
|
||||
});
|
||||
|
||||
(formGroup.get('contacts') as FormArray).controls?.forEach(
|
||||
|
|
Loading…
Reference in New Issue