Skip to content

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

Deprecate EnterpriseForm and direct users to form on marketing site instead

Joshen Lim824e8823e6c4
diff --git a/studio/components/interfaces/Billing/EnterpriseRequest.tsx b/studio/components/interfaces/Billing/EnterpriseRequest.tsx
deleted file mode 100644
index 8fe599509d9..00000000000
--- a/studio/components/interfaces/Billing/EnterpriseRequest.tsx
+++ /dev/null
@@ -1,123 +0,0 @@
-import { FC, useState } from 'react'
-import { useRouter } from 'next/router'
-import { Transition } from '@headlessui/react'
-import { Button, Form, Input, IconArrowLeft } from '@supabase/ui'
-
-import { post } from 'lib/common/fetch'
-import { useStore } from 'hooks'
-import { API_URL } from 'lib/constants'
-import { UpdateSuccess } from '.'
-import BackButton from 'components/ui/BackButton'
-
-interface Props {
- onSelectBack: () => void
-}
-
-const EnterpriseRequest: FC<Props> = ({ onSelectBack }) => {
- const { ui } = useStore()
- const router = useRouter()
- const { profile, selectedProject } = ui
- const projectRef = selectedProject?.ref
-
- const [isSuccessful, setIsSuccessful] = useState(false)
-
- const initialValues = {
- name: `${profile?.first_name ? profile?.first_name : ''} ${
- profile?.last_name ? profile.last_name : ''
- }`,
- email: profile?.primary_email,
- company: '',
- message: '',
- }
-
- const onValidate = (values: any) => {
- const errors: any = {}
- if (!values.name) errors.name = 'Please enter your name'
- if (!values.company) errors.company = 'Please enter your company name'
- if (!values.email) errors.email = 'Please enter your email'
- if (!values.message)
- errors.message = 'Please leave a message on what you intend to use Supabase for'
-
- const emailValidateRegex =
- /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
- if (!emailValidateRegex.test(values.email)) errors.email = 'Please enter a valid email'
- return errors
- }
-
- const onSubmit = async (values: any, { setSubmitting }: any) => {
- setSubmitting(true)
- const res = await post(`${API_URL}/projects/${projectRef}/subscription/enterprise`, {
- name: values.name,
- email: values.email,
- company: values.company,
- message: values.message,
- })
- if (res.error) {
- ui.setNotification({
- category: 'error',
- message: `Unable to send request: ${res.error.message}`,
- error: res.error,
- })
- } else {
- setIsSuccessful(true)
- }
- setSubmitting(false)
- }
-
- if (isSuccessful)
- return (
- <UpdateSuccess
- projectRef={projectRef || ''}
- title="Thank you for your interest!"
- message="We’ll be in contact with you shortly within 5 days to discuss about how we can create a
- plan to suit exactly what your business needs. In the meantime, if you have any questions,
- feel free to reach out to us at [email protected]"
- />
- )
-
- return (
- <Transition
- show
- appear
- enter="transition ease-out duration-300"
- enterFrom="transform opacity-0 translate-x-10"
- enterTo="transform opacity-100 translate-x-0"
- >
- <div className="space-y-8 w-4/5">
- <BackButton onClick={() => onSelectBack()} />
- <div className="space-y-1">
- <h4 className="text-lg">Customised plans tailored for your business needs</h4>
- <p className="text-scale-1100">
- Let us know a few details and our team will get back to you as soon as possible.
- </p>
- </div>
- <Form
- validateOnBlur
- initialValues={initialValues}
- validate={onValidate}
- onSubmit={onSubmit}
- >
- {({ isSubmitting }: { isSubmitting: boolean }) => (
- <div className="space-y-12">
- <div className="space-y-4 w-3/5">
- <Input layout="horizontal" label="Name" id="name" name="name" />
- <Input layout="horizontal" label="Email" id="email" name="email" />
- <Input layout="horizontal" label="Company" id="company" name="company" />
- </div>
- <Input.TextArea
- id="message"
- name="message"
- label="Let us know what you intend to use Supabase for"
- />
- <Button htmlType="submit" loading={isSubmitting}>
- Submit request
- </Button>
- </div>
- )}
- </Form>
- </div>
- </Transition>
- )
-}
-
-export default EnterpriseRequest
diff --git a/studio/components/interfaces/Billing/PlanSelection/Plans/PlanCTAButton.tsx b/studio/components/interfaces/Billing/PlanSelection/Plans/PlanCTAButton.tsx
index eba3cd14451..268a2196f28 100644
--- a/studio/components/interfaces/Billing/PlanSelection/Plans/PlanCTAButton.tsx
+++ b/studio/components/interfaces/Billing/PlanSelection/Plans/PlanCTAButton.tsx
@@ -3,6 +3,7 @@ import { Button, IconLoader } from '@supabase/ui'
import { STRIPE_PRODUCT_IDS } from 'lib/constants'
import { StripeProduct } from '../..'
+import Link from 'next/link'
interface Props {
plan: any
@@ -57,6 +58,18 @@ const PlanCTAButton: FC<Props> = ({ plan, currentPlan, onSelectPlan }) => {
const disabled =
plan.id === STRIPE_PRODUCT_IDS.FREE && currentPlan.prod_id === STRIPE_PRODUCT_IDS.FREE
+ if (plan.name === 'Enterprise') {
+ return (
+ <Link href="https://supabase.com/contact/enterprise">
+ <a>
+ <Button disabled={disabled} type={type} block size="medium">
+ {ctaText}
+ </Button>
+ </a>
+ </Link>
+ )
+ }
+
return (
<div className="flex items-center justify-center">
<Button
diff --git a/studio/components/interfaces/Billing/index.ts b/studio/components/interfaces/Billing/index.ts
index 214a04e12a1..786c5c24e39 100644
--- a/studio/components/interfaces/Billing/index.ts
+++ b/studio/components/interfaces/Billing/index.ts
@@ -3,7 +3,6 @@ import Subscription from './Subscription/Subscription'
import PlanSelection from './PlanSelection/PlanSelection'
import ProUpgrade from './ProUpgrade/ProUpgrade'
-import EnterpriseRequest from './EnterpriseRequest'
import ExitSurvey from './ExitSurvey/ExitSurvey'
import PaymentSummaryPanel from './PaymentSummaryPanel/PaymentSummaryPanel'
import ComputeSizeSelection from './AddOns/ComputeSizeSelection'
@@ -19,7 +18,6 @@ export {
Subscription,
PlanSelection,
ProUpgrade,
- EnterpriseRequest,
ExitSurvey,
PaymentSummaryPanel,
ComputeSizeSelection,
diff --git a/studio/pages/project/[ref]/settings/billing/update/enterprise.tsx b/studio/pages/project/[ref]/settings/billing/update/enterprise.tsx
deleted file mode 100644
index 53b15beff8e..00000000000
--- a/studio/pages/project/[ref]/settings/billing/update/enterprise.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { NextPage } from 'next'
-import { observer } from 'mobx-react-lite'
-import { useRouter } from 'next/router'
-
-import { withAuth, useStore } from 'hooks'
-
-import { BillingLayout } from 'components/layouts'
-import { EnterpriseRequest } from 'components/interfaces/Billing'
-
-const BillingUpdateEnterprise: NextPage = () => {
- const { ui } = useStore()
- const router = useRouter()
- const projectRef = ui.selectedProject?.ref
-
- return (
- <BillingLayout>
- <div className="mx-auto max-w-5xl my-10">
- <EnterpriseRequest
- onSelectBack={() => router.push(`/project/${projectRef}/settings/billing/update`)}
- />
- </div>
- </BillingLayout>
- )
-}
-
-export default withAuth(observer(BillingUpdateEnterprise))
diff --git a/studio/pages/project/[ref]/settings/billing/update/index.tsx b/studio/pages/project/[ref]/settings/billing/update/index.tsx
index 0251e7c1081..c9bddaaeb71 100644
--- a/studio/pages/project/[ref]/settings/billing/update/index.tsx
+++ b/studio/pages/project/[ref]/settings/billing/update/index.tsx
@@ -74,13 +74,9 @@ const BillingUpdate: NextPage = () => {
}
const onSelectPlan = (plan: any) => {
- if (plan.name === 'Enterprise') {
- return router.push(`/project/${projectRef}/settings/billing/update/enterprise`)
- } else if (plan.id === STRIPE_PRODUCT_IDS.PRO) {
- return router.push(`/project/${projectRef}/settings/billing/update/pro`)
- }
-
- if (plan.id === STRIPE_PRODUCT_IDS.FREE) {
+ if (plan.id === STRIPE_PRODUCT_IDS.PRO) {
+ router.push(`/project/${projectRef}/settings/billing/update/pro`)
+ } else if (plan.id === STRIPE_PRODUCT_IDS.FREE) {
setSelectedPlan(plan)
setShowConfirmDowngrade(true)
}
@@ -98,7 +94,7 @@ const BillingUpdate: NextPage = () => {
if (isLoadingProducts) {
return (
- <div className="w-full h-full flex items-center justify-center">
+ <div className="flex h-full w-full items-center justify-center">
<Connecting />
</div>
)
@@ -106,7 +102,7 @@ const BillingUpdate: NextPage = () => {
return (
<BillingLayout>
- <div className="mx-auto max-w-6xl my-10 px-6">
+ <div className="mx-auto my-10 max-w-6xl px-6">
<PlanSelection
visible={!selectedPlan || (selectedPlan && showConfirmDowngrade)}
tiers={products?.tiers ?? []}
@@ -137,9 +133,9 @@ const BillingUpdate: NextPage = () => {
header="Free tier limit exceeded"
onCancel={() => setShowDowngradeError(false)}
>
- <div className="py-4 space-y-4">
+ <div className="space-y-4 py-4">
<Modal.Content>
- <p className="text-sm text-scale-1100">
+ <p className="text-scale-1100 text-sm">
Your account is entitled up to {freeProjectsLimit} free projects across all
organizations you own. You will need to delete or upgrade an existing free project
first, before being able to downgrade this project.