From acbfd8f7cba874e36864c556d3dfe3a75eb78eeb Mon Sep 17 00:00:00 2001 From: mchouliara Date: Fri, 4 Oct 2024 17:02:10 +0300 Subject: [PATCH] description template editor, plan/description status editor > small fixes on forms --- .../description-status-editor.model.ts | 2 ++ .../field/description-template-editor-field.component.html | 2 +- .../editor/description-template-editor.model.ts | 6 +++++- .../editor/plan-status-editor/plan-status-editor.model.ts | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.model.ts b/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.model.ts index 20e476240..f420d9c91 100644 --- a/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.model.ts +++ b/frontend/src/app/ui/admin/description-status/editor/description-status-editor/description-status-editor.model.ts @@ -101,7 +101,9 @@ export class DescriptionStatusEditorModel extends BaseEditorModel implements Des export interface DescriptionStatusForm { id: FormControl; + hash: FormControl; name: FormControl; + action: FormControl; description: FormControl; internalStatus: FormControl; definition: FormGroup; diff --git a/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html b/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html index 930eb6a4b..9b7d36409 100644 --- a/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html +++ b/frontend/src/app/ui/admin/description-template/editor/components/field/description-template-editor-field.component.html @@ -130,7 +130,7 @@
- {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD-SET.FIELDS.EXPORT' | translate}} + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD-SET.FIELDS.EXPORT' | translate}} {{form.get('includeInExport').getError('backendError').message}}
diff --git a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts index 63c9da55c..ba96c586e 100644 --- a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts +++ b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts @@ -62,7 +62,7 @@ export class DescriptionTemplateEditorModel extends BaseEditorModel implements D buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { 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 { diff --git a/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.model.ts b/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.model.ts index 1b07af72b..ff28aed3d 100644 --- a/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.model.ts +++ b/frontend/src/app/ui/admin/plan-status/editor/plan-status-editor/plan-status-editor.model.ts @@ -104,6 +104,7 @@ export interface PlanStatusForm { id: FormControl; hash: FormControl; name: FormControl; + action: FormControl; description: FormControl; internalStatus: FormControl; definition: FormGroup;