From 300b606d2710b0fe11b7c20dd5a3aa91265967ec Mon Sep 17 00:00:00 2001 From: Jared Snider Date: Mon, 12 Dec 2022 11:23:29 -0500 Subject: [PATCH] SG-680 - Domain-add-edit-dialog - Confirmation required now for domain deletion --- apps/web/src/locales/en/messages.json | 6 ++++++ .../domain-add-edit-dialog.component.ts | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index e24cfb62f6b..e1289c3e94d 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -5562,6 +5562,12 @@ "invalidDomainNameMessage": { "message": "Input is not a valid format. Format: mydomain.com. Subdomains require separate entries to be verified." }, + "removeDomain": { + "message": "Remove domain" + }, + "removeDomainWarning": { + "message": "Removing a domain cannot be undone. Are you sure you want to continue?" + }, "domainRemoved": { "message": "Domain removed" }, diff --git a/bitwarden_license/bit-web/src/app/organizations/manage/domain-verification/domain-add-edit-dialog/domain-add-edit-dialog.component.ts b/bitwarden_license/bit-web/src/app/organizations/manage/domain-verification/domain-add-edit-dialog/domain-add-edit-dialog.component.ts index 6ea6c5ea68f..90045ffa052 100644 --- a/bitwarden_license/bit-web/src/app/organizations/manage/domain-verification/domain-add-edit-dialog/domain-add-edit-dialog.component.ts +++ b/bitwarden_license/bit-web/src/app/organizations/manage/domain-verification/domain-add-edit-dialog/domain-add-edit-dialog.component.ts @@ -152,11 +152,20 @@ export class DomainAddEditDialogComponent implements OnInit, OnDestroy { }; deleteDomain = async (): Promise => { - // TODO: Do I need an are you sure prompt? yes + const confirmed = await this.platformUtilsService.showDialog( + this.i18nService.t("removeDomainWarning"), + this.i18nService.t("removeDomain"), + this.i18nService.t("yes"), + this.i18nService.t("no"), + "warning" + ); + if (!confirmed) { + return; + } await this.orgDomainApiService.delete(this.data.organizationId, this.data.orgDomain.id); - this.platformUtilsService.showToast("success", null, this.i18nService.t("domainRemoved")); + this.dialogRef.close(); };