feat(billing): update cancel survey options for Teams and Enterprise orgs

pull/20198/head
Alex Morask 2 months ago
parent becc7ed4e1
commit aa7e93c7a5
No known key found for this signature in database
GPG Key ID: 23E38285B743E3A8

@ -345,6 +345,7 @@ export class OrganizationSubscriptionCloudComponent implements OnInit, OnDestroy
type: "Organization",
id: this.organizationId,
plan: this.sub.plan.type,
productTier: this.sub.plan.productTier,
},
});

@ -7,6 +7,7 @@ import { FormBuilder, Validators } from "@angular/forms";
import { BillingApiServiceAbstraction as BillingApiService } from "@bitwarden/common/billing/abstractions/billing-api.service.abstraction";
import { PlanType } from "@bitwarden/common/billing/enums";
import { ProductTierType } from "@bitwarden/common/billing/enums/product-tier-type.enum";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import {
@ -25,6 +26,7 @@ type OrganizationOffboardingParams = {
type: "Organization";
id: string;
plan: PlanType;
productTier: ProductTierType;
};
export type OffboardingSurveyDialogParams = UserOffboardingParams | OrganizationOffboardingParams;
@ -76,32 +78,31 @@ export class OffboardingSurveyComponent {
private platformUtilsService: PlatformUtilsService,
private toastService: ToastService,
) {
const isBusiness = this.isBusinessPlan();
this.reasons = [
{
value: null,
text: this.i18nService.t("selectPlaceholder"),
},
{ value: null, text: this.i18nService.t("selectPlaceholder") },
{
value: "missing_features",
text: this.i18nService.t("missingFeatures"),
text: this.i18nService.t(isBusiness ? "cancelSurveyDidntMeetNeeds" : "missingFeatures"),
},
{
value: "switched_service",
text: this.i18nService.t("movingToAnotherTool"),
text: this.i18nService.t(
isBusiness ? "cancelSurveyTeamPrioritiesChanged" : "movingToAnotherTool",
),
},
{
value: "too_complex",
text: this.i18nService.t("tooDifficultToUse"),
text: this.i18nService.t(isBusiness ? "cancelSurveyOrgRestructuring" : "tooDifficultToUse"),
},
{
value: "unused",
text: this.i18nService.t("notUsingEnough"),
},
this.getSwitchingReason(),
{
value: "other",
text: this.i18nService.t("other"),
text: this.i18nService.t(isBusiness ? "cancelSurveyDidntUseIt" : "notUsingEnough"),
},
...(isBusiness
? [{ value: "too_expensive", text: this.i18nService.t("cancelSurveyNotInBudget") }]
: [this.getSwitchingReason(), { value: "other", text: this.i18nService.t("other") }]),
];
}
@ -130,6 +131,15 @@ export class OffboardingSurveyComponent {
this.dialogRef.close(this.ResultType.Submitted);
};
private isBusinessPlan(): boolean {
return (
this.dialogParams.type === "Organization" &&
[ProductTierType.Teams, ProductTierType.Enterprise, ProductTierType.TeamsStarter].includes(
this.dialogParams.productTier,
)
);
}
private getSwitchingReason(): Reason {
if (this.dialogParams.type === "User") {
return {

@ -10375,6 +10375,26 @@
"message": "Switching to free organization",
"description": "An option for the offboarding survey shown when a user cancels their subscription."
},
"cancelSurveyDidntMeetNeeds": {
"message": "It didn't meet our needs",
"description": "An option for the offboarding survey shown when a Teams or Enterprise organization cancels their subscription."
},
"cancelSurveyTeamPrioritiesChanged": {
"message": "Our team or priorities have changed",
"description": "An option for the offboarding survey shown when a Teams or Enterprise organization cancels their subscription."
},
"cancelSurveyOrgRestructuring": {
"message": "Our organization is restructuring or closing",
"description": "An option for the offboarding survey shown when a Teams or Enterprise organization cancels their subscription."
},
"cancelSurveyDidntUseIt": {
"message": "We didn't end up using it",
"description": "An option for the offboarding survey shown when a Teams or Enterprise organization cancels their subscription."
},
"cancelSurveyNotInBudget": {
"message": "It's not in our budget right now",
"description": "An option for the offboarding survey shown when a Teams or Enterprise organization cancels their subscription."
},
"freeForOneYear": {
"message": "Free for 1 year"
},

Loading…
Cancel
Save