1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-04-01 17:57:27 +02:00

[PM-15094] Update remove sponsorship modal content (#12319)

* Update remove sponsorship modal content

* PM-15915
This commit is contained in:
Alex Morask 2024-12-12 07:07:50 -05:00 committed by GitHub
parent f8c33ea04b
commit 5c345c9ee4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 11 deletions

View File

@ -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",
});

View File

@ -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"
}
}
}
}