1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 02:03:39 +00:00

bulk actions stubbed out. bulk delete implemented

This commit is contained in:
Kyle Spearrin
2018-06-12 17:11:24 -04:00
parent 3666ee5a87
commit 314ab61349
7 changed files with 146 additions and 8 deletions

View File

@@ -0,0 +1,34 @@
import {
Component,
EventEmitter,
Input,
Output,
} from '@angular/core';
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
@Component({
selector: 'app-vault-bulk-delete',
templateUrl: 'bulk-delete.component.html',
})
export class BulkDeleteComponent {
@Input() cipherIds: string[] = [];
@Output() onDeleted = new EventEmitter();
formPromise: Promise<any>;
constructor(private analytics: Angulartics2, private cipherService: CipherService,
private toasterService: ToasterService, private i18nService: I18nService) { }
async submit() {
this.formPromise = this.cipherService.deleteManyWithServer(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'));
}
}