1
0
mirror of https://github.com/bitwarden/web synced 2025-12-15 07:43:16 +00:00

[Soft Delete] - Added trash and related functionality to web vault

This commit is contained in:
Chad Scharf
2020-04-08 16:48:30 -04:00
parent fb6e85c56b
commit 41a0cfd0a2
19 changed files with 397 additions and 99 deletions

View File

@@ -17,6 +17,7 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
})
export class BulkDeleteComponent {
@Input() cipherIds: string[] = [];
@Input() permanent: boolean = false;
@Output() onDeleted = new EventEmitter();
formPromise: Promise<any>;
@@ -25,10 +26,12 @@ export class BulkDeleteComponent {
private toasterService: ToasterService, private i18nService: I18nService) { }
async submit() {
this.formPromise = this.cipherService.deleteManyWithServer(this.cipherIds);
this.formPromise = this.permanent ? this.cipherService.deleteManyWithServer(this.cipherIds) :
this.cipherService.softDeleteManyWithServer(this.cipherIds);
await this.formPromise;
this.onDeleted.emit();
this.analytics.eventTrack.next({ action: 'Bulk Deleted Items' });
this.toasterService.popAsync('success', null, this.i18nService.t('deletedItems'));
this.toasterService.popAsync('success', null, this.i18nService.t(this.permanent ? 'permanentlyDeletedItems'
: 'deletedItems'));
}
}