ui handle description fieldset multiplicity

This commit is contained in:
amentis 2024-06-07 16:30:43 +03:00
parent 2474a71b14
commit 1f4b389d49
1 changed files with 4 additions and 2 deletions

View File

@ -4,8 +4,6 @@
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col"> <div class="col">
<app-description-form-field-set-title [fieldSet]="fieldSet" [path]="path" [isChild]="isChild"></app-description-form-field-set-title> <app-description-form-field-set-title [fieldSet]="fieldSet" [path]="path" [isChild]="isChild"></app-description-form-field-set-title>
<mat-error *ngIf="fieldSet.hasMultiplicity && fieldSet?.multiplicity?.min && propertiesFormGroup.get('items').hasError('minlength')">{{'GENERAL.VALIDATION.MULTIPLICITY.MIN' | translate: { min: fieldSet.multiplicity.min} }}</mat-error>
<mat-error *ngIf="fieldSet.hasMultiplicity && fieldSet?.multiplicity?.max && propertiesFormGroup.get('items').hasError('maxlength')">{{'GENERAL.VALIDATION,MULTIPLICITY.MAX' | translate: { max: fieldSet.multiplicity.max} }}</mat-error>
</div> </div>
<div *ngIf="!hideAnnotations" class="col-auto"> <div *ngIf="!hideAnnotations" class="col-auto">
<button mat-icon-button class="col-auto annotation-icon" (click)="showAnnotations(fieldSet.id)" [disabled]="!canReview"> <button mat-icon-button class="col-auto annotation-icon" (click)="showAnnotations(fieldSet.id)" [disabled]="!canReview">
@ -35,6 +33,8 @@
</div> </div>
</div> </div>
<div *ngIf="fieldSet.hasMultiplicity && (fieldSet?.multiplicity?.max) > (propertiesFormGroup.get('items').length)" class="col-12 mt-1 ml-0 mr-0 addOneFieldButton"> <div *ngIf="fieldSet.hasMultiplicity && (fieldSet?.multiplicity?.max) > (propertiesFormGroup.get('items').length)" class="col-12 mt-1 ml-0 mr-0 addOneFieldButton">
<mat-error *ngIf="fieldSet.hasMultiplicity && fieldSet?.multiplicity?.min && propertiesFormGroup.get('items').hasError('minlength')">{{'GENERAL.VALIDATION.MULTIPLICITY.MIN' | translate: { min: fieldSet.multiplicity.min} }}</mat-error>
<mat-error *ngIf="fieldSet.hasMultiplicity && fieldSet?.multiplicity?.max && propertiesFormGroup.get('items').hasError('maxlength')">{{'GENERAL.VALIDATION,MULTIPLICITY.MAX' | translate: { max: fieldSet.multiplicity.max} }}</mat-error>
<span class="d-inline-flex align-items-center" [ngClass]="propertiesFormGroup.disabled ? '' : 'pointer'" (click)="addMultiplicityField()"> <span class="d-inline-flex align-items-center" [ngClass]="propertiesFormGroup.disabled ? '' : 'pointer'" (click)="addMultiplicityField()">
<button mat-icon-button color="primary" [disabled]="propertiesFormGroup.disabled"> <button mat-icon-button color="primary" [disabled]="propertiesFormGroup.disabled">
<mat-icon>add_circle</mat-icon> <mat-icon>add_circle</mat-icon>
@ -72,6 +72,8 @@
<tr *ngIf="fieldSet.hasMultiplicity && (fieldSet.multiplicity.max - 1) > propertiesFormGroup?.get('items')?.controls.length"> <tr *ngIf="fieldSet.hasMultiplicity && (fieldSet.multiplicity.max - 1) > propertiesFormGroup?.get('items')?.controls.length">
<td [colSpan]="fieldSet.fields.length + 1" class="text-center"> <td [colSpan]="fieldSet.fields.length + 1" class="text-center">
<mat-error *ngIf="fieldSet.hasMultiplicity && fieldSet?.multiplicity?.min && propertiesFormGroup.get('items').hasError('minlength')">{{'GENERAL.VALIDATION.MULTIPLICITY.MIN' | translate: { min: fieldSet.multiplicity.min} }}</mat-error>
<mat-error *ngIf="fieldSet.hasMultiplicity && fieldSet?.multiplicity?.max && propertiesFormGroup.get('items').hasError('maxlength')">{{'GENERAL.VALIDATION,MULTIPLICITY.MAX' | translate: { max: fieldSet.multiplicity.max} }}</mat-error>
<span class="d-inline-flex align-items-center" [ngClass]="propertiesFormGroup.disabled ? '' : 'pointer'" (click)="addMultiplicityField()"> <span class="d-inline-flex align-items-center" [ngClass]="propertiesFormGroup.disabled ? '' : 'pointer'" (click)="addMultiplicityField()">
<button mat-icon-button color="primary" [disabled]="propertiesFormGroup.disabled"> <button mat-icon-button color="primary" [disabled]="propertiesFormGroup.disabled">
<mat-icon>add_circle</mat-icon> <mat-icon>add_circle</mat-icon>