From 5c345c9ee433f82e51d2c4a18cfbb27ab027872f Mon Sep 17 00:00:00 2001 From: Alex Morask <144709477+amorask-bitwarden@users.noreply.github.com> Date: Thu, 12 Dec 2024 07:07:50 -0500 Subject: [PATCH] [PM-15094] Update remove sponsorship modal content (#12319) * Update remove sponsorship modal content * PM-15915 --- .../settings/sponsoring-org-row.component.ts | 21 ++++++++++------ apps/web/src/locales/en/messages.json | 25 ++++++++++++++++--- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/apps/web/src/app/billing/settings/sponsoring-org-row.component.ts b/apps/web/src/app/billing/settings/sponsoring-org-row.component.ts index 59b68ceef83..b40902112c8 100644 --- a/apps/web/src/app/billing/settings/sponsoring-org-row.component.ts +++ b/apps/web/src/app/billing/settings/sponsoring-org-row.component.ts @@ -12,7 +12,6 @@ import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; -import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { DialogService, ToastService } from "@bitwarden/components"; @Component({ @@ -35,7 +34,6 @@ export class SponsoringOrgRowComponent implements OnInit { private apiService: ApiService, private i18nService: I18nService, private logService: LogService, - private platformUtilsService: PlatformUtilsService, private dialogService: DialogService, private toastService: ToastService, private configService: ConfigService, @@ -87,14 +85,21 @@ export class SponsoringOrgRowComponent implements OnInit { }); } - get isSentAwaitingSync() { - return this.isSelfHosted && !this.sponsoringOrg.familySponsorshipLastSyncDate; - } - private async doRevokeSponsorship() { + const content = this.sponsoringOrg.familySponsorshipValidUntil + ? this.i18nService.t( + "updatedRevokeSponsorshipConfirmationForAcceptedSponsorship", + this.sponsoringOrg.familySponsorshipFriendlyName, + formatDate(this.sponsoringOrg.familySponsorshipValidUntil, "MM/dd/yyyy", this.locale), + ) + : this.i18nService.t( + "updatedRevokeSponsorshipConfirmationForSentSponsorship", + this.sponsoringOrg.familySponsorshipFriendlyName, + ); + const confirmed = await this.dialogService.openSimpleDialog({ - title: `${this.i18nService.t("remove")} ${this.sponsoringOrg.familySponsorshipFriendlyName}?`, - content: { key: "revokeSponsorshipConfirmation" }, + title: `${this.i18nService.t("removeSponsorship")}?`, + content, acceptButtonText: { key: "remove" }, type: "warning", }); diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index b1203230688..aca22376132 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -6156,9 +6156,6 @@ "emailSent": { "message": "Email sent" }, - "revokeSponsorshipConfirmation": { - "message": "After removing this account, the Families plan sponsorship will expire at the end of the billing period. You will not be able to redeem a new sponsorship offer until the existing one expires. Are you sure you want to continue?" - }, "removeSponsorshipSuccess": { "message": "Sponsorship removed" }, @@ -9959,5 +9956,27 @@ "example": "bitwarden.com" } } + }, + "updatedRevokeSponsorshipConfirmationForSentSponsorship": { + "message": "If you remove $EMAIL$, the sponsorship for this Family plan cannot be redeemed. Are you sure you want to continue?", + "placeholders": { + "email": { + "content": "$1", + "example": "sponsored@organization.com" + } + } + }, + "updatedRevokeSponsorshipConfirmationForAcceptedSponsorship": { + "message": "If you remove $EMAIL$, the sponsorship for this Family plan will end and the saved payment method will be charged $40 + applicable tax on $DATE$. You will not be able to redeem a new sponsorship until $DATE$. Are you sure you want to continue?", + "placeholders": { + "email": { + "content": "$1", + "example": "sponsored@organization.com" + }, + "date": { + "content": "$2", + "example": "12/10/2024" + } + } } }