diff --git a/apps/client/src/app/components/transactions-table/transactions-table.component.html b/apps/client/src/app/components/transactions-table/transactions-table.component.html index 0d6a99dba..b7d51f79c 100644 --- a/apps/client/src/app/components/transactions-table/transactions-table.component.html +++ b/apps/client/src/app/components/transactions-table/transactions-table.component.html @@ -13,16 +13,16 @@ (); @Output() transactionToUpdate = new EventEmitter(); - @ViewChild(MatSort) sort: MatSort; + @ViewChild('autocomplete') matAutocomplete: MatAutocomplete; @ViewChild('searchInput') searchInput: ElementRef; - @ViewChild('auto') matAutocomplete: MatAutocomplete; + @ViewChild(MatSort) sort: MatSort; public dataSource: MatTableDataSource = new MatTableDataSource(); public defaultDateFormat = DEFAULT_DATE_FORMAT; public displayedColumns = []; - public isLoading = true; - public routeQueryParams: Subscription; - public separatorKeysCodes: number[] = [ENTER, COMMA]; - public searchKeywords: string[] = []; - public searchControl = new FormControl(); public filteredTransactions$: Subject = new BehaviorSubject([]); public filteredTransactions: Observable< string[] > = this.filteredTransactions$.asObservable(); + public isLoading = true; + public routeQueryParams: Subscription; + public searchKeywords: string[] = []; + public searchControl = new FormControl(); + public separatorKeysCodes: number[] = [ENTER, COMMA]; private allFilteredTransactions: string[]; private unsubscribeSubject = new Subject(); @@ -102,7 +102,7 @@ export class TransactionsTableComponent const input = event.input; const value = event.value; - if ((value || '').trim()) { + if (value?.trim()) { this.searchKeywords.push(value.trim()); this.updateFilter(); } @@ -154,7 +154,7 @@ export class TransactionsTableComponent if (this.transactions) { this.dataSource = new MatTableDataSource(this.transactions); this.dataSource.filterPredicate = (data, filter) => { - let dataString = TransactionsTableComponent.getFilterableValues(data) + const dataString = TransactionsTableComponent.getFilterableValues(data) .join(' ') .toLowerCase(); let contains = true; @@ -251,9 +251,7 @@ export class TransactionsTableComponent this.getFilterableValues(transaction, fieldValues); } - return [...fieldValues] - .filter(item => item != undefined) - .sort(); + return [...fieldValues].filter((item) => item != undefined).sort(); } private static getFilterableValues( @@ -265,7 +263,6 @@ export class TransactionsTableComponent fieldValues.add(transaction.type); fieldValues.add(transaction.Account?.name); fieldValues.add(transaction.Account?.Platform?.name); - return [...fieldValues] - .filter(item => item != undefined); + return [...fieldValues].filter((item) => item != undefined); } }