diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json
index 63dd227e52..400e75dd1b 100644
--- a/apps/browser/src/_locales/en/messages.json
+++ b/apps/browser/src/_locales/en/messages.json
@@ -1446,9 +1446,6 @@
"restoreItem": {
"message": "Restore item"
},
- "restoreItemConfirmation": {
- "message": "Are you sure you want to restore this item?"
- },
"restoredItem": {
"message": "Item restored"
},
diff --git a/apps/desktop/src/locales/en/messages.json b/apps/desktop/src/locales/en/messages.json
index 57ba39d673..ab8446ee46 100644
--- a/apps/desktop/src/locales/en/messages.json
+++ b/apps/desktop/src/locales/en/messages.json
@@ -1512,12 +1512,6 @@
"permanentlyDeletedItem": {
"message": "Item permanently deleted"
},
- "restoreItem": {
- "message": "Restore item"
- },
- "restoreItemConfirmation": {
- "message": "Are you sure you want to restore this item?"
- },
"restoredItem": {
"message": "Item restored"
},
diff --git a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-dialogs.module.ts b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-dialogs.module.ts
index 0618025bbf..848f5629da 100644
--- a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-dialogs.module.ts
+++ b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-dialogs.module.ts
@@ -4,22 +4,11 @@ import { SharedModule } from "../../../shared";
import { BulkDeleteDialogComponent } from "./bulk-delete-dialog/bulk-delete-dialog.component";
import { BulkMoveDialogComponent } from "./bulk-move-dialog/bulk-move-dialog.component";
-import { BulkRestoreDialogComponent } from "./bulk-restore-dialog/bulk-restore-dialog.component";
import { BulkShareDialogComponent } from "./bulk-share-dialog/bulk-share-dialog.component";
@NgModule({
imports: [SharedModule],
- declarations: [
- BulkDeleteDialogComponent,
- BulkMoveDialogComponent,
- BulkRestoreDialogComponent,
- BulkShareDialogComponent,
- ],
- exports: [
- BulkDeleteDialogComponent,
- BulkMoveDialogComponent,
- BulkRestoreDialogComponent,
- BulkShareDialogComponent,
- ],
+ declarations: [BulkDeleteDialogComponent, BulkMoveDialogComponent, BulkShareDialogComponent],
+ exports: [BulkDeleteDialogComponent, BulkMoveDialogComponent, BulkShareDialogComponent],
})
export class BulkDialogsModule {}
diff --git a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-restore-dialog/bulk-restore-dialog.component.html b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-restore-dialog/bulk-restore-dialog.component.html
deleted file mode 100644
index 9cfe1bf69b..0000000000
--- a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-restore-dialog/bulk-restore-dialog.component.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- {{ "restoreSelected" | i18n }}
-
-
- {{ "restoreSelectedItemsDesc" | i18n : cipherIds.length }}
-
-
-
-
-
-
diff --git a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-restore-dialog/bulk-restore-dialog.component.ts b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-restore-dialog/bulk-restore-dialog.component.ts
deleted file mode 100644
index 94685f9fda..0000000000
--- a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-restore-dialog/bulk-restore-dialog.component.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import { DialogConfig, DialogRef, DIALOG_DATA } from "@angular/cdk/dialog";
-import { Component, Inject } from "@angular/core";
-
-import { DialogServiceAbstraction } from "@bitwarden/angular/services/dialog";
-import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
-import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
-import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
-import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service";
-
-export interface BulkRestoreDialogParams {
- cipherIds: string[];
- organization?: Organization;
-}
-
-export enum BulkRestoreDialogResult {
- Restored = "restored",
- Canceled = "canceled",
-}
-
-/**
- * Strongly typed helper to open a BulkRestoreDialog
- * @param dialogService Instance of the dialog service that will be used to open the dialog
- * @param config Configuration for the dialog
- */
-export const openBulkRestoreDialog = (
- dialogService: DialogServiceAbstraction,
- config: DialogConfig
-) => {
- return dialogService.open(
- BulkRestoreDialogComponent,
- config
- );
-};
-
-@Component({
- templateUrl: "bulk-restore-dialog.component.html",
-})
-export class BulkRestoreDialogComponent {
- cipherIds: string[];
- organization?: Organization;
-
- constructor(
- @Inject(DIALOG_DATA) params: BulkRestoreDialogParams,
- private dialogRef: DialogRef,
- private cipherService: CipherService,
- private platformUtilsService: PlatformUtilsService,
- private i18nService: I18nService
- ) {
- this.cipherIds = params.cipherIds ?? [];
- this.organization = params.organization;
- }
-
- submit = async () => {
- const asAdmin = this.organization?.canEditAnyCollection;
- await this.cipherService.restoreManyWithServer(this.cipherIds, this.organization?.id, asAdmin);
- this.platformUtilsService.showToast("success", null, this.i18nService.t("restoredItems"));
- this.close(BulkRestoreDialogResult.Restored);
- };
-
- protected cancel() {
- this.close(BulkRestoreDialogResult.Canceled);
- }
-
- private close(result: BulkRestoreDialogResult) {
- this.dialogRef.close(result);
- }
-}
diff --git a/apps/web/src/app/vault/individual-vault/vault.component.ts b/apps/web/src/app/vault/individual-vault/vault.component.ts
index ba32a27aed..b0cd2eb958 100644
--- a/apps/web/src/app/vault/individual-vault/vault.component.ts
+++ b/apps/web/src/app/vault/individual-vault/vault.component.ts
@@ -75,10 +75,6 @@ import {
BulkMoveDialogResult,
openBulkMoveDialog,
} from "./bulk-action-dialogs/bulk-move-dialog/bulk-move-dialog.component";
-import {
- BulkRestoreDialogResult,
- openBulkRestoreDialog,
-} from "./bulk-action-dialogs/bulk-restore-dialog/bulk-restore-dialog.component";
import {
BulkShareDialogResult,
openBulkShareDialog,
@@ -683,16 +679,6 @@ export class VaultComponent implements OnInit, OnDestroy {
return;
}
- const confirmed = await this.dialogService.openSimpleDialog({
- title: { key: "restoreItemConfirmation" },
- content: { key: "restoreItem" },
- type: SimpleDialogType.WARNING,
- });
-
- if (!confirmed) {
- return false;
- }
-
try {
await this.cipherService.restoreWithServer(c.id);
this.platformUtilsService.showToast("success", null, this.i18nService.t("restoredItem"));
@@ -717,14 +703,9 @@ export class VaultComponent implements OnInit, OnDestroy {
return;
}
- const dialog = openBulkRestoreDialog(this.dialogService, {
- data: { cipherIds: selectedCipherIds },
- });
-
- 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 {
diff --git a/apps/web/src/app/vault/org-vault/vault.component.ts b/apps/web/src/app/vault/org-vault/vault.component.ts
index cfeafbf032..dc12eeba49 100644
--- a/apps/web/src/app/vault/org-vault/vault.component.ts
+++ b/apps/web/src/app/vault/org-vault/vault.component.ts
@@ -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 {
diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json
index 97ad4adb40..316dd8b68c 100644
--- a/apps/web/src/locales/en/messages.json
+++ b/apps/web/src/locales/en/messages.json
@@ -3842,30 +3842,12 @@
"restoreSelected": {
"message": "Restore selected"
},
- "restoreItem": {
- "message": "Restore item"
- },
"restoredItem": {
"message": "Item restored"
},
"restoredItems": {
"message": "Items restored"
},
- "restoreItemConfirmation": {
- "message": "Are you sure you want to restore this item?"
- },
- "restoreItems": {
- "message": "Restore items"
- },
- "restoreSelectedItemsDesc": {
- "message": "You have selected $COUNT$ item(s) to restore. Are you sure you want to restore these items?",
- "placeholders": {
- "count": {
- "content": "$1",
- "example": "150"
- }
- }
- },
"restoredItemId": {
"message": "Item $ID$ restored",
"placeholders": {
diff --git a/libs/angular/src/vault/components/add-edit.component.ts b/libs/angular/src/vault/components/add-edit.component.ts
index 52780ae395..44da000a7b 100644
--- a/libs/angular/src/vault/components/add-edit.component.ts
+++ b/libs/angular/src/vault/components/add-edit.component.ts
@@ -433,16 +433,6 @@ export class AddEditComponent implements OnInit, OnDestroy {
return false;
}
- const confirmed = await this.dialogService.openSimpleDialog({
- title: { key: "restoreItem" },
- content: { key: "restoreItemConfirmation" },
- type: SimpleDialogType.WARNING,
- });
-
- if (!confirmed) {
- return false;
- }
-
try {
this.restorePromise = this.restoreCipher();
await this.restorePromise;
diff --git a/libs/angular/src/vault/components/view.component.ts b/libs/angular/src/vault/components/view.component.ts
index 1236e07bd7..7ba14b97f8 100644
--- a/libs/angular/src/vault/components/view.component.ts
+++ b/libs/angular/src/vault/components/view.component.ts
@@ -209,16 +209,6 @@ export class ViewComponent implements OnDestroy, OnInit {
return false;
}
- const confirmed = await this.dialogService.openSimpleDialog({
- title: { key: "restoreItem" },
- content: { key: "restoreItemConfirmation" },
- type: SimpleDialogType.WARNING,
- });
-
- if (!confirmed) {
- return false;
- }
-
try {
await this.restoreCipher();
this.platformUtilsService.showToast("success", null, this.i18nService.t("restoredItem"));