Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ <h1 class="mat-h2 connection-title">{{connectionTitle}}</h1>
<mat-form-field *ngIf="!collapsed" appearance="fill" class="search-input">
<input matInput name="search" #search="ngModel"
placeholder="Search"
[(ngModel)]="searchString"
(keyup)="serach()">
[(ngModel)]="substringToSearch"
(keyup)="searchSubstring()">
<mat-error *ngIf="foundTables.length === 0">Nothing found.</mat-error>
</mat-form-field>
<mat-nav-list data-testid="tables-list">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class DbTablesListComponent {
@Input() selectedTable: string;
@Input() collapsed: boolean;

public searchString: string;
public substringToSearch: string;
public foundTables: TableProperties[];
constructor(
private _tableState: TableStateService,
Expand All @@ -45,9 +45,9 @@ export class DbTablesListComponent {
this.foundTables = this.tables;
}

serach() {
searchSubstring() {
this.foundTables = this.tables
.filter(tableItem => tableItem.table.toLowerCase().includes(this.searchString.toLowerCase()) || (tableItem.display_name && tableItem.display_name.toLowerCase().includes(this.searchString.toLowerCase())));
.filter(tableItem => tableItem.table.toLowerCase().includes(this.substringToSearch?.toLowerCase()) || (tableItem.display_name && tableItem.display_name.toLowerCase().includes(this.substringToSearch.toLowerCase())));
}

getTableName(table: TableProperties) {
Expand Down