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);
|
const control = fields?.get(key);
|
||||||
DescriptionFieldEditorModel.reapplyValidators({
|
DescriptionFieldEditorModel.reapplyValidators({
|
||||||
formGroup: control as UntypedFormGroup,
|
formGroup: control as UntypedFormGroup,
|
||||||
rootPath: `${rootPath}fields.`,
|
rootPath: `${rootPath}fields[${key}].`,
|
||||||
validationErrorModel: validationErrorModel
|
validationErrorModel: validationErrorModel
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
@ -234,16 +234,17 @@ export class DmpPropertiesEditorModel implements DmpPropertiesPersist {
|
||||||
}): void {
|
}): void {
|
||||||
|
|
||||||
const { formGroup, rootPath, validationErrorModel } = params;
|
const { formGroup, rootPath, validationErrorModel } = params;
|
||||||
const context = DmpPropertiesEditorModel.createValidationContext({
|
|
||||||
rootPath,
|
|
||||||
validationErrorModel
|
|
||||||
});
|
|
||||||
|
|
||||||
['dmpBlueprintValues'].forEach(keyField => {
|
const dmpBlueprintValues = formGroup?.get('dmpBlueprintValues') as UntypedFormGroup;
|
||||||
const control = formGroup?.get(keyField);
|
const keys = Object.keys(dmpBlueprintValues.value as Object);
|
||||||
control?.clearValidators();
|
keys.forEach((key) => {
|
||||||
control?.addValidators(context.getValidation(keyField).validators);
|
const control = dmpBlueprintValues?.get(key);
|
||||||
});
|
DmpBlueprintValueEditorModel.reapplyValidators({
|
||||||
|
formGroup: control as UntypedFormGroup,
|
||||||
|
rootPath: `${rootPath}dmpBlueprintValues[${key}].`,
|
||||||
|
validationErrorModel: validationErrorModel
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
(formGroup.get('contacts') as FormArray).controls?.forEach(
|
(formGroup.get('contacts') as FormArray).controls?.forEach(
|
||||||
(control, index) => DmpContactEditorModel.reapplyValidators({
|
(control, index) => DmpContactEditorModel.reapplyValidators({
|
||||||
|
|
Loading…
Reference in New Issue