description editor > table-of-content base-info > error indication bug fix

This commit is contained in:
Sofia Papacharalampous 2024-04-23 15:18:44 +03:00
parent 3c94f1eae0
commit 4935ec14f5
2 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@
<div class="stepper-title">{{'DESCRIPTION-EDITOR.TOC.TITLE' | translate}}</div> <div class="stepper-title">{{'DESCRIPTION-EDITOR.TOC.TITLE' | translate}}</div>
<div class="stepper-options" id="stepper-options"> <div class="stepper-options" id="stepper-options">
<div class="col stepper-list"> <div class="col stepper-list">
<div (click)="table0fContents.onToCentrySelected()" *ngIf="!descriptionInfoValid()" class="main-info" [ngClass]="{'active': this.step === 0, 'text-danger': countErrorsOfBaseInfoPage > 0}">{{'DESCRIPTION-EDITOR.TOC.MAIN-INFO' | translate}} ({{ countErrorsOfBaseInfoPage }})</div> <div (click)="table0fContents.onToCentrySelected()" *ngIf="!descriptionInfoValid()" class="main-info" [ngClass]="{'active': this.step === 0, 'text-danger': countErrorsOfBaseInfoPage > 0}">{{'DESCRIPTION-EDITOR.TOC.MAIN-INFO' | translate}} <span *ngIf="countErrorsOfBaseInfoPage > 0">({{ countErrorsOfBaseInfoPage }})</span></div>
<div (click)="table0fContents.onToCentrySelected()" *ngIf="descriptionInfoValid()" class="main-info" [ngClass]="{'active': this.step === 0}">{{'DESCRIPTION-EDITOR.TOC.MAIN-INFO' | translate}} (<mat-icon class="done-icon">done</mat-icon>)</div> <div (click)="table0fContents.onToCentrySelected()" *ngIf="descriptionInfoValid()" class="main-info" [ngClass]="{'active': this.step === 0}">{{'DESCRIPTION-EDITOR.TOC.MAIN-INFO' | translate}} (<mat-icon class="done-icon">done</mat-icon>)</div>
<div class="row toc-pane-container" #boundary> <div class="row toc-pane-container" #boundary>
<div #spacer></div> <div #spacer></div>

View File

@ -951,7 +951,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
} }
} }
} }
private scroll(entry: ToCEntry) { private scroll(entry: ToCEntry) {
document.getElementById(entry.id).scrollIntoView(); document.getElementById(entry.id).scrollIntoView();
} }
@ -980,7 +980,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
const baseInfoControlNames: string[] = [nameof<DescriptionEditorModel>(x => x.label), nameof<DescriptionEditorModel>(x => x.descriptionTemplateId)]; const baseInfoControlNames: string[] = [nameof<DescriptionEditorModel>(x => x.label), nameof<DescriptionEditorModel>(x => x.descriptionTemplateId)];
baseInfoControlNames.forEach((name: string) => { baseInfoControlNames.forEach((name: string) => {
if (!this.formGroup.get(name)?.valid) errorsCount += 1; if (this.formGroup.get(name)?.touched && !this.formGroup.get(name)?.valid) errorsCount += 1;
}); });
return errorsCount; return errorsCount;