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

Merge branch '13-selection-des-outputs' into 'develop'

#13 => done

Closes #13

See merge request !9
parents fad5e131 f3688c21
No related branches found
No related tags found
2 merge requests!68Develop,!9#13 => done
Pipeline #1172 passed
...@@ -10,27 +10,15 @@ import { OutputFamily, Category, Attribute, DatasetOutputFamily } from '../../me ...@@ -10,27 +10,15 @@ import { OutputFamily, Category, Attribute, DatasetOutputFamily } from '../../me
export class OutputTabsComponent { export class OutputTabsComponent {
@Input() outputFamilyList: OutputFamily[]; @Input() outputFamilyList: OutputFamily[];
@Input() categoryList: Category[]; @Input() categoryList: Category[];
@Input() @Input() datasetAttributeList : Attribute[];
set datasetAttributeList(datasetAttributeList: Attribute[]) {
this.setDefaultSelected(datasetAttributeList);
this._datasetAttributeList = datasetAttributeList;
}
@Input() datasetOutputFamilyList: DatasetOutputFamily[]; @Input() datasetOutputFamilyList: DatasetOutputFamily[];
@Input() outputList: number[]; @Input() outputList: number[];
@Output() changed: EventEmitter<number[]> = new EventEmitter(); @Output() changed: EventEmitter<number[]> = new EventEmitter();
_datasetAttributeList: Attribute[];
setDefaultSelected(datasetAttributeList: Attribute[]) {
const outputList = datasetAttributeList
.filter(attribute => attribute.selected && attribute.id_output_family)
.map(attribute => attribute.id);
Promise.resolve(null).then(() => this.changed.emit(outputList));
}
isLoading() { isLoading() {
if (this.outputFamilyList.length > 0 && if (this.outputFamilyList.length > 0 &&
this.categoryList.length > 0 && this.categoryList.length > 0 &&
this._datasetAttributeList.length > 0 && this.datasetAttributeList.length > 0 &&
this.datasetOutputFamilyList.length > 0 this.datasetOutputFamilyList.length > 0
) { ) {
return false; return false;
...@@ -48,7 +36,7 @@ export class OutputTabsComponent { ...@@ -48,7 +36,7 @@ export class OutputTabsComponent {
} }
getAttribute(id: number) { getAttribute(id: number) {
return this._datasetAttributeList.find(attribute => attribute.id === id); return this.datasetAttributeList.find(attribute => attribute.id === id);
} }
isSelected(id: number) { isSelected(id: number) {
......
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