diff --git a/src/app/search/components/output-tabs.component.ts b/src/app/search/components/output-tabs.component.ts index 9f94492f5c5fc71d9e621714f968d53ee16a9329..746379e801f010930e444f7d60a4e7518872bdfb 100644 --- a/src/app/search/components/output-tabs.component.ts +++ b/src/app/search/components/output-tabs.component.ts @@ -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) {