From 4a0b4040edb2dec0e265c36aaab1089c93348333 Mon Sep 17 00:00:00 2001
From: Philip Okugbe <16838612+Philipinho@users.noreply.github.com>
Date: Sat, 17 May 2025 18:03:01 +0000
Subject: [PATCH] Add second plan (#1187)
---
apps/client/src/ee/billing/types/billing.types.ts | 1 +
apps/client/src/ee/hooks/use-plan.tsx | 8 ++++++--
apps/client/src/ee/security/pages/security.tsx | 5 +++--
apps/server/src/ee | 2 +-
4 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/apps/client/src/ee/billing/types/billing.types.ts b/apps/client/src/ee/billing/types/billing.types.ts
index 89d936f0..240e55fd 100644
--- a/apps/client/src/ee/billing/types/billing.types.ts
+++ b/apps/client/src/ee/billing/types/billing.types.ts
@@ -1,5 +1,6 @@
export enum BillingPlan {
STANDARD = "standard",
+ BUSINESS = "business",
}
export interface IBilling {
diff --git a/apps/client/src/ee/hooks/use-plan.tsx b/apps/client/src/ee/hooks/use-plan.tsx
index 52790178..a9296c58 100644
--- a/apps/client/src/ee/hooks/use-plan.tsx
+++ b/apps/client/src/ee/hooks/use-plan.tsx
@@ -2,14 +2,18 @@ import { useAtom } from "jotai";
import { workspaceAtom } from "@/features/user/atoms/current-user-atom.ts";
import { BillingPlan } from "@/ee/billing/types/billing.types.ts";
-export const usePlan = () => {
+const usePlan = () => {
const [workspace] = useAtom(workspaceAtom);
const isStandard =
typeof workspace?.plan === "string" &&
workspace?.plan.toLowerCase() === BillingPlan.STANDARD.toLowerCase();
- return { isStandard };
+ const isBusiness =
+ typeof workspace?.plan === "string" &&
+ workspace?.plan.toLowerCase() === BillingPlan.BUSINESS.toLowerCase();
+
+ return { isStandard, isBusiness };
};
export default usePlan;
diff --git a/apps/client/src/ee/security/pages/security.tsx b/apps/client/src/ee/security/pages/security.tsx
index 9a85cff2..de8efc06 100644
--- a/apps/client/src/ee/security/pages/security.tsx
+++ b/apps/client/src/ee/security/pages/security.tsx
@@ -10,11 +10,13 @@ import EnforceSso from "@/ee/security/components/enforce-sso.tsx";
import AllowedDomains from "@/ee/security/components/allowed-domains.tsx";
import { useTranslation } from "react-i18next";
import useLicense from "@/ee/hooks/use-license.tsx";
+import usePlan from "@/ee/hooks/use-plan.tsx";
export default function Security() {
const { t } = useTranslation();
const { isAdmin } = useUserRole();
const { hasLicenseKey } = useLicense();
+ const { isBusiness } = usePlan();
if (!isAdmin) {
return null;
@@ -35,8 +37,7 @@ export default function Security() {
Single sign-on (SSO)
- {/*TODO: revisit when we add a second plan */}
- {!isCloud() && hasLicenseKey ? (
+ {(isCloud() && isBusiness) || (!isCloud() && hasLicenseKey) ? (
<>
diff --git a/apps/server/src/ee b/apps/server/src/ee
index 96404fc1..12f576ce 160000
--- a/apps/server/src/ee
+++ b/apps/server/src/ee
@@ -1 +1 @@
-Subproject commit 96404fc121844a707bd0fb1e280df6e2d52e8973
+Subproject commit 12f576ce721747903a9fadef3d58e0aa4e7ea3da