description-template table view: added numbering on title

This commit is contained in:
Sofia Papacharalampous 2024-05-27 13:05:57 +03:00
parent c2a86a4aa2
commit 71b25867a7
5 changed files with 8 additions and 3 deletions

View File

@ -120,7 +120,7 @@
</div> </div>
<div [id]="'preview_container'+ form.get('id').value" class="row"> <div [id]="'preview_container'+ form.get('id').value" class="row">
<div *ngIf="previewFieldSet && showPreview && firstField?.get('data')?.get('fieldType')?.value" class="col-12" [@fade-in-fast]> <div *ngIf="previewFieldSet && showPreview && firstField?.get('data')?.get('fieldType')?.value" class="col-12" [@fade-in-fast]>
<app-description-form-field-set class="w-100" [canReview]="false" [propertiesFormGroup]="previewPropertiesFormGroup" [fieldSet]="previewFieldSet" [visibilityRulesService]="visibilityRulesService" [hideAnnotations]="true"></app-description-form-field-set> <app-description-form-field-set class="w-100" [canReview]="false" [propertiesFormGroup]="previewPropertiesFormGroup" [fieldSet]="previewFieldSet" [visibilityRulesService]="visibilityRulesService" [numbering]="numbering" [hideAnnotations]="true"></app-description-form-field-set>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<div mat-dialog-title> <div mat-dialog-title>
<div class="row"> <div class="row">
<div class="col-auto"> <div class="col-auto">
<h5 class="field-set-title">{{fieldSet.title}}</h5> <h5 class="field-set-title">{{numberingText}} {{fieldSet.title}}</h5>
</div> </div>
<div class="col-auto ml-auto close-btn" (click)="close()"> <div class="col-auto ml-auto close-btn" (click)="close()">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>

View File

@ -10,6 +10,7 @@ import { DescriptionTemplateFieldSet } from "@app/core/model/description-templat
}) })
export class FormFieldSetEditorDialogComponent { export class FormFieldSetEditorDialogComponent {
numberingText: string;
fieldSet: DescriptionTemplateFieldSet; fieldSet: DescriptionTemplateFieldSet;
propertiesFormGroup: UntypedFormGroup; propertiesFormGroup: UntypedFormGroup;
@ -19,6 +20,7 @@ export class FormFieldSetEditorDialogComponent {
) { ) {
this.fieldSet = data.fieldSet; this.fieldSet = data.fieldSet;
this.propertiesFormGroup = data.propertiesFormGroup; this.propertiesFormGroup = data.propertiesFormGroup;
this.numberingText = data.numberingText;
} }
cancel() { cancel() {

View File

@ -29,6 +29,7 @@ export class DescriptionFormFieldSetComponent extends BaseComponent {
@Input() descriptionId: Guid; @Input() descriptionId: Guid;
@Input() hideAnnotations: boolean = false; @Input() hideAnnotations: boolean = false;
@Input() canReview: boolean = false; @Input() canReview: boolean = false;
@Input() numbering: string;
get isMultiplicityEnabled() { get isMultiplicityEnabled() {
return this.fieldSet.hasMultiplicity && this.fieldSet.multiplicity != null; return this.fieldSet.hasMultiplicity && this.fieldSet.multiplicity != null;
@ -127,7 +128,8 @@ export class DescriptionFormFieldSetComponent extends BaseComponent {
minWidth: '49%', minWidth: '49%',
data: { data: {
fieldSet: this.fieldSet, fieldSet: this.fieldSet,
propertiesFormGroup: cloneAbstractControl((this.propertiesFormGroup?.get('items') as UntypedFormArray).at(fieldSetIndex)) propertiesFormGroup: cloneAbstractControl((this.propertiesFormGroup?.get('items') as UntypedFormArray).at(fieldSetIndex)),
numberingText: this.numbering
} }
}); });
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => { dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => {

View File

@ -19,6 +19,7 @@
[fieldSet]="fieldSet" [fieldSet]="fieldSet"
[descriptionId]="descriptionId" [descriptionId]="descriptionId"
[path]="path + '.' + (i+1)" [path]="path + '.' + (i+1)"
[numbering]="path + '.' + (i+1)"
[visibilityRulesService]="visibilityRulesService" [visibilityRulesService]="visibilityRulesService"
[validationErrorModel]="validationErrorModel" [validationErrorModel]="validationErrorModel"
[isChild]="false" [isChild]="false"