From e068d5e566b77dc5a1a8f9084b36f9a5d087545f Mon Sep 17 00:00:00 2001 From: mchouliara Date: Thu, 5 Sep 2024 13:51:53 +0300 Subject: [PATCH] remove colorizeInvalid, fix table of content coloring on form error, validate form on click next --- ...description-template-editor.component.html | 6 +- .../description-template-editor.component.ts | 24 ++---- ...escription-template-table-of-contents.html | 1 - .../description-template-table-of-contents.ts | 1 - ...te-table-of-contents-internal-section.html | 21 ++--- ...late-table-of-contents-internal-section.ts | 80 ------------------- 6 files changed, 19 insertions(+), 114 deletions(-) diff --git a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html index 0871f4514..29c4b15e4 100644 --- a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html +++ b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html @@ -148,7 +148,6 @@ [links]="toCEntries" [itemSelected]="selectedTocEntry" [viewOnly]="viewOnly" - [colorizeInvalid]="colorizeInvalid" [showErrors]="showErrors" (dataNeedsRefresh)="onDataNeedsRefresh($event)" (itemClick)="displayItem($event)" @@ -188,7 +187,7 @@
- {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.ERROR-MESSAGES.FIELD-SELECT-AT-LEAST-ONE-REQUIRED' | translate}} + {{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.ERROR-MESSAGES.FIELD-SELECT-AT-LEAST-ONE-REQUIRED' | translate}} } @@ -268,7 +267,8 @@ chevron_left {{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.PREVIOUS' | translate}} - diff --git a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts index cd2cec5a1..da8871618 100644 --- a/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts +++ b/frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts @@ -70,7 +70,6 @@ export class DescriptionTemplateEditorComponent extends BaseEditor; toCEntries: ToCEntry[]; selectedTocEntry: ToCEntry; - colorizeInvalid: boolean = false; tocEntryEnumValues = ToCEntryType; usersMap: Map = new Map(); @@ -445,11 +444,11 @@ export class DescriptionTemplateEditorComponent extends BaseEditorthis.formGroup.get('definition').get('pages'))?.length; } - checkFormValidation(index: number) { - switch(index){ - case 0: { - this.colorizeInvalid = true; - break; - } - case 1: { - this.showErrors = true; - break; - } - } - } - get progressStyle() { const diff = 3; diff --git a/frontend/src/app/ui/admin/description-template/editor/table-of-contents/description-template-table-of-contents.html b/frontend/src/app/ui/admin/description-template/editor/table-of-contents/description-template-table-of-contents.html index d7d10f9f4..6eeee685c 100644 --- a/frontend/src/app/ui/admin/description-template/editor/table-of-contents/description-template-table-of-contents.html +++ b/frontend/src/app/ui/admin/description-template/editor/table-of-contents/description-template-table-of-contents.html @@ -16,7 +16,6 @@ [draggingItemId]="draggingItemId" [parentRootId]="ROOT_ID" style="padding-right: 1em;" - [colorizeInvalid]="colorizeInvalid" >
diff --git a/frontend/src/app/ui/admin/description-template/editor/table-of-contents/description-template-table-of-contents.ts b/frontend/src/app/ui/admin/description-template/editor/table-of-contents/description-template-table-of-contents.ts index 2d0bd9501..a9518ff90 100644 --- a/frontend/src/app/ui/admin/description-template/editor/table-of-contents/description-template-table-of-contents.ts +++ b/frontend/src/app/ui/admin/description-template/editor/table-of-contents/description-template-table-of-contents.ts @@ -19,7 +19,6 @@ export class DescriptionTemplateTableOfContents extends BaseComponent implements @Input() links: ToCEntry[]; @Input() itemSelected: ToCEntry; - @Input() colorizeInvalid: boolean = false; @Input() viewOnly: boolean; @Input() showErrors: boolean = false; diff --git a/frontend/src/app/ui/admin/description-template/editor/table-of-contents/table-of-contents-internal-section/description-template-table-of-contents-internal-section.html b/frontend/src/app/ui/admin/description-template/editor/table-of-contents/table-of-contents-internal-section/description-template-table-of-contents-internal-section.html index 0316eb2d0..eff87fe12 100644 --- a/frontend/src/app/ui/admin/description-template/editor/table-of-contents/table-of-contents-internal-section/description-template-table-of-contents-internal-section.html +++ b/frontend/src/app/ui/admin/description-template/editor/table-of-contents/table-of-contents-internal-section/description-template-table-of-contents-internal-section.html @@ -3,8 +3,10 @@ {{parentLink?.numbering}} {{parentLink?.form.get('title').value? parentLink?.form.get('title').value : 'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.UNTITLED' | translate}} @@ -57,7 +59,6 @@ [isDragging]="isDragging" [draggingItemId]="draggingItemId" [parentRootId]="parentRootId" - [colorizeInvalid]="colorizeInvalid" [showErrors]="showErrors" (itemClick)="itemClicked($event)" (removeEntry)="deleteEntry($event)" @@ -71,7 +72,7 @@ - - - @@ -171,7 +172,7 @@
-