Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: disable plan selection on billing enabled flag (#38697)

Alaister Young4cda1d5d3876
diff --git a/apps/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx b/apps/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx
index bd6f53ceb29..ecaf67bad79 100644
--- a/apps/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx
+++ b/apps/studio/components/interfaces/Organization/NewOrg/NewOrgForm.tsx
@@ -21,6 +21,7 @@ import type { CustomerAddress, CustomerTaxId } from 'data/organizations/types'
import { useProjectsQuery } from 'data/projects/projects-query'
import { SetupIntentResponse } from 'data/stripe/setup-intent-mutation'
import { useConfirmPendingSubscriptionCreateMutation } from 'data/subscriptions/org-subscription-confirm-pending-create'
+import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
import { PRICING_TIER_LABELS_ORG, STRIPE_PUBLIC_KEY } from 'lib/constants'
import { useProfile } from 'lib/profile'
@@ -103,6 +104,8 @@ const NewOrgForm = ({ onPaymentMethodReset, setupIntent, onPlanSelected }: NewOr
const user = useProfile()
const { resolvedTheme } = useTheme()
+ const isBillingEnabled = useIsFeatureEnabled('billing:all')
+
const { data: organizations, isSuccess } = useOrganizationsQuery()
const { data } = useProjectsQuery()
@@ -461,55 +464,57 @@ const NewOrgForm = ({ onPaymentMethodReset, setupIntent, onPlanSelected }: NewOr
</Panel.Content>
)}
- <Panel.Content>
- <div className="grid grid-cols-3">
- <div className="flex flex-col gap-2">
- <Label_Shadcn_ htmlFor="plan" className=" text-sm">
- Plan
- </Label_Shadcn_>
-
- <a
- href="https://supabase.com/pricing"
- target="_blank"
- rel="noreferrer noopener"
- className="text-sm flex items-center gap-2 opacity-75 hover:opacity-100 transition"
- >
- Pricing
- <ExternalLink size={16} strokeWidth={1.5} />
- </a>
- </div>
- <div className="col-span-2">
- <Select_Shadcn_
- value={formState.plan}
- onValueChange={(value) => {
- updateForm('plan', value)
- onPlanSelected(value)
- }}
- >
- <SelectTrigger_Shadcn_ id="plan" className="w-full">
- <SelectValue_Shadcn_ />
- </SelectTrigger_Shadcn_>
-
- <SelectContent_Shadcn_>
- {Object.entries(PRICING_TIER_LABELS_ORG).map(([k, v]) => (
- <SelectItem_Shadcn_ key={k} value={k} translate="no">
- {v}
- </SelectItem_Shadcn_>
- ))}
- </SelectContent_Shadcn_>
- </Select_Shadcn_>
+ {isBillingEnabled && (
+ <Panel.Content>
+ <div className="grid grid-cols-3">
+ <div className="flex flex-col gap-2">
+ <Label_Shadcn_ htmlFor="plan" className=" text-sm">
+ Plan
+ </Label_Shadcn_>
- <div className="mt-1">
- <Label_Shadcn_
- htmlFor="plan"
- className="text-foreground-lighter leading-normal text-sm"
+ <a
+ href="https://supabase.com/pricing"
+ target="_blank"
+ rel="noreferrer noopener"
+ className="text-sm flex items-center gap-2 opacity-75 hover:opacity-100 transition"
>
- The Plan applies to your new organization.
- </Label_Shadcn_>
+ Pricing
+ <ExternalLink size={16} strokeWidth={1.5} />
+ </a>
+ </div>
+ <div className="col-span-2">
+ <Select_Shadcn_
+ value={formState.plan}
+ onValueChange={(value) => {
+ updateForm('plan', value)
+ onPlanSelected(value)
+ }}
+ >
+ <SelectTrigger_Shadcn_ id="plan" className="w-full">
+ <SelectValue_Shadcn_ />
+ </SelectTrigger_Shadcn_>
+
+ <SelectContent_Shadcn_>
+ {Object.entries(PRICING_TIER_LABELS_ORG).map(([k, v]) => (
+ <SelectItem_Shadcn_ key={k} value={k} translate="no">
+ {v}
+ </SelectItem_Shadcn_>
+ ))}
+ </SelectContent_Shadcn_>
+ </Select_Shadcn_>
+
+ <div className="mt-1">
+ <Label_Shadcn_
+ htmlFor="plan"
+ className="text-foreground-lighter leading-normal text-sm"
+ >
+ The Plan applies to your new organization.
+ </Label_Shadcn_>
+ </div>
</div>
</div>
- </div>
- </Panel.Content>
+ </Panel.Content>
+ )}
{formState.plan === 'PRO' && (
<>