The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Separate enterprise request into its own route
Joshen Limb37c6aa8d528
diff --git a/studio/components/interfaces/Billing/EnterpriseRequest.tsx b/studio/components/interfaces/Billing/EnterpriseRequest.tsxindex 252a9d0095a..1ecb28055ee 100644--- a/studio/components/interfaces/Billing/EnterpriseRequest.tsx+++ b/studio/components/interfaces/Billing/EnterpriseRequest.tsx@@ -5,11 +5,10 @@ import { useStore } from 'hooks'import { timeout } from 'lib/helpers'interface Props {- visible: booleanonSelectBack: () => void}-const EnterpriseRequest: FC<Props> = ({ visible, onSelectBack }) => {+const EnterpriseRequest: FC<Props> = ({ onSelectBack }) => {const { ui } = useStore()const { profile } = ui@@ -33,52 +32,51 @@ const EnterpriseRequest: FC<Props> = ({ visible, onSelectBack }) => {return (<Transition- show={visible}+ show+ appearenter="transition ease-out duration-300"enterFrom="transform opacity-0 translate-x-10"enterTo="transform opacity-100 translate-x-0">- {visible && (- <div className="space-y-8 w-4/5">- <div className="relative">- <div className="absolute top-[2px] -left-24">- <Button type="text" icon={<IconArrowLeft />} onClick={onSelectBack}>- Back- </Button>- </div>- <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 we’ll be in contact with you!- </p>- </div>- <Form- validateOnBlur- initialValues={initialValues}- validate={onValidate}- onSubmit={onSubmit}- >- {({ isSubmitting }: { isSubmitting: boolean }) => (- <div className="space-y-12 py-16">- <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 className="space-y-8 w-4/5">+ <div className="relative">+ <div className="absolute top-[2px] -left-24">+ <Button type="text" icon={<IconArrowLeft />} onClick={onSelectBack}>+ Back+ </Button>+ </div>+ <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 we’ll be in contact with you!+ </p></div>+ <Form+ validateOnBlur+ initialValues={initialValues}+ validate={onValidate}+ onSubmit={onSubmit}+ >+ {({ isSubmitting }: { isSubmitting: boolean }) => (+ <div className="space-y-12 py-16">+ <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>- )}+ </div></Transition>)}diff --git a/studio/pages/project/[ref]/settings/billing/enterprise.tsx b/studio/pages/project/[ref]/settings/billing/enterprise.tsxnew file mode 100644index 00000000000..3d168ef0627--- /dev/null+++ b/studio/pages/project/[ref]/settings/billing/enterprise.tsx@@ -0,0 +1,26 @@+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 BillingUpdate: 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(BillingUpdate))diff --git a/studio/pages/project/[ref]/settings/billing/update.tsx b/studio/pages/project/[ref]/settings/billing/update.tsxindex 03576346441..34928d7862f 100644--- a/studio/pages/project/[ref]/settings/billing/update.tsx+++ b/studio/pages/project/[ref]/settings/billing/update.tsx@@ -1,5 +1,6 @@import { NextPage } from 'next'import { useEffect, useState } from 'react'+import { useRouter } from 'next/router'import { observer } from 'mobx-react-lite'import { Button, Modal } from '@supabase/ui'@@ -12,7 +13,6 @@ import ConfirmModal from 'components/ui/Dialogs/ConfirmDialog'import {PlanSelection,ProUpgrade,- EnterpriseRequest,ExitSurvey,StripeSubscription,} from 'components/interfaces/Billing'@@ -27,6 +27,7 @@ import { BILLING_PLANS } from 'components/interfaces/Billing/PlanSelection/Plansconst BillingUpdate: NextPage = () => {const { ui } = useStore()+ const router = useRouter()const projectRef = ui.selectedProject?.refconst stripeCustomerId = ui.selectedOrganization?.stripe_customer_id@@ -91,6 +92,10 @@ const BillingUpdate: NextPage = () => {}const onSelectPlan = (plan: BillingPlan) => {+ if (plan.name === 'Enterprise') {+ return router.push(`/project/${projectRef}/settings/billing/enterprise`)+ }+setSelectedPlan(plan)if (plan.id === STRIPE_PRODUCT_IDS.FREE) {setShowConfirmDowngrade(true)@@ -118,10 +123,6 @@ const BillingUpdate: NextPage = () => {currentPlan={subscription?.tier}onSelectPlan={onSelectPlan}/>- <EnterpriseRequest- visible={selectedPlan?.name === 'Enterprise'}- onSelectBack={() => setSelectedPlan(undefined)}- /><ExitSurveyvisible={selectedPlan?.name === 'Free' && !showConfirmDowngrade}onSelectBack={() => setSelectedPlan(undefined)}