Merge branch 'dmp-refactoring' into accessibility-refactor

# Conflicts:
#	frontend/src/app/ui/reference/reference-field/reference-field.component.html
#	frontend/src/app/ui/reference/reference-field/reference-field.component.scss
This commit is contained in:
mchouliara 2024-09-27 16:04:04 +03:00
commit fd831e6814
6 changed files with 60 additions and 45 deletions

View File

@ -204,7 +204,8 @@
}
.stepper-options {
height: calc(100vh - 650px);
flex: 1;
max-height: calc(100vh - 32rem);
overflow-y: auto;
.main-info {
color: var(--dark-gray)94;
@ -233,7 +234,7 @@
letter-spacing: 0px;
color: var(--dark-gray);
opacity: 0.6;
margin: 2.875rem 0rem 2.25rem 0rem;
margin: 2rem 0rem 1rem 0rem;
padding-left: 1rem;
}

View File

@ -308,7 +308,10 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
complete => {
onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete);
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 => {
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 {
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;
if (!currentValidity) return currentValidity;
entry.subEntries?.forEach(subEntry => {
currentValidity = currentValidity && this.isTocEntryValid(subEntry);
if (!currentValidity) return currentValidity;
if (!currentValidity){
return currentValidity;
}
});
return currentValidity;

View File

@ -135,7 +135,7 @@
<div class="row stepper-options">
<div class="col-auto">
<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">
<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>
@ -163,7 +163,7 @@
</li>
</ul>
</ng-container>
</div>
}
</ol>
</div>
</div>

View File

@ -1,26 +1,30 @@
<mat-form-field class="w-100" *ngIf="multipleAutoCompleteSearchConfiguration">
<div class="d-flex flex-column">
@if(multipleAutoCompleteSearchConfiguration){
<mat-form-field class="w-100" subscriptSizing="dynamic">
<mat-label>{{label?.length > 0 ? label : referenceType?.name}}</mat-label>
<app-multiple-auto-complete [id]="id" placeholder="{{ placeholder?.length > 0 ? placeholder : referenceType?.name}}" [formControl]="form" [configuration]="multipleAutoCompleteSearchConfiguration">
</app-multiple-auto-complete>
<mat-error *ngIf="form.hasError('backendError')">{{form.getError('backendError').message}}</mat-error>
<mat-error *ngIf="form.hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<mat-hint *ngIf="hint" align="start">{{hint}}</mat-hint>
<mat-hint align="end">
<span *ngIf="!form.disabled" class="not-found">{{'REFERENCE-FIELD.COULD-NOT-FIND-MESSAGE' | translate}} </span>
<span *ngIf="!form.disabled" class="insert-manually" (click)="addReference($event)">{{'REFERENCE-FIELD.ACTIONS.INSERT-MANUALLY' | translate}}</span>
</mat-hint>
</mat-form-field>
<mat-form-field class="w-100" *ngIf="singleAutoCompleteSearchConfiguration">
</mat-form-field>
<small class="ml-auto inherit-mat-hint" *ngIf="!form.disabled">
<span class="not-found">{{'REFERENCE-FIELD.COULD-NOT-FIND-MESSAGE' | translate}} </span>
<span class="insert-manually" (click)="addReference($event)">{{'REFERENCE-FIELD.ACTIONS.INSERT-MANUALLY' | translate}}</span>
</small>
}
@if(singleAutoCompleteSearchConfiguration){
<mat-form-field class="w-100" subscriptSizing="dynamic">
<mat-label>{{label?.length > 0 ? label : referenceType?.name}}</mat-label>
<app-single-auto-complete [id]="id" placeholder="{{ placeholder?.length > 0 ? placeholder : referenceType?.name}}" [formControl]="form" [configuration]="singleAutoCompleteSearchConfiguration">
</app-single-auto-complete>
<mat-error *ngIf="form.hasError('backendError')">{{form.getError('backendError').message}}</mat-error>
<mat-error *ngIf="form.hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<mat-hint *ngIf="hint" align="start">{{hint}}</mat-hint>
<mat-hint align="end">
<span *ngIf="!form.disabled" class="not-found">{{'REFERENCE-FIELD.COULD-NOT-FIND-MESSAGE' | translate}} </span>
<span *ngIf="!form.disabled" class="insert-manually" (click)="addReference($event)">{{'REFERENCE-FIELD.ACTIONS.INSERT-MANUALLY' | translate}}</span>
</mat-hint>
</mat-form-field>
<div class="mb-4">
</mat-form-field>
<small class="ml-auto inherit-mat-hint" *ngIf="!form.disabled">
<span class="not-found">{{'REFERENCE-FIELD.COULD-NOT-FIND-MESSAGE' | translate}} </span>
<span class="insert-manually" (click)="addReference($event)">{{'REFERENCE-FIELD.ACTIONS.INSERT-MANUALLY' | translate}}</span>
</small>
}
</div>

View File

@ -1,12 +1,16 @@
.insert-manually {
.insert-manually {
text-decoration: underline;
color: var(--primary-color);
cursor: pointer;
font-weight: 400;
}
}
.not-found {
.not-found {
color: #333;
font-weight: 400;
padding: 0rem 0.5rem 0rem 0rem;
}
}
.inherit-mat-hint { //todo mchouliara move to styles.scss after accessibility refactor merge
font-size: var(--mat-form-field-subscript-text-size);
}