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

Merge branch...

Merge branch '68-affichage-famille-output-category-dans-la-configuration-d-un-dataset-output' into 'develop'

Resolve "Affichage famille + output category dans la configuration d'un dataset (output)"

Closes #68

See merge request !61
parents 0915f2cf 6e8fc838
No related branches found
No related tags found
2 merge requests!72Develop,!61Resolve "Affichage famille + output category dans la configuration d'un dataset (output)"
Pipeline #9327 passed
Pipeline: anis-next

#9328

    ...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
    <thead> <thead>
    <tr> <tr>
    <th scope="col" style="min-width:150px">Name</th> <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="min-width:100px;width:100px;">Display</th>
    <th scope="col" style="width:50px">Save</th> <th scope="col" style="width:50px">Save</th>
    </tr> </tr>
    ......
    ...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
    <td> <td>
    <select class="form-control" name="id_detail_output_category" (change)="detailOutputCategoryOnChange()" formControlName="id_detail_output_category"> <select class="form-control" name="id_detail_output_category" (change)="detailOutputCategoryOnChange()" formControlName="id_detail_output_category">
    <option value=""></option> <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> </select>
    </td> </td>
    <td> <td>
    ......
    ...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
    import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit } from '@angular/core'; import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit } from '@angular/core';
    import { UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
    import { Attribute, OutputCategory } from 'src/app/metamodel/models'; import { Attribute, OutputCategory, OutputFamily } from 'src/app/metamodel/models';
    @Component({ @Component({
    selector: '[detail]', selector: '[detail]',
    ...@@ -21,6 +21,7 @@ import { Attribute, OutputCategory } from 'src/app/metamodel/models'; ...@@ -21,6 +21,7 @@ import { Attribute, OutputCategory } from 'src/app/metamodel/models';
    export class TrDetailComponent implements OnInit { export class TrDetailComponent implements OnInit {
    @Input() attribute: Attribute @Input() attribute: Attribute
    @Input() outputCategoryList: OutputCategory[]; @Input() outputCategoryList: OutputCategory[];
    @Input() outputFamilyList: OutputFamily[];
    @Output() save: EventEmitter<Attribute> = new EventEmitter(); @Output() save: EventEmitter<Attribute> = new EventEmitter();
    public form = new UntypedFormGroup({ public form = new UntypedFormGroup({
    ...@@ -41,6 +42,10 @@ export class TrDetailComponent implements OnInit { ...@@ -41,6 +42,10 @@ export class TrDetailComponent implements OnInit {
    } }
    } }
    getOutputFamilyLabel(idOutputFamilly: number): string {
    return this.outputFamilyList.find(outputFamilly => outputFamilly.id === idOutputFamilly).label;
    }
    submit(): void { submit(): void {
    this.save.emit({ this.save.emit({
    ...this.attribute, ...this.attribute,
    ......
    ...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
    <thead> <thead>
    <tr> <tr>
    <th scope="col" style="min-width:150px">Name</th> <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="min-width:100px;width:100px;">Display</th>
    <th scope="col" style="width:50px">Selected</th> <th scope="col" style="width:50px">Selected</th>
    <th scope="col" style="width:50px">Save</th> <th scope="col" style="width:50px">Save</th>
    ......
    ...@@ -3,20 +3,25 @@ ...@@ -3,20 +3,25 @@
    <input type="text" class="form-control" name="name" formControlName="name"> <input type="text" class="form-control" name="name" formControlName="name">
    </td> </td>
    <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 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> </select>
    </td> </td>
    <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>
    <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>
    <td class="text-center align-middle"> <td class="text-center align-middle">
    <button (click)="submit()" [disabled]="form.invalid || form.pristine" class="btn btn-outline-primary"> <button (click)="submit()" [disabled]="form.invalid || form.pristine" class="btn btn-outline-primary">
    <span class="fas fa-save"></span> <span class="fas fa-save"></span>
    </button> </button>
    </td> </td>
    </ng-container> </ng-container>
    \ No newline at end of file
    ...@@ -10,17 +10,18 @@ ...@@ -10,17 +10,18 @@
    import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit } from '@angular/core'; import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, OnInit } from '@angular/core';
    import { UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
    import { Attribute, OutputCategory } from 'src/app/metamodel/models'; import { Attribute, OutputCategory, OutputFamily } from 'src/app/metamodel/models';
    @Component({ @Component({
    selector: '[output]', selector: '[output]',
    templateUrl: 'tr-output.component.html', templateUrl: 'tr-output.component.html',
    styleUrls: [ '../tr.component.scss' ], styleUrls: ['../tr.component.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush changeDetection: ChangeDetectionStrategy.OnPush
    }) })
    export class TrOutputComponent implements OnInit { export class TrOutputComponent implements OnInit {
    @Input() attribute: Attribute; @Input() attribute: Attribute;
    @Input() outputCategoryList: OutputCategory[]; @Input() outputCategoryList: OutputCategory[];
    @Input() outputFamilyList: OutputFamily[];
    @Output() save: EventEmitter<Attribute> = new EventEmitter(); @Output() save: EventEmitter<Attribute> = new EventEmitter();
    public form = new UntypedFormGroup({ public form = new UntypedFormGroup({
    ...@@ -42,6 +43,10 @@ export class TrOutputComponent implements OnInit { ...@@ -42,6 +43,10 @@ export class TrOutputComponent implements OnInit {
    } }
    } }
    getOutputFamilyLabel(idOutputFamilly: number): string {
    return this.outputFamilyList.find(outputFamilly => outputFamilly.id === idOutputFamilly).label;
    }
    submit(): void { submit(): void {
    this.save.emit({ this.save.emit({
    ...this.attribute, ...this.attribute,
    ......
    ...@@ -120,6 +120,7 @@ ...@@ -120,6 +120,7 @@
    <tr *ngFor="let attribute of (attributeList | async)" <tr *ngFor="let attribute of (attributeList | async)"
    output output
    [attribute]="attribute" [attribute]="attribute"
    [outputFamilyList]="outputFamilyList | async"
    [outputCategoryList]="outputCategoryList | async" [outputCategoryList]="outputCategoryList | async"
    (save)="editAttribute($event)"> (save)="editAttribute($event)">
    </tr> </tr>
    ...@@ -135,6 +136,7 @@ ...@@ -135,6 +136,7 @@
    <tr *ngFor="let attribute of (attributeList | async)" <tr *ngFor="let attribute of (attributeList | async)"
    detail detail
    [attribute]="attribute" [attribute]="attribute"
    [outputFamilyList]="outputFamilyList | async"
    [outputCategoryList]="outputCategoryList | async" [outputCategoryList]="outputCategoryList | async"
    (save)="editAttribute($event)"> (save)="editAttribute($event)">
    </tr> </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