description template editor, plan/description status editor > small fixes on forms
This commit is contained in:
parent
60b2e9cb90
commit
acbfd8f7cb
|
@ -101,7 +101,9 @@ export class DescriptionStatusEditorModel extends BaseEditorModel implements Des
|
|||
|
||||
export interface DescriptionStatusForm {
|
||||
id: FormControl<Guid>;
|
||||
hash: FormControl<string>;
|
||||
name: FormControl<string>;
|
||||
action: FormControl<string>;
|
||||
description: FormControl<string>;
|
||||
internalStatus: FormControl<DescriptionStatusEnum>;
|
||||
definition: FormGroup<DescriptionStatusDefinitionForm>;
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
</ng-container>
|
||||
|
||||
<div class="col-auto">
|
||||
<mat-checkbox [formControl]="this.form.get('includeInExport')" [disabled]="viewOnly">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD-SET.FIELDS.EXPORT' | translate}}</mat-checkbox>
|
||||
<mat-checkbox [formControl]="this.form.get('includeInExport')">{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD-SET.FIELDS.EXPORT' | translate}}</mat-checkbox>
|
||||
<mat-error *ngIf="form.get('includeInExport').hasError('backendError')">{{form.get('includeInExport').getError('backendError').message}}</mat-error>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ export class DescriptionTemplateEditorModel extends BaseEditorModel implements D
|
|||
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup<DescriptionTemplateForm> {
|
||||
if (context == null) { context = this.createValidationContext(); }
|
||||
|
||||
return this.formBuilder.group({
|
||||
const formGroup = this.formBuilder.group({
|
||||
id: [{ value: this.id, disabled }, context.getValidation('id').validators],
|
||||
label: [{ value: this.label, disabled }, context.getValidation('label').validators],
|
||||
code: [{ value: this.code, disabled: !!this.id ?? disabled }, context.getValidation('code').validators],
|
||||
|
@ -83,6 +83,10 @@ export class DescriptionTemplateEditorModel extends BaseEditorModel implements D
|
|||
),
|
||||
hash: [{ value: this.hash, disabled }, context.getValidation('hash').validators]
|
||||
});
|
||||
if(disabled){
|
||||
formGroup.disable();
|
||||
}
|
||||
return formGroup;
|
||||
}
|
||||
|
||||
createValidationContext(): ValidationContext {
|
||||
|
|
|
@ -104,6 +104,7 @@ export interface PlanStatusForm {
|
|||
id: FormControl<Guid>;
|
||||
hash: FormControl<string>;
|
||||
name: FormControl<string>;
|
||||
action: FormControl<string>;
|
||||
description: FormControl<string>;
|
||||
internalStatus: FormControl<PlanStatusEnum>;
|
||||
definition: FormGroup<PlanStatusDefinitionForm>;
|
||||
|
|
Loading…
Reference in New Issue