diff --git a/client/src/app/admin/instance/dataset/components/attribute/detail/table-detail.component.html b/client/src/app/admin/instance/dataset/components/attribute/detail/table-detail.component.html index ae53a43249c09f7380c6d5f6537b6ea13dbaf4bf..64784d8fd030fff24798a7e7f775decaf7c87231 100644 --- a/client/src/app/admin/instance/dataset/components/attribute/detail/table-detail.component.html +++ b/client/src/app/admin/instance/dataset/components/attribute/detail/table-detail.component.html @@ -3,7 +3,7 @@ <thead> <tr> <th scope="col" style="min-width:150px">Name</th> - <th scope="col" style="min-width:150px">Output category</th> + <th scope="col" style="min-width:150px">Output family / category</th> <th scope="col" style="min-width:100px;width:100px;">Display</th> <th scope="col" style="width:50px">Save</th> </tr> diff --git a/client/src/app/admin/instance/dataset/components/attribute/detail/tr-detail.component.html b/client/src/app/admin/instance/dataset/components/attribute/detail/tr-detail.component.html index ecb4ec71877ba64a3137d3bd0bcdc813d8c680b0..60b2752e0eeae20048b48b99af9d11a9675844b3 100644 --- a/client/src/app/admin/instance/dataset/components/attribute/detail/tr-detail.component.html +++ b/client/src/app/admin/instance/dataset/components/attribute/detail/tr-detail.component.html @@ -5,7 +5,9 @@ <td> <select class="form-control" name="id_detail_output_category" (change)="detailOutputCategoryOnChange()" formControlName="id_detail_output_category"> <option value=""></option> - <option *ngFor="let category of outputCategoryList" [ngValue]="category.id">{{category.label}}</option> + <option *ngFor="let category of outputCategoryList" [ngValue]="category.id"> + {{ getOutputFamilyLabel(category.id_output_family) }} / {{ category.label }} + </option> </select> </td> <td> diff --git a/client/src/app/admin/instance/dataset/components/attribute/detail/tr-detail.component.ts b/client/src/app/admin/instance/dataset/components/attribute/detail/tr-detail.component.ts index 527b0e0c223b0ad824ab7651e49e13bd7021736a..8495e39267704a7fe66e3070a52f3a082b1835eb 100644 --- a/client/src/app/admin/instance/dataset/components/attribute/detail/tr-detail.component.ts +++ b/client/src/app/admin/instance/dataset/components/attribute/detail/tr-detail.component.ts @@ -10,7 +10,7 @@ import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit } from '@angular/core'; import { UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { Attribute, OutputCategory } from 'src/app/metamodel/models'; +import { Attribute, OutputCategory, OutputFamily } from 'src/app/metamodel/models'; @Component({ selector: '[detail]', @@ -21,6 +21,7 @@ import { Attribute, OutputCategory } from 'src/app/metamodel/models'; export class TrDetailComponent implements OnInit { @Input() attribute: Attribute @Input() outputCategoryList: OutputCategory[]; + @Input() outputFamilyList: OutputFamily[]; @Output() save: EventEmitter<Attribute> = new EventEmitter(); public form = new UntypedFormGroup({ @@ -41,6 +42,10 @@ export class TrDetailComponent implements OnInit { } } + getOutputFamilyLabel(idOutputFamilly: number): string { + return this.outputFamilyList.find(outputFamilly => outputFamilly.id === idOutputFamilly).label; + } + submit(): void { this.save.emit({ ...this.attribute, diff --git a/client/src/app/admin/instance/dataset/components/attribute/output/table-output.component.html b/client/src/app/admin/instance/dataset/components/attribute/output/table-output.component.html index af9e087b3ebb5704048b85a845f837ef9529db8d..ce2d981a171b12ffa3e062ab3512403e6430549d 100644 --- a/client/src/app/admin/instance/dataset/components/attribute/output/table-output.component.html +++ b/client/src/app/admin/instance/dataset/components/attribute/output/table-output.component.html @@ -3,7 +3,7 @@ <thead> <tr> <th scope="col" style="min-width:150px">Name</th> - <th scope="col" style="min-width:150px">Output category</th> + <th scope="col" style="min-width:150px">Output family / category</th> <th scope="col" style="min-width:100px;width:100px;">Display</th> <th scope="col" style="width:50px">Selected</th> <th scope="col" style="width:50px">Save</th> diff --git a/client/src/app/admin/instance/dataset/components/attribute/output/tr-output.component.html b/client/src/app/admin/instance/dataset/components/attribute/output/tr-output.component.html index 9b0457ab2a377e2e3bb5e3eb9c6c718b4584d548..6bc7ab3d6079473276e473b338ca68d07811f0fc 100644 --- a/client/src/app/admin/instance/dataset/components/attribute/output/tr-output.component.html +++ b/client/src/app/admin/instance/dataset/components/attribute/output/tr-output.component.html @@ -3,20 +3,25 @@ <input type="text" class="form-control" name="name" formControlName="name"> </td> <td> - <select class="form-control" name="id_output_category" (change)="outputCategoryOnChange()" formControlName="id_output_category"> + <select class="form-control" name="id_output_category" (change)="outputCategoryOnChange()" + formControlName="id_output_category"> <option value=""></option> - <option *ngFor="let category of outputCategoryList" [ngValue]="category.id">{{category.label}}</option> + <option *ngFor="let category of outputCategoryList" [ngValue]="category.id"> + {{ getOutputFamilyLabel(category.id_output_family) }} / {{ category.label }} + </option> </select> </td> <td> - <input *ngIf="form.controls.id_output_category.value" type="number" class="form-control" name="output_display" formControlName="output_display"> + <input *ngIf="form.controls.id_output_category.value" type="number" class="form-control" name="output_display" + formControlName="output_display"> </td> <td> - <input *ngIf="form.controls.id_output_category.value" type="checkbox" class="form-control" name="selected" formControlName="selected"> + <input *ngIf="form.controls.id_output_category.value" type="checkbox" class="form-control" name="selected" + formControlName="selected"> </td> <td class="text-center align-middle"> <button (click)="submit()" [disabled]="form.invalid || form.pristine" class="btn btn-outline-primary"> <span class="fas fa-save"></span> </button> </td> -</ng-container> +</ng-container> \ No newline at end of file diff --git a/client/src/app/admin/instance/dataset/components/attribute/output/tr-output.component.ts b/client/src/app/admin/instance/dataset/components/attribute/output/tr-output.component.ts index d3feab7ddb958c3155676a59fcbc53e79c1f3d8e..122d6dbbb1e5cdfb0eaa16dc6f5b1c5ea530a6d4 100644 --- a/client/src/app/admin/instance/dataset/components/attribute/output/tr-output.component.ts +++ b/client/src/app/admin/instance/dataset/components/attribute/output/tr-output.component.ts @@ -10,17 +10,18 @@ import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit } from '@angular/core'; import { UntypedFormControl, UntypedFormGroup } from '@angular/forms'; -import { Attribute, OutputCategory } from 'src/app/metamodel/models'; +import { Attribute, OutputCategory, OutputFamily } from 'src/app/metamodel/models'; @Component({ selector: '[output]', templateUrl: 'tr-output.component.html', - styleUrls: [ '../tr.component.scss' ], + styleUrls: ['../tr.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) export class TrOutputComponent implements OnInit { @Input() attribute: Attribute; @Input() outputCategoryList: OutputCategory[]; + @Input() outputFamilyList: OutputFamily[]; @Output() save: EventEmitter<Attribute> = new EventEmitter(); public form = new UntypedFormGroup({ @@ -42,6 +43,10 @@ export class TrOutputComponent implements OnInit { } } + getOutputFamilyLabel(idOutputFamilly: number): string { + return this.outputFamilyList.find(outputFamilly => outputFamilly.id === idOutputFamilly).label; + } + submit(): void { this.save.emit({ ...this.attribute, diff --git a/client/src/app/admin/instance/dataset/containers/configure-dataset.component.html b/client/src/app/admin/instance/dataset/containers/configure-dataset.component.html index 335ce696773d2357819b74082d43223c31e0d8ea..22498e4a4add4cc73806e3ba4be79c7f3829e309 100644 --- a/client/src/app/admin/instance/dataset/containers/configure-dataset.component.html +++ b/client/src/app/admin/instance/dataset/containers/configure-dataset.component.html @@ -120,6 +120,7 @@ <tr *ngFor="let attribute of (attributeList | async)" output [attribute]="attribute" + [outputFamilyList]="outputFamilyList | async" [outputCategoryList]="outputCategoryList | async" (save)="editAttribute($event)"> </tr> @@ -135,6 +136,7 @@ <tr *ngFor="let attribute of (attributeList | async)" detail [attribute]="attribute" + [outputFamilyList]="outputFamilyList | async" [outputCategoryList]="outputCategoryList | async" (save)="editAttribute($event)"> </tr>