Commit e65e399f authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Merge branch '48-bug-empty-family' into 'develop'

Fix bug => DONE

Closes #48

See merge request !41
parents 45d2ac6f 6a4346e2
Pipeline #1359 passed with stages
in 7 minutes and 1 second
<div *ngIf="criteriaFamilyList.length == 1">
<div *ngIf="criteriaFamilyList.length == 1 && getAttributeByFamily(criteriaFamilyList[0].id).length > 0">
<div class="border rounded my-2">
<p class="border-bottom bg-light text-primary py-4 pl-4">{{ criteriaFamilyList[0].label }}</p>
<div class="px-3">
......@@ -11,18 +11,20 @@
</div>
<accordion *ngIf="criteriaFamilyList.length > 1">
<accordion-group #ag *ngFor="let family of criteriaFamilyList" [panelClass]="'custom-accordion'" class="my-2"
[isOpen]="true">
<button class="btn btn-link btn-block clearfix" accordion-heading>
<div class="pull-left float-left">
{{ family.label }}
&nbsp;
<span *ngIf="ag.isOpen"><i class="fas fa-chevron-up"></i></span>
<span *ngIf="!ag.isOpen"><i class="fas fa-chevron-down"></i></span>
</div>
</button>
<app-criteria-by-family [criteriaFamily]="family" [datasetAttributeList]="datasetAttributeList"
[criteriaList]="criteriaList" (addCriterion)="add($event)">
</app-criteria-by-family>
</accordion-group>
<ng-container *ngFor="let family of criteriaFamilyList">
<accordion-group #ag *ngIf="getAttributeByFamily(family.id).length > 0" [panelClass]="'custom-accordion'" [isOpen]="true"
class="my-2">
<button class="btn btn-link btn-block clearfix" accordion-heading>
<div class="pull-left float-left">
{{ family.label }}
&nbsp;
<span *ngIf="ag.isOpen"><i class="fas fa-chevron-up"></i></span>
<span *ngIf="!ag.isOpen"><i class="fas fa-chevron-down"></i></span>
</div>
</button>
<app-criteria-by-family [criteriaFamily]="family" [datasetAttributeList]="datasetAttributeList"
[criteriaList]="criteriaList" (addCriterion)="add($event)">
</app-criteria-by-family>
</accordion-group>
</ng-container>
</accordion>
\ No newline at end of file
......@@ -15,6 +15,11 @@ export class CriteriaTabsComponent {
@Input() criteriaList: Criterion[];
@Output() addCriterion: EventEmitter<Criterion> = new EventEmitter();
getAttributeByFamily(idFamily: number): Attribute[] {
return this.datasetAttributeList
.filter(attribute => attribute.id_criteria_family === idFamily);
}
add(criterion: Criterion): void {
this.addCriterion.emit(criterion);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment