1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00

[Soft Delete] jslib updates for new API updates

New API methods and cipher Deleted Date property, plus search expansion to toggle on deleted flag.
This commit is contained in:
Chad Scharf
2020-04-03 16:32:15 -04:00
parent 28e3fff739
commit 19668ab5f2
15 changed files with 170 additions and 12 deletions

View File

@@ -21,6 +21,7 @@ export class CiphersComponent {
searchText: string;
searchPlaceholder: string = null;
filter: (cipher: CipherView) => boolean = null;
deleted: boolean = false;
protected searchPending = false;
protected didScroll = false;
@@ -32,7 +33,8 @@ export class CiphersComponent {
constructor(protected searchService: SearchService) { }
async load(filter: (cipher: CipherView) => boolean = null) {
async load(filter: (cipher: CipherView) => boolean = null, deleted: boolean = false) {
this.deleted = deleted || false;
await this.applyFilter(filter);
this.loaded = true;
}
@@ -79,13 +81,13 @@ export class CiphersComponent {
clearTimeout(this.searchTimeout);
}
if (timeout == null) {
this.ciphers = await this.searchService.searchCiphers(this.searchText, this.filter);
this.ciphers = await this.searchService.searchCiphers(this.searchText, this.filter, null, this.deleted);
await this.resetPaging();
return;
}
this.searchPending = true;
this.searchTimeout = setTimeout(async () => {
this.ciphers = await this.searchService.searchCiphers(this.searchText, this.filter);
this.ciphers = await this.searchService.searchCiphers(this.searchText, this.filter, null, this.deleted);
await this.resetPaging();
this.searchPending = false;
}, timeout);