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
48
49
50
51
52
53
54
55
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
import { Dataset } from "../../metamodel/model";
@Component({
selector: 'app-datasets-by-project',
templateUrl: 'datasets-by-projet.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class DatasetsByProjetComponent {
@Input() projectLabel: string;
@Input() datasetList: Dataset[];
@Input() isAllSelected: boolean;
@Input() isAllUnselected: boolean;
@Output() change: EventEmitter<number[]> = new EventEmitter();
// getAttributeListSortedByDisplay() {
// return this.attributeList
// .sort((a, b) => a.output_display - b.output_display);
// }
//
// isSelected(id: number) {
// return this.outputList.filter(i => i === id).length > 0;
// }
//
// toggleSelection(attributeId: number): void {
// const clonedOutputList = [...this.outputList];
// const index = clonedOutputList.indexOf(attributeId);
// if (index > -1) {
// clonedOutputList.splice(index, 1);
// } else {
// clonedOutputList.push(attributeId);
// }
// this.change.emit(clonedOutputList);
// }
//
// selectAll(): void {
// const clonedOutputList = [...this.outputList];
// const attributeListId = this.attributeList.map(a => a.id);
// attributeListId.filter(id => clonedOutputList.indexOf(id) === -1).forEach(id => {
// clonedOutputList.push(id);
// });
// this.change.emit(clonedOutputList);
// }
//
// unselectAll(): void {
// const clonedOutputList = [...this.outputList];
// const attributeListId = this.attributeList.map(a => a.id);
// attributeListId.filter(id => clonedOutputList.indexOf(id) > -1).forEach(id => {
// const index = clonedOutputList.indexOf(id);
// clonedOutputList.splice(index, 1);
// });
// this.change.emit(clonedOutputList);
// }
}