diff --git a/jslib b/jslib index 72e3893f8e..3a10c1ff30 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 72e3893f8eee79f1e3678839aa194f1096c343ea +Subproject commit 3a10c1ff3027832953094b2f7edddb2361119b09 diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 7f3a0ed6df..1624fa7d84 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -145,6 +145,7 @@ import { AddEditComponent } from './vault/add-edit.component'; import { AttachmentsComponent } from './vault/attachments.component'; import { BulkDeleteComponent } from './vault/bulk-delete.component'; import { BulkMoveComponent } from './vault/bulk-move.component'; +import { BulkRestoreComponent } from './vault/bulk-restore.component'; import { BulkShareComponent } from './vault/bulk-share.component'; import { CiphersComponent } from './vault/ciphers.component'; import { CollectionsComponent } from './vault/collections.component'; @@ -257,6 +258,7 @@ registerLocaleData(localeZhTw, 'zh-TW'); BreachReportComponent, BulkDeleteComponent, BulkMoveComponent, + BulkRestoreComponent, BulkShareComponent, CalloutComponent, ChangeEmailComponent, @@ -375,6 +377,7 @@ registerLocaleData(localeZhTw, 'zh-TW'); AttachmentsComponent, BulkDeleteComponent, BulkMoveComponent, + BulkRestoreComponent, BulkShareComponent, CollectionsComponent, DeauthorizeSessionsComponent, diff --git a/src/app/organizations/vault/add-edit.component.ts b/src/app/organizations/vault/add-edit.component.ts index fe2c3c2c71..e19fd17629 100644 --- a/src/app/organizations/vault/add-edit.component.ts +++ b/src/app/organizations/vault/add-edit.component.ts @@ -94,6 +94,7 @@ export class AddEditComponent extends BaseAddEditComponent { if (!this.organization.isAdmin) { return super.deleteCipher(); } - return this.apiService.deleteCipherAdmin(this.cipherId); + return this.cipher.isDeleted ? this.apiService.deleteCipherAdmin(this.cipherId) + : this.apiService.putDeleteCipherAdmin(this.cipherId); } } diff --git a/src/app/organizations/vault/ciphers.component.ts b/src/app/organizations/vault/ciphers.component.ts index 63a3f9a7cf..ea990cd75a 100644 --- a/src/app/organizations/vault/ciphers.component.ts +++ b/src/app/organizations/vault/ciphers.component.ts @@ -41,7 +41,7 @@ export class CiphersComponent extends BaseCiphersComponent { async load(filter: (cipher: CipherView) => boolean = null) { if (!this.organization.isAdmin) { - await super.load(filter); + await super.load(filter, this.deleted); return; } this.accessEvents = this.organization.useEvents; @@ -65,13 +65,19 @@ export class CiphersComponent extends BaseCiphersComponent { } this.searchPending = false; let filteredCiphers = this.allCiphers; - if (this.filter != null) { - filteredCiphers = filteredCiphers.filter(this.filter); - } + if (this.searchText == null || this.searchText.trim().length < 2) { - this.ciphers = filteredCiphers; + this.ciphers = filteredCiphers.filter((c) => { + if (c.isDeleted !== this.deleted) { + return false; + } + return this.filter == null || this.filter(c); + }); } else { - this.ciphers = this.searchService.searchCiphersBasic(filteredCiphers, this.searchText); + if (this.filter != null) { + filteredCiphers = filteredCiphers.filter(this.filter); + } + this.ciphers = this.searchService.searchCiphersBasic(filteredCiphers, this.searchText, this.deleted); } await this.resetPaging(); } @@ -86,9 +92,9 @@ export class CiphersComponent extends BaseCiphersComponent { protected deleteCipher(id: string) { if (!this.organization.isAdmin) { - return super.deleteCipher(id); + return super.deleteCipher(id, this.deleted); } - return this.apiService.deleteCipherAdmin(id); + return this.deleted ? this.apiService.deleteCipherAdmin(id) : this.apiService.putDeleteCipherAdmin(id); } protected showFixOldAttachments(c: CipherView) { diff --git a/src/app/organizations/vault/vault.component.html b/src/app/organizations/vault/vault.component.html index 361f0a3efa..3f836dee51 100644 --- a/src/app/organizations/vault/vault.component.html +++ b/src/app/organizations/vault/vault.component.html @@ -1,9 +1,10 @@