" + + return await this.dialogService.openSimpleDialog({ + title: { key: "confirmVaultExport" }, + content: this.i18nService.t("encExportKeyWarningDesc") + - "
" +
+ " " +
this.i18nService.t("encExportAccountWarningDesc"),
- this.i18nService.t("confirmVaultExport"),
- this.i18nService.t("exportVault"),
- this.i18nService.t("cancel"),
- "warning",
- true
- );
+ acceptButtonText: { key: "exportVault" },
+ type: SimpleDialogType.WARNING,
+ });
} else {
- return await this.platformUtilsService.showDialog(
- this.i18nService.t("exportWarningDesc"),
- this.i18nService.t("confirmVaultExport"),
- this.i18nService.t("exportVault"),
- this.i18nService.t("cancel"),
- "warning"
- );
+ return await this.dialogService.openSimpleDialog({
+ title: { key: "confirmVaultExport" },
+ content: { key: "exportWarningDesc" },
+ acceptButtonText: { key: "exportVault" },
+ type: SimpleDialogType.WARNING,
+ });
}
}
diff --git a/libs/angular/src/tools/send/add-edit.component.ts b/libs/angular/src/tools/send/add-edit.component.ts
index eb04c06dd7f..747df5780cb 100644
--- a/libs/angular/src/tools/send/add-edit.component.ts
+++ b/libs/angular/src/tools/send/add-edit.component.ts
@@ -19,6 +19,8 @@ import { SendView } from "@bitwarden/common/tools/send/models/view/send.view";
import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction";
import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction";
+import { DialogServiceAbstraction, SimpleDialogType } from "../../services/dialog";
+
@Directive()
export class AddEditComponent implements OnInit, OnDestroy {
@Input() sendId: string;
@@ -60,7 +62,8 @@ export class AddEditComponent implements OnInit, OnDestroy {
protected policyService: PolicyService,
private logService: LogService,
protected stateService: StateService,
- protected sendApiService: SendApiService
+ protected sendApiService: SendApiService,
+ protected dialogService: DialogServiceAbstraction
) {
this.typeOptions = [
{ name: i18nService.t("sendTypeFile"), value: SendType.File },
@@ -229,15 +232,13 @@ export class AddEditComponent implements OnInit, OnDestroy {
if (this.deletePromise != null) {
return false;
}
- const confirmed = await this.platformUtilsService.showDialog(
- this.i18nService.t("deleteSendConfirmation"),
- this.i18nService.t("deleteSend"),
- this.i18nService.t("yes"),
- this.i18nService.t("no"),
- "warning",
- false,
- this.componentName != "" ? this.componentName + " .modal-content" : null
- );
+
+ const confirmed = await this.dialogService.openSimpleDialog({
+ title: { key: "deleteSend" },
+ content: { key: "deleteSendConfirmation" },
+ type: SimpleDialogType.WARNING,
+ });
+
if (!confirmed) {
return false;
}
@@ -308,14 +309,14 @@ export class AddEditComponent implements OnInit, OnDestroy {
this.i18nService.t(this.editMode ? "editedSend" : "createdSend")
);
} else {
- await this.platformUtilsService.showDialog(
- this.i18nService.t(this.editMode ? "editedSend" : "createdSend"),
- null,
- this.i18nService.t("ok"),
- null,
- "success",
- null
- );
+ await this.dialogService.openSimpleDialog({
+ title: "",
+ content: { key: this.editMode ? "editedSend" : "createdSend" },
+ acceptButtonText: { key: "ok" },
+ cancelButtonText: null,
+ type: SimpleDialogType.SUCCESS,
+ });
+
await this.copyLinkToClipboard(this.link);
}
}
diff --git a/libs/angular/src/tools/send/send.component.ts b/libs/angular/src/tools/send/send.component.ts
index 3c197e73f71..bec82d7c69a 100644
--- a/libs/angular/src/tools/send/send.component.ts
+++ b/libs/angular/src/tools/send/send.component.ts
@@ -13,6 +13,8 @@ import { SendView } from "@bitwarden/common/tools/send/models/view/send.view";
import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction";
import { SendService } from "@bitwarden/common/tools/send/services/send.service.abstraction";
+import { DialogServiceAbstraction, SimpleDialogType } from "../../services/dialog";
+
@Directive()
export class SendComponent implements OnInit, OnDestroy {
disableSend = false;
@@ -49,7 +51,8 @@ export class SendComponent implements OnInit, OnDestroy {
protected searchService: SearchService,
protected policyService: PolicyService,
private logService: LogService,
- protected sendApiService: SendApiService
+ protected sendApiService: SendApiService,
+ protected dialogService: DialogServiceAbstraction
) {}
async ngOnInit() {
@@ -125,13 +128,13 @@ export class SendComponent implements OnInit, OnDestroy {
if (this.actionPromise != null || s.password == null) {
return;
}
- const confirmed = await this.platformUtilsService.showDialog(
- this.i18nService.t("removePasswordConfirmation"),
- this.i18nService.t("removePassword"),
- this.i18nService.t("yes"),
- this.i18nService.t("no"),
- "warning"
- );
+
+ const confirmed = await this.dialogService.openSimpleDialog({
+ title: { key: "removePassword" },
+ content: { key: "removePasswordConfirmation" },
+ type: SimpleDialogType.WARNING,
+ });
+
if (!confirmed) {
return false;
}
@@ -156,13 +159,13 @@ export class SendComponent implements OnInit, OnDestroy {
if (this.actionPromise != null) {
return false;
}
- const confirmed = await this.platformUtilsService.showDialog(
- this.i18nService.t("deleteSendConfirmation"),
- this.i18nService.t("deleteSend"),
- this.i18nService.t("yes"),
- this.i18nService.t("no"),
- "warning"
- );
+
+ const confirmed = await this.dialogService.openSimpleDialog({
+ title: { key: "deleteSend" },
+ content: { key: "deleteSendConfirmation" },
+ type: SimpleDialogType.WARNING,
+ });
+
if (!confirmed) {
return false;
}
diff --git a/libs/angular/src/vault/components/add-edit.component.ts b/libs/angular/src/vault/components/add-edit.component.ts
index 54dccfd2e92..2d53d6a7d98 100644
--- a/libs/angular/src/vault/components/add-edit.component.ts
+++ b/libs/angular/src/vault/components/add-edit.component.ts
@@ -34,6 +34,8 @@ import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view
import { LoginView } from "@bitwarden/common/vault/models/view/login.view";
import { SecureNoteView } from "@bitwarden/common/vault/models/view/secure-note.view";
+import { DialogServiceAbstraction, SimpleDialogType } from "../../services/dialog";
+
@Directive()
export class AddEditComponent implements OnInit, OnDestroy {
@Input() cloneMode = false;
@@ -98,7 +100,8 @@ export class AddEditComponent implements OnInit, OnDestroy {
private logService: LogService,
protected passwordRepromptService: PasswordRepromptService,
private organizationService: OrganizationService,
- protected sendApiService: SendApiService
+ protected sendApiService: SendApiService,
+ protected dialogService: DialogServiceAbstraction
) {
this.typeOptions = [
{ name: i18nService.t("typeLogin"), value: CipherType.Login },
@@ -390,17 +393,14 @@ export class AddEditComponent implements OnInit, OnDestroy {
}
async delete(): PromiseDialog Type Examples:
@@ -114,8 +110,7 @@ import { SimpleDialogType } from "./models/simple-dialog-type.enum";