Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
// import { Family, Category, Attribute } from '../../../metamodel/model';
// import { sortByDisplay } from '../../../shared/utils';
import { Dataset } from "../../metamodel/model";
@Component({
selector: 'app-dataset-list',
templateUrl: 'dataset-list.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DatasetListComponent {
@Input() datasetList: Dataset[];
@Output() updateDatasetList: EventEmitter<string[]> = new EventEmitter();
// getCategoryByFamilySortedByDisplay(idFamily: number): Category[] {
// return this.categoryList
// .filter(category => category.id_output_family === idFamily)
// .sort(sortByDisplay);
// }
//
// getAttributeByCategory(idCategory: number): Attribute[] {
// return this.datasetAttributeList
// .filter(attribute => attribute.id_output_category === idCategory);
// }
//
// getIsAllSelected(idCategory: number): boolean {
// const attributeListId = this.getAttributeByCategory(idCategory).map(a => a.id);
// const filteredOutputList = this.outputList.filter(id => attributeListId.indexOf(id) > -1);
// return attributeListId.length === filteredOutputList.length;
// }
//
// getIsAllUnselected(idCategory: number): boolean {
// const attributeListId = this.getAttributeByCategory(idCategory).map(a => a.id);
// const filteredOutputList = this.outputList.filter(id => attributeListId.indexOf(id) > -1);
// return filteredOutputList.length === 0;
// }
//
// emitChange(clonedOutputList: number[]): void {
// this.change.emit(
// this.datasetAttributeList
// .filter(a => clonedOutputList.indexOf(a.id) > -1)
// .sort((a, b) => a.output_display - b.output_display)
// .map(a => a.id)
// );
// }
}