description templates validation small changes

This commit is contained in:
amentis 2024-02-07 10:15:06 +02:00
parent 5802c2149d
commit bc9691fa5d
3 changed files with 11 additions and 6 deletions

View File

@ -166,8 +166,9 @@
</mat-optgroup>
</mat-select>
<!-- <mat-error *ngIf="this.form.get('data').get('fieldType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> -->
<mat-error>{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<mat-error *ngIf="this.form.get('data').get('fieldType').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<mat-error *ngIf="form.get('data').get('fieldType').hasError('backendError')">{{form.get('data').get('fieldType').getError('backendError').message}}</mat-error>
<!-- <mat-error>{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> -->
<!-- <mat-error *ngIf="this.form.hasError('inputTypeNotValid')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> -->
</mat-form-field>

View File

@ -172,10 +172,10 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
this.formGroup = this.editorModel.buildForm(null, this.isDeleted || !this.authService.hasPermission(AppPermission.EditDescriptionTemplate));
//this.selectedSystemFields = this.selectedSystemFieldDisabled();
this.descriptionTemplateEditorService.setValidationErrorModel(this.editorModel.validationErrorModel);
DescriptionTemplateEditorModel.reApplyDefinitionValidators({
formGroup: this.formGroup,
validationErrorModel: this.editorModel.validationErrorModel
});
// DescriptionTemplateEditorModel.reApplyDefinitionValidators({
// formGroup: this.formGroup,
// validationErrorModel: this.editorModel.validationErrorModel
// });
if (this.editorModel.status == DescriptionTemplateStatus.Finalized || this.isDeleted) {
this.formGroup.disable();
}

View File

@ -872,18 +872,21 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF
rootPath: `${rootPath}data.`,
validationErrorModel: validationErrorModel
});
break;
case DescriptionTemplateFieldType.RADIO_BOX:
DescriptionTemplateRadioBoxDataEditorModel.reapplyRadioBoxValidators({
formGroup: formGroup?.get('data') as UntypedFormGroup,
rootPath: `${rootPath}data.`,
validationErrorModel: validationErrorModel
});
break;
case DescriptionTemplateFieldType.SELECT:
DescriptionTemplateSelectDataEditorModel.reapplySelectValidators({
formGroup: formGroup?.get('data') as UntypedFormGroup,
rootPath: `${rootPath}data.`,
validationErrorModel: validationErrorModel
});
break;
case DescriptionTemplateFieldType.EXTERNAL_SELECT:
DescriptionTemplateExternalSelectDataEditorModel.reapplyValidators({
formGroup: formGroup?.get('data') as UntypedFormGroup,
@ -896,6 +899,7 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF
rootPath: `${rootPath}data.`,
validationErrorModel: validationErrorModel
});
break;
}
}