issue 29 > description editor Fix validity check for finalized desc form, TOC ui fixes

This commit is contained in:
mchouliara 2024-09-27 13:37:02 +03:00
parent feb65468b8
commit b1c1a39ed3
4 changed files with 15 additions and 8 deletions

View File

@ -206,7 +206,8 @@
} }
.stepper-options { .stepper-options {
height: calc(100vh - 650px); flex: 1;
max-height: calc(100vh - 32rem);
overflow-y: auto; overflow-y: auto;
.main-info { .main-info {
color: #21212194; color: #21212194;
@ -235,7 +236,7 @@
letter-spacing: 0px; letter-spacing: 0px;
color: #212121; color: #212121;
opacity: 0.6; opacity: 0.6;
margin: 2.875rem 0rem 2.25rem 0rem; margin: 2rem 0rem 1rem 0rem;
padding-left: 1rem; padding-left: 1rem;
} }

View File

@ -308,7 +308,10 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
complete => { complete => {
onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete); onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete);
this.descriptionIsOnceSaved = true; this.descriptionIsOnceSaved = true;
if (this.formGroup.get('status').value == DescriptionStatusEnum.Finalized) this.isFinalized = true; if (this.formGroup.get('status').value == DescriptionStatusEnum.Finalized){
this.isFinalized = true;
this.formGroup.disable();
}
}, },
error => { error => {
if (this.formGroup.get('status').value == DescriptionStatusEnum.Finalized) { if (this.formGroup.get('status').value == DescriptionStatusEnum.Finalized) {

View File

@ -88,13 +88,16 @@ export class TableOfContentsInternal extends BaseComponent implements OnInit, On
isTocEntryValid(entry: ToCEntry): boolean { isTocEntryValid(entry: ToCEntry): boolean {
if (entry == null) return true; if (entry == null) return true;
if (entry.validityAbstractControl && !entry.validityAbstractControl.touched) return true; if (entry.validityAbstractControl && (!entry.validityAbstractControl.touched || entry.validityAbstractControl.disabled)){
return true;
}
let currentValidity = entry.validityAbstractControl?.valid ?? true; let currentValidity = entry.validityAbstractControl?.valid ?? true;
if (!currentValidity) return currentValidity; if (!currentValidity) return currentValidity;
entry.subEntries?.forEach(subEntry => { entry.subEntries?.forEach(subEntry => {
currentValidity = currentValidity && this.isTocEntryValid(subEntry); currentValidity = currentValidity && this.isTocEntryValid(subEntry);
if (!currentValidity) return currentValidity; if (!currentValidity){
return currentValidity;
}
}); });
return currentValidity; return currentValidity;

View File

@ -135,7 +135,7 @@
<div class="row stepper-options"> <div class="row stepper-options">
<div class="col-auto"> <div class="col-auto">
<ol class="stepper-list" start="1"> <ol class="stepper-list" start="1">
<div *ngIf="selectedBlueprint?.definition && this.step !== 0"> @if(selectedBlueprint?.definition && this.step !== 0){
<ng-container *ngFor="let section of selectedBlueprint?.definition?.sections; let i=index"> <ng-container *ngFor="let section of selectedBlueprint?.definition?.sections; let i=index">
<li (click)="changeStep(i + 1)" [ngClass]="{'active': this.step === (i + 1), 'text-danger': hasErrors(section.id) }"><span class="d-flex align-items-center">{{section.label}} <li (click)="changeStep(i + 1)" [ngClass]="{'active': this.step === (i + 1), 'text-danger': hasErrors(section.id) }"><span class="d-flex align-items-center">{{section.label}}
<mat-icon *ngIf="section.description" class="ml-1 w-auto h-auto" style="font-size: 1rem; font-weight: 700;" [matTooltip]="section.description">info</mat-icon> <mat-icon *ngIf="section.description" class="ml-1 w-auto h-auto" style="font-size: 1rem; font-weight: 700;" [matTooltip]="section.description">info</mat-icon>
@ -163,7 +163,7 @@
</li> </li>
</ul> </ul>
</ng-container> </ng-container>
</div> }
</ol> </ol>
</div> </div>
</div> </div>