diff --git a/src/app/components/preferences/common/symbols/symbols.component.html b/src/app/components/preferences/common/symbols/symbols.component.html index 4e27a7ca..21f0882b 100644 --- a/src/app/components/preferences/common/symbols/symbols.component.html +++ b/src/app/components/preferences/common/symbols/symbols.component.html @@ -1,9 +1,9 @@

+


-
+
diff --git a/src/app/components/preferences/common/symbols/symbols.component.ts b/src/app/components/preferences/common/symbols/symbols.component.ts index f2b50e54..c6932a09 100644 --- a/src/app/components/preferences/common/symbols/symbols.component.ts +++ b/src/app/components/preferences/common/symbols/symbols.component.ts @@ -15,6 +15,7 @@ export class SymbolsComponent implements OnInit { @Output() symbolChanged = new EventEmitter(); symbols: Symbol[] = []; + filteredSymbols: Symbol[] = []; isSelected: string = ''; searchText: string = ''; @@ -27,6 +28,16 @@ export class SymbolsComponent implements OnInit { this.loadSymbols(); } + setFilter(filter: string) { + if (filter === 'all') { + this.filteredSymbols = this.symbols; + } else if (filter === 'builtin') { + this.filteredSymbols = this.symbols.filter(elem => elem.builtin); + } else { + this.filteredSymbols = this.symbols.filter(elem => !elem.builtin); + } + } + setSelected(symbol_id: string) { this.isSelected = symbol_id; this.symbolChanged.emit(this.isSelected); @@ -35,6 +46,7 @@ export class SymbolsComponent implements OnInit { loadSymbols() { this.symbolService.list(this.server).subscribe((symbols: Symbol[]) => { this.symbols = symbols; + this.filteredSymbols = symbols; }); }