comparison src/app/feature-extraction-menu/feature-extraction-menu.component.ts @ 442:51a5df5569a4

No need for ternary operator, coalesce to default value.
author Lucas Thompson <dev@lucas.im>
date Mon, 26 Jun 2017 11:07:20 +0100
parents 55e17af8a0ee
children c39df81c4dae
comparison
equal deleted inserted replaced
441:55e17af8a0ee 442:51a5df5569a4
114 this.isLoading = true; 114 this.isLoading = true;
115 this.piperService.updateAvailableLibraries(); 115 this.piperService.updateAvailableLibraries();
116 } 116 }
117 117
118 getFeatureIconName(outputInfo: ExtractorOutputInfo): string { 118 getFeatureIconName(outputInfo: ExtractorOutputInfo): string {
119 const featureIconMap = { 119 return {
120 vector: 'show_chart', 120 vector: 'show_chart',
121 matrix: 'grid_on', 121 matrix: 'grid_on',
122 tracks: 'multiline_chart', 122 tracks: 'multiline_chart',
123 instants: 'view_week', 123 instants: 'view_week',
124 notes: 'audiotrack', 124 notes: 'audiotrack',
125 }; 125 }[crudeTypeUriMap[outputInfo.typeUri]] || 'extension';
126 const maybeIcon = featureIconMap[crudeTypeUriMap[outputInfo.typeUri]];
127 return maybeIcon ? maybeIcon : 'extension';
128 } 126 }
129 127
130 ngOnDestroy(): void { 128 ngOnDestroy(): void {
131 this.librariesUpdatedSubscription.unsubscribe(); 129 this.librariesUpdatedSubscription.unsubscribe();
132 } 130 }