From 0516ca00dc9d22dbe3856bd5b82cf261b5e8f14c Mon Sep 17 00:00:00 2001 From: Nick Krantz <125900171+nick-livefront@users.noreply.github.com> Date: Fri, 20 Sep 2024 09:48:44 -0500 Subject: [PATCH] update trial initiation text to only represent the product (#11171) Co-authored-by: Alec Rippberger --- .../resolver/free-trial-text.resolver.spec.ts | 55 ++++++------------- .../resolver/free-trial-text.resolver.ts | 31 ++--------- apps/web/src/locales/en/messages.json | 39 ++----------- 3 files changed, 27 insertions(+), 98 deletions(-) diff --git a/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.spec.ts b/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.spec.ts index f9831c6dc4..2c58d614c5 100644 --- a/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.spec.ts +++ b/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.spec.ts @@ -1,6 +1,6 @@ import { ActivatedRouteSnapshot, RouterStateSnapshot } from "@angular/router"; -import { ProductTierType, ProductType } from "@bitwarden/common/billing/enums"; +import { ProductType } from "@bitwarden/common/billing/enums"; import { freeTrialTextResolver } from "./free-trial-text.resolver"; @@ -11,48 +11,25 @@ const route = { const routerStateSnapshot = {} as RouterStateSnapshot; describe("freeTrialTextResolver", () => { - [ - { - param: ProductType.PasswordManager, - keyBase: "startYour7DayFreeTrialOfBitwardenPasswordManager", - }, - { - param: ProductType.SecretsManager, - keyBase: "startYour7DayFreeTrialOfBitwardenSecretsManager", - }, - { - param: `${ProductType.PasswordManager},${ProductType.SecretsManager}`, - keyBase: "startYour7DayFreeTrialOfBitwarden", - }, - ].forEach(({ param, keyBase }) => { - describe(`when product is ${param}`, () => { - beforeEach(() => { - route.queryParams.product = `${param}`; - }); + it("shows password manager text", () => { + route.queryParams.product = `${ProductType.PasswordManager}`; - it("returns teams trial text", () => { - route.queryParams.productTier = ProductTierType.Teams; + expect(freeTrialTextResolver(route, routerStateSnapshot)).toBe( + "continueSettingUpFreeTrialPasswordManager", + ); + }); - expect(freeTrialTextResolver(route, routerStateSnapshot)).toBe(`${keyBase}ForTeams`); - }); + it("shows secret manager text", () => { + route.queryParams.product = `${ProductType.SecretsManager}`; - it("returns enterprise trial text", () => { - route.queryParams.productTier = ProductTierType.Enterprise; + expect(freeTrialTextResolver(route, routerStateSnapshot)).toBe( + "continueSettingUpFreeTrialSecretsManager", + ); + }); - expect(freeTrialTextResolver(route, routerStateSnapshot)).toBe(`${keyBase}ForEnterprise`); - }); + it("shows default text", () => { + route.queryParams.product = `${ProductType.PasswordManager},${ProductType.SecretsManager}`; - it("returns families trial text", () => { - route.queryParams.productTier = ProductTierType.Families; - - expect(freeTrialTextResolver(route, routerStateSnapshot)).toBe(`${keyBase}ForFamilies`); - }); - - it("returns default trial text", () => { - route.queryParams.productTier = ""; - - expect(freeTrialTextResolver(route, routerStateSnapshot)).toBe(keyBase); - }); - }); + expect(freeTrialTextResolver(route, routerStateSnapshot)).toBe("continueSettingUpFreeTrial"); }); }); diff --git a/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.ts b/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.ts index 7dec807fd4..cd23ef5ff7 100644 --- a/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.ts +++ b/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.ts @@ -1,43 +1,22 @@ import { ActivatedRouteSnapshot, ResolveFn } from "@angular/router"; -import { ProductType, ProductTierType } from "@bitwarden/common/billing/enums"; +import { ProductType } from "@bitwarden/common/billing/enums"; export const freeTrialTextResolver: ResolveFn = ( route: ActivatedRouteSnapshot, ): string | null => { - const { product, productTier } = route.queryParams; + const { product } = route.queryParams; const products: ProductType[] = (product ?? "").split(",").map((p: string) => parseInt(p)); const onlyPasswordManager = products.length === 1 && products[0] === ProductType.PasswordManager; const onlySecretsManager = products.length === 1 && products[0] === ProductType.SecretsManager; - const forTeams = parseInt(productTier) === ProductTierType.Teams; - const forEnterprise = parseInt(productTier) === ProductTierType.Enterprise; - const forFamilies = parseInt(productTier) === ProductTierType.Families; switch (true) { - case onlyPasswordManager && forTeams: - return "startYour7DayFreeTrialOfBitwardenPasswordManagerForTeams"; - case onlyPasswordManager && forEnterprise: - return "startYour7DayFreeTrialOfBitwardenPasswordManagerForEnterprise"; - case onlyPasswordManager && forFamilies: - return "startYour7DayFreeTrialOfBitwardenPasswordManagerForFamilies"; case onlyPasswordManager: - return "startYour7DayFreeTrialOfBitwardenPasswordManager"; - case onlySecretsManager && forTeams: - return "startYour7DayFreeTrialOfBitwardenSecretsManagerForTeams"; - case onlySecretsManager && forEnterprise: - return "startYour7DayFreeTrialOfBitwardenSecretsManagerForEnterprise"; - case onlySecretsManager && forFamilies: - return "startYour7DayFreeTrialOfBitwardenSecretsManagerForFamilies"; + return "continueSettingUpFreeTrialPasswordManager"; case onlySecretsManager: - return "startYour7DayFreeTrialOfBitwardenSecretsManager"; - case forTeams: - return "startYour7DayFreeTrialOfBitwardenForTeams"; - case forEnterprise: - return "startYour7DayFreeTrialOfBitwardenForEnterprise"; - case forFamilies: - return "startYour7DayFreeTrialOfBitwardenForFamilies"; + return "continueSettingUpFreeTrialSecretsManager"; default: - return "startYour7DayFreeTrialOfBitwarden"; + return "continueSettingUpFreeTrial"; } }; diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index cc2754b6d6..52291a20a7 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -8683,41 +8683,14 @@ "manageBillingFromProviderPortalMessage": { "message": "Manage billing from the Provider Portal" }, - "startYour7DayFreeTrialOfBitwarden": { - "message": "Start your 7-Day free trial of Bitwarden" + "continueSettingUpFreeTrial": { + "message": "Continue setting up your free trial of Bitwarden" }, - "startYour7DayFreeTrialOfBitwardenForTeams": { - "message": "Start your 7-Day free trial of Bitwarden for Teams" + "continueSettingUpFreeTrialPasswordManager": { + "message": "Continue setting up your free trial of Bitwarden Password Manager" }, - "startYour7DayFreeTrialOfBitwardenForFamilies": { - "message": "Start your 7-Day free trial of Bitwarden for Families" - }, - "startYour7DayFreeTrialOfBitwardenForEnterprise": { - "message": "Start your 7-Day free trial of Bitwarden for Enterprise" - }, - "startYour7DayFreeTrialOfBitwardenSecretsManager": { - "message": "Start your 7-Day free trial of Bitwarden Secrets Manager" - }, - "startYour7DayFreeTrialOfBitwardenSecretsManagerForTeams": { - "message": "Start your 7-Day free trial of Bitwarden Secrets Manager for Teams" - }, - "startYour7DayFreeTrialOfBitwardenSecretsManagerForFamilies": { - "message": "Start your 7-Day free trial of Bitwarden Secrets Manager for Families" - }, - "startYour7DayFreeTrialOfBitwardenSecretsManagerForEnterprise": { - "message": "Start your 7-Day free trial of Bitwarden Secrets Manager for Enterprise" - }, - "startYour7DayFreeTrialOfBitwardenPasswordManager": { - "message": "Start your 7-Day free trial of Bitwarden Password Manager" - }, - "startYour7DayFreeTrialOfBitwardenPasswordManagerForTeams": { - "message": "Start your 7-Day free trial of Bitwarden Password Manager for Teams" - }, - "startYour7DayFreeTrialOfBitwardenPasswordManagerForFamilies": { - "message": "Start your 7-Day free trial of Bitwarden Password Manager for Families" - }, - "startYour7DayFreeTrialOfBitwardenPasswordManagerForEnterprise": { - "message": "Start your 7-Day free trial of Bitwarden Password Manager for Enterprise" + "continueSettingUpFreeTrialSecretsManager": { + "message": "Continue setting up your free trial of Bitwarden Secrets Manager" }, "enterTeamsOrgInfo": { "message": "Enter your Teams organization information"