Skip to content
Snippets Groups Projects
Commit 6e8fc838 authored by François Agneray's avatar François Agneray
Browse files

Add Output family + category for detail config

parent 7c9a65a7
No related branches found
No related tags found
2 merge requests!72Develop,!61Resolve "Affichage famille + output category dans la configuration d'un dataset (output)"
......@@ -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>
......
......@@ -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>
......
......@@ -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,
......
......@@ -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>
......
......@@ -7,7 +7,7 @@
formControlName="id_output_category">
<option value=""></option>
<option *ngFor="let category of outputCategoryList" [ngValue]="category.id">
{{getOutputFamilyLabel(category.id_output_family)}}/{{category.label}}
{{ getOutputFamilyLabel(category.id_output_family) }} / {{ category.label }}
</option>
</select>
</td>
......
......@@ -43,14 +43,14 @@ 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,
...this.form.value
});
}
getOutputFamilyLabel(idOutputFamilly: number): string {
return this.outputFamilyList.find(outputFamilly => outputFamilly.id === idOutputFamilly).label;
}
}
......@@ -136,6 +136,7 @@
<tr *ngFor="let attribute of (attributeList | async)"
detail
[attribute]="attribute"
[outputFamilyList]="outputFamilyList | async"
[outputCategoryList]="outputCategoryList | async"
(save)="editAttribute($event)">
</tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment