small fixes plan listing item, accessibility toggle service, dashboard. Plan editor add blueprint to required, on click next check validity and mark as touched

This commit is contained in:
mchouliara 2024-10-01 12:48:36 +03:00
parent 31089fdeba
commit b165d867f5
10 changed files with 25 additions and 15 deletions

View File

@ -1,17 +1,16 @@
import { Injectable, Signal, signal } from '@angular/core'; import { computed, Injectable, Signal, signal } from '@angular/core';
@Injectable() @Injectable()
export class FontAccessibilityService { export class FontAccessibilityService {
private _accessibleFontSignal = signal<boolean>(false); private _accessibleFontSignal = signal<boolean>(false);
get accessibleFontSignal(): Signal<boolean> { public accessibleFontSignal = computed(() => this._accessibleFontSignal())
return this._accessibleFontSignal;
constructor() {
this._accessibleFontSignal.set(localStorage.getItem('largeText') === 'true');
} }
constructor() { }
public isLargeText(): boolean { public isLargeText(): boolean {
return this.accessibleFontSignal(); return this._accessibleFontSignal();
} }
public toggleFontSize(){ public toggleFontSize(){

View File

@ -172,7 +172,7 @@
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
<div class="d-flex flex-column align-items-center non-auth-title-container"> <div class="d-flex flex-column align-items-center non-auth-title-container">
<h4 class="pt-4">{{'DASHBOARD.TITLE' | translate}}</h4> <p class="dashboard-title pt-4">{{'DASHBOARD.TITLE' | translate}}</p>
<p class="col-auto app-info">{{'DASHBOARD.INFO-TEXT' | translate}}</p> <p class="col-auto app-info">{{'DASHBOARD.INFO-TEXT' | translate}}</p>
</div> </div>
<div class="d-flex"> <div class="d-flex">

View File

@ -363,3 +363,7 @@ mat-tab-group.my-mat-tab .mat-mdc-tab-header .mat-mdc-tab-label-container .mat-m
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.dashboard-title {
font-size: 1.125rem; //h4
}

View File

@ -130,7 +130,7 @@
</div> </div>
</div> </div>
<div class="row mb-4"> <div class="row mt-auto">
<div class="col-12"> <div class="col-12">
<div class="row mt-3 stepper-actions justify-content-center"> <div class="row mt-3 stepper-actions justify-content-center">
<div class="col-auto mb-1"> <div class="col-auto mb-1">

View File

@ -206,7 +206,7 @@
.stepper-options { .stepper-options {
flex: 1; flex: 1;
max-height: calc(100vh - 32rem); max-height: calc(100vh - 38rem);
overflow-y: auto; overflow-y: auto;
.main-info { .main-info {
color: var(--dark-gray)94; color: var(--dark-gray)94;

View File

@ -15,7 +15,7 @@
letter-spacing: 0px; letter-spacing: 0px;
color: var(--dark-gray); color: var(--dark-gray);
opacity: 1; opacity: 1;
margin: 3rem 0rem 3rem 0rem; margin: 2rem 0rem 2rem 0rem;
} }
.dynamic-form-editor { .dynamic-form-editor {

View File

@ -649,7 +649,7 @@ export class VisibilityRulesService {
for (let j = 0; j < propertyDefinitionFieldSet.items.length; j++) { for (let j = 0; j < propertyDefinitionFieldSet.items.length; j++) {
const definitionFieldSetItem = propertyDefinitionFieldSet.items[j]; const definitionFieldSetItem = propertyDefinitionFieldSet.items[j];
const fieldKey = this.buildVisibilityKey(fieldSetEntity.id, definitionFieldSetItem.ordinal); const fieldKey = this.buildVisibilityKey(fieldSetEntity.id, definitionFieldSetItem.ordinal);
const isCurrentHidden = !this._isVisibleMap[fieldKey] ?? false; const isCurrentHidden = !this._isVisibleMap[fieldKey];
isHidden = isHidden && isCurrentHidden; isHidden = isHidden && isCurrentHidden;
} }
} }

View File

@ -34,7 +34,7 @@
<span>.</span> <span>.</span>
<span class="col">{{ 'PLAN-LISTING.GRANT' | translate }}: {{referenceService.getReferencesForTypesFirstSafe(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</span> <span class="col">{{ 'PLAN-LISTING.GRANT' | translate }}: {{referenceService.getReferencesForTypesFirstSafe(plan?.planReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</span>
</div> </div>
<div class="col-auto plan-description-descriptions-title">{{'PLAN-LISTING.CONTAINED-DESCRIPTIONS' | translate}}: ({{ plan.descriptions?.length }}) <div class="col-auto plan-description-descriptions-title">{{'PLAN-LISTING.CONTAINED-DESCRIPTIONS' | translate}}: ({{ plan.descriptions?.length ?? 0 }})
</div> </div>
<div *ngFor="let description of plan.descriptions; let i = index; let last = last" [ngClass]="{'pb-3': i === plan.descriptions?.length - 1}"> <div *ngFor="let description of plan.descriptions; let i = index; let last = last" [ngClass]="{'pb-3': i === plan.descriptions?.length - 1}">
<div *ngIf="i < 3"> <div *ngIf="i < 3">

View File

@ -102,13 +102,16 @@
<label for="blueprintInput" class="heading2">{{'PLAN-EDITOR.FIELDS.BLUEPRINT' | translate}}&nbsp;*<small class="required-text">{{'GENERAL.VALIDATION.REQUIRED' | translate }}</small></label> <label for="blueprintInput" class="heading2">{{'PLAN-EDITOR.FIELDS.BLUEPRINT' | translate}}&nbsp;*<small class="required-text">{{'GENERAL.VALIDATION.REQUIRED' | translate }}</small></label>
<mat-form-field class="w-100"> <mat-form-field class="w-100">
<mat-label>{{'PLAN-EDITOR.FIELDS.BLUEPRINT' | translate}}</mat-label> <mat-label>{{'PLAN-EDITOR.FIELDS.BLUEPRINT' | translate}}</mat-label>
<app-single-auto-complete [id]="'blueprintInput'" [required]="false" [formControl]="formGroup.get('blueprint')" placeholder="{{'PLAN-EDITOR.PLACEHOLDER.BLUEPRINT' | translate}}" [configuration]="singleAutocompleteBlueprintConfiguration"> <app-single-auto-complete [id]="'blueprintInput'" required [formControl]="formGroup.get('blueprint')" placeholder="{{'PLAN-EDITOR.PLACEHOLDER.BLUEPRINT' | translate}}" [configuration]="singleAutocompleteBlueprintConfiguration">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="formGroup.get('blueprint').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div class="row"> <div class="row">
<div class="col-5"> <div class="col-5">
<button mat-button class="rounded-btn secondary" [disabled]="!(formGroup.get('blueprint').value && formGroup.get('label').value)" (click)="selectBlueprint()"> <button mat-button class="rounded-btn secondary" (click)="selectBlueprint()">
{{'PLAN-EDITOR.STEPPER.NEXT' | translate}} {{'PLAN-EDITOR.STEPPER.NEXT' | translate}}
</button> </button>
</div> </div>

View File

@ -568,6 +568,10 @@ export class PlanEditorComponent extends BaseEditor<PlanEditorModel, Plan> imple
// //
// //
selectBlueprint() { selectBlueprint() {
if(!(this.formGroup.get('blueprint').value && this.formGroup.get('label').value)){
this.formGroup.markAllAsTouched();
return;
}
this.planBlueprintService.getSingle(this.formGroup.get('blueprint').value, PlanEditorEntityResolver.blueprintLookupFields()).pipe(takeUntil(this._destroyed)) this.planBlueprintService.getSingle(this.formGroup.get('blueprint').value, PlanEditorEntityResolver.blueprintLookupFields()).pipe(takeUntil(this._destroyed))
.subscribe(data => { .subscribe(data => {
this.selectedBlueprint = data; this.selectedBlueprint = data;