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

PM-171 remove confirmation alerts for restoring an item (#5799)

* remove confirmation alerts for restoring an item from trash and remove bulk-restore-dialog from vault individual and org
This commit is contained in:
Jason Ng
2023-08-15 15:15:13 -04:00
committed by GitHub
parent 15f29c5fb1
commit 8593966a71
10 changed files with 8 additions and 185 deletions

View File

@@ -71,10 +71,6 @@ import {
BulkDeleteDialogResult,
openBulkDeleteDialog,
} from "../individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component";
import {
BulkRestoreDialogResult,
openBulkRestoreDialog,
} from "../individual-vault/bulk-action-dialogs/bulk-restore-dialog/bulk-restore-dialog.component";
import { RoutedVaultFilterBridgeService } from "../individual-vault/vault-filter/services/routed-vault-filter-bridge.service";
import { RoutedVaultFilterService } from "../individual-vault/vault-filter/services/routed-vault-filter.service";
import { createFilterFunction } from "../individual-vault/vault-filter/shared/models/filter-function";
@@ -669,16 +665,6 @@ export class VaultComponent implements OnInit, OnDestroy {
return;
}
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "restoreItem" },
content: { key: "restoreItemConfirmation" },
type: SimpleDialogType.WARNING,
});
if (!confirmed) {
return false;
}
try {
const asAdmin = this.organization?.canEditAnyCollection;
await this.cipherService.restoreWithServer(c.id, asAdmin);
@@ -704,14 +690,9 @@ export class VaultComponent implements OnInit, OnDestroy {
return;
}
const dialog = openBulkRestoreDialog(this.dialogService, {
data: { cipherIds: selectedCipherIds, organization: this.organization },
});
const result = await lastValueFrom(dialog.closed);
if (result === BulkRestoreDialogResult.Restored) {
this.refresh();
}
await this.cipherService.restoreManyWithServer(selectedCipherIds);
this.platformUtilsService.showToast("success", null, this.i18nService.t("restoredItems"));
this.refresh();
}
async deleteCipher(c: CipherView): Promise<boolean> {