1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

[SM-497] Add filtering capabilities to the table datasource (#4717)

* Add filtering capabilities to the table datasource
This commit is contained in:
Oscar Hinton
2023-02-14 11:38:53 +01:00
committed by GitHub
parent c3dfb7735f
commit 42ba475c37
5 changed files with 104 additions and 7 deletions

View File

@@ -24,6 +24,11 @@ export class ProjectsListComponent implements OnDestroy {
}
private _projects: ProjectListView[];
@Input()
set search(search: string) {
this.dataSource.filter = search;
}
@Output() editProjectEvent = new EventEmitter<string>();
@Output() deleteProjectEvent = new EventEmitter<ProjectListView[]>();
@Output() onProjectCheckedEvent = new EventEmitter<string[]>();

View File

@@ -1,5 +1,5 @@
<sm-header>
<input bitInput [placeholder]="'searchProjects' | i18n" />
<input bitInput [placeholder]="'searchProjects' | i18n" [(ngModel)]="search" />
<sm-new-menu></sm-new-menu>
</sm-header>
<sm-projects-list
@@ -7,5 +7,6 @@
(editProjectEvent)="openEditProject($event)"
(deleteProjectEvent)="openDeleteProjectDialog($event)"
[projects]="projects$ | async"
[search]="search"
>
</sm-projects-list>

View File

@@ -21,7 +21,8 @@ import { ProjectService } from "../project.service";
templateUrl: "./projects.component.html",
})
export class ProjectsComponent implements OnInit {
projects$: Observable<ProjectListView[]>;
protected projects$: Observable<ProjectListView[]>;
protected search: string;
private organizationId: string;