From 6dcdaea0856f278af851c347d63f8e7917feba52 Mon Sep 17 00:00:00 2001 From: Florian Zia Date: Thu, 14 Sep 2023 11:09:10 +0200 Subject: [PATCH] chore: Add Monitor Premium yearly plan --- .env-dist | 7 ++--- .../(authenticated)/user/breaches/page.tsx | 24 ----------------- .../automatic-remove/page.tsx | 5 +++- .../manual-remove/ManualRemoveView.tsx | 4 +-- .../components/client/PremiumUpsellDialog.tsx | 9 +++---- src/app/functions/server/isUserSubscribed.ts | 8 ++++-- .../universal/getPremiumSubscriptionUrl.ts | 26 +++++++++++++++++++ 7 files changed, 46 insertions(+), 37 deletions(-) create mode 100644 src/app/functions/universal/getPremiumSubscriptionUrl.ts diff --git a/.env-dist b/.env-dist index 0d1cd94d2..61c7f69a8 100755 --- a/.env-dist +++ b/.env-dist @@ -49,7 +49,7 @@ S3_BUCKET= # leave FXA_ENABLED empty to disable FXA FXA_ENABLED= NEXT_PUBLIC_FXA_SETTINGS_URL=https://accounts.stage.mozaws.net/settings -FXA_SUBSCRIPTIONS_URL=https://accounts.stage.mozaws.net/subscriptions +NEXT_PUBLIC_FXA_SUBSCRIPTIONS_URL=https://accounts.stage.mozaws.net/subscriptions OAUTH_CLIENT_ID=edd29a80019d61a1 OAUTH_CLIENT_SECRET=get-this-from-groovecoder-or-fxmonitor-engineering @@ -137,8 +137,9 @@ E2E_TEST_ACCOUNT_PASSWORD= NEXT_PUBLIC_PREMIUM_ENABLED= NEXT_PUBLIC_ONEREP_DATA_BROKER_COUNT=190 # Link to start user on the subscription process. PREMIUM_ENABLED must be set to `true`. -PREMIUM_PRODUCT_ID=prod_NErZh679W62lai -PREMIUM_PLAN_ID_US=price_1MUNq0Kb9q6OnNsL4BoJgepf +NEXT_PUBLIC_PREMIUM_PRODUCT_ID=prod_NErZh679W62lai +NEXT_PUBLIC_PREMIUM_PLAN_ID_MONTHLY_US=price_1MUNq0Kb9q6OnNsL4BoJgepf +NEXT_PUBLIC_PREMIUM_PLAN_ID_YEARLY_US= MONTHLY_SCANS_QUOTA= STATS_TOKEN= diff --git a/src/app/(nextjs_migration)/(authenticated)/user/breaches/page.tsx b/src/app/(nextjs_migration)/(authenticated)/user/breaches/page.tsx index 92c9c667e..dce1abb37 100644 --- a/src/app/(nextjs_migration)/(authenticated)/user/breaches/page.tsx +++ b/src/app/(nextjs_migration)/(authenticated)/user/breaches/page.tsx @@ -22,7 +22,6 @@ import ImageIconEmail from "../../../../../client/images/icon-email.svg"; import { BreachesTable } from "../../../components/server/BreachesTable"; import { getComponentAsString } from "../../../functions/server/getComponentAsString"; import { getCountryCode } from "../../../../functions/server/getCountryCode"; -import { isUserSubscribed } from "../../../../functions/server/isUserSubscribed"; import { getNonce } from "../../../functions/server/getNonce"; export function generateMetadata() { @@ -82,14 +81,6 @@ export default async function UserBreaches() { }, }); - type FxaSubscriptionResponse = { - subscriptions: Array<{ - product_id: string; - plan_id: string; - status: "active"; - }>; - }; - return ( <> {/* These scripts predate the use of React and thus shouldn’t wait for @@ -124,21 +115,6 @@ export default async function UserBreaches() { />
- {process.env.NEXT_PUBLIC_PREMIUM_ENABLED === "true" && - !(await isUserSubscribed()) ? ( -
- - Subscribe to Premium - -
- ) : ( - "" - )}