Mercurial > hg > ugly-duckling
diff src/app/feature-extraction-menu/feature-extraction-menu.component.ts @ 433:48904aa87ba3
Rudimentary mechanism for loading remote plugins, with a loading spinner. Also small clean up for stuff left over from the md-select stuff.
| author | Lucas Thompson <dev@lucas.im> |
|---|---|
| date | Wed, 07 Jun 2017 14:51:30 +0100 |
| parents | 686cf74aa0a2 |
| children | 8f658642d031 |
line wrap: on
line diff
--- a/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Wed Jun 07 08:58:38 2017 +0100 +++ b/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Wed Jun 07 14:51:30 2017 +0100 @@ -11,7 +11,6 @@ } from '../services/feature-extraction/feature-extraction.service'; import {ListResponse} from 'piper'; import {Subscription} from 'rxjs/Subscription'; -import {MdSelect} from '@angular/material'; export interface ExtractorOutputInfo { extractorKey: string; @@ -48,6 +47,7 @@ private populateExtractors: (available: ListResponse) => void; extractors: Iterable<ExtractorInfo>; private librariesUpdatedSubscription: Subscription; + private isLoading: boolean; constructor(private piperService: FeatureExtractionService) { this.extractors = []; @@ -69,17 +69,10 @@ acc.push({name, outputs}); return acc; }, [] as ExtractorInfo[]); + this.isLoading = false; }; } - private getFirstSelectedItemOrEmpty(select: MdSelect): string { - const selected = select.selected; - if (selected) { - return selected instanceof Array ? selected[0].value : selected.value; - } - return ''; - } - ngOnInit() { this.librariesUpdatedSubscription = this.piperService.librariesUpdated$.subscribe(this.populateExtractors); @@ -96,6 +89,7 @@ } load(): void { + this.isLoading = true; this.piperService.updateAvailableLibraries(); }
