diff --git a/web/ee/components/initiatives/upgrade.tsx b/web/ee/components/initiatives/upgrade.tsx index 41f9de2347..e6d9985e93 100644 --- a/web/ee/components/initiatives/upgrade.tsx +++ b/web/ee/components/initiatives/upgrade.tsx @@ -28,12 +28,12 @@ export const InitiativesUpgrade: FC = observer((props) => { // store hooks const { resolvedTheme } = useTheme(); const { isWorkspaceFeatureEnabled, updateWorkspaceFeature } = useWorkspaceFeatures(); - const { currentWorkspaceSubscribedPlanDetail: subscriptionDetail, togglePaidPlanModal } = useWorkspaceSubscription(); + const { currentWorkspaceSubscribedPlanDetail: subscriptionDetail } = useWorkspaceSubscription(); // derived values const isInitiativesFeatureFlagEnabled = useFlag(workspaceSlug, "INITIATIVES"); const isInitiativesFeatureEnabled = isWorkspaceFeatureEnabled(EWorkspaceFeatures.IS_INITIATIVES_ENABLED); - const isSelfManagedUpgradeDisabled = subscriptionDetail?.is_self_managed && subscriptionDetail?.product !== "FREE"; + const isPlaneOneInstance = subscriptionDetail?.is_self_managed && subscriptionDetail?.product === "ONE"; // handlers const handleEnableInitiatives = async () => { @@ -62,6 +62,30 @@ export const InitiativesUpgrade: FC = observer((props) => { } }; + const getUpgradeButton = () => { + if (isInitiativesFeatureFlagEnabled) { + return redirect ? ( + + Enable + + ) : ( + + ); + } + + if (isPlaneOneInstance) { + return ( + + Upgrade to higher subscription + + ); + } + + return ; + }; + return (
= observer((props) => { Group projects like you group issues—by state, priority, or any other—and track their progress in one click.
-
- {isInitiativesFeatureFlagEnabled ? ( - redirect ? ( - - Enable - - ) : ( - - ) - ) : isSelfManagedUpgradeDisabled ? ( - - Get Pro - - ) : ( - - )} -
+
{getUpgradeButton()}
{ const { resolvedTheme } = useTheme(); const { currentWorkspaceSubscribedPlanDetail: subscriptionDetail, togglePaidPlanModal } = useWorkspaceSubscription(); // derived values - const isSelfManagedUpgradeDisabled = subscriptionDetail?.is_self_managed && subscriptionDetail?.product !== "FREE"; + const isPlaneOneInstance = subscriptionDetail?.is_self_managed && subscriptionDetail?.product === "ONE"; + + const getUpgradeButton = () => { + if (isPlaneOneInstance) { + return ( + + Upgrade to higher subscription + + ); + } + + return ( + + ); + }; return (
@@ -37,17 +54,7 @@ export const TeamsUpgrade: FC = observer(() => { Get Teamspaces with a Pro or higher subscription and organize people + their work into a separate space.
- {isSelfManagedUpgradeDisabled ? ( - - - Get Pro - - ) : ( - - )} + {getUpgradeButton()}