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

#13 => done

parent fad5e131
No related branches found
No related tags found
2 merge requests!68Develop,!9#13 => done
......@@ -10,27 +10,15 @@ import { OutputFamily, Category, Attribute, DatasetOutputFamily } from '../../me
export class OutputTabsComponent {
@Input() outputFamilyList: OutputFamily[];
@Input() categoryList: Category[];
@Input()
set datasetAttributeList(datasetAttributeList: Attribute[]) {
this.setDefaultSelected(datasetAttributeList);
this._datasetAttributeList = datasetAttributeList;
}
@Input() datasetAttributeList : Attribute[];
@Input() datasetOutputFamilyList: DatasetOutputFamily[];
@Input() outputList: number[];
@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() {
if (this.outputFamilyList.length > 0 &&
this.categoryList.length > 0 &&
this._datasetAttributeList.length > 0 &&
this.datasetAttributeList.length > 0 &&
this.datasetOutputFamilyList.length > 0
) {
return false;
......@@ -48,7 +36,7 @@ export class OutputTabsComponent {
}
getAttribute(id: number) {
return this._datasetAttributeList.find(attribute => attribute.id === id);
return this.datasetAttributeList.find(attribute => attribute.id === id);
}
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