The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore: add cta for no created tables in /auth/policies
“louis-27”b139bc90bc63
diff --git a/studio/components/interfaces/Database/Triggers/CreateTrigger.tsx b/studio/components/interfaces/Database/Triggers/CreateTrigger.tsxindex 09b9180799b..3f9a0fcb45f 100644--- a/studio/components/interfaces/Database/Triggers/CreateTrigger.tsx+++ b/studio/components/interfaces/Database/Triggers/CreateTrigger.tsx@@ -20,7 +20,7 @@ import SVG from 'react-inlinesvg'import ChooseFunctionForm from './ChooseFunctionForm'import FormEmptyBox from 'components/to-be-cleaned/FormBoxEmpty'-import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState'+import NoTableState from 'components/to-be-cleaned/NoTableState'import { useStore } from 'hooks'class CreateTriggerFormState {@@ -373,33 +373,13 @@ const CreateTrigger: FC<CreateTriggerProps> = ({ trigger, visible, setVisible })</CreateTriggerContext.Provider></div>) : (- <NoTableState />+ <NoTableState message="You will need to create a table first before you can make a trigger" />)}</SidePanel></>)}-const NoTableState: FC = ({}) => {- // for the empty 'no tables' state link- const router = useRouter()- const { ref } = router.query-- return (- <ProductEmptyState- title="No public tables found"- ctaButtonLabel="Create a new table"- onClickCta={() => {- router.push(`/project/${ref}/database/tables`)- }}- >- <p className="text-sm text-scale-1100">- You will need to create a table first before you can make a trigger- </p>- </ProductEmptyState>- )-}-export default observer(CreateTrigger)const InputName: FC = observer(({}) => {diff --git a/studio/components/to-be-cleaned/NoTableState.tsx b/studio/components/to-be-cleaned/NoTableState.tsxnew file mode 100644index 00000000000..7a63f120b68--- /dev/null+++ b/studio/components/to-be-cleaned/NoTableState.tsx@@ -0,0 +1,26 @@+import { FC } from 'react'+import { useRouter } from 'next/router'+import ProductEmptyState from './ProductEmptyState'++interface Props {+ message: string+}++const NoTableState: FC<Props> = ({ message }) => {+ const router = useRouter()+ const { ref } = router.query++ return (+ <ProductEmptyState+ title="No public tables found"+ ctaButtonLabel="Create a new table"+ onClickCta={() => {+ router.push(`/project/${ref}/database/tables`)+ }}+ >+ <p className="text-sm text-scale-1100">{message}</p>+ </ProductEmptyState>+ )+}++export default NoTableStatediff --git a/studio/pages/project/[ref]/auth/policies.tsx b/studio/pages/project/[ref]/auth/policies.tsxindex 2bbabbbdf7f..610b337af09 100644--- a/studio/pages/project/[ref]/auth/policies.tsx+++ b/studio/pages/project/[ref]/auth/policies.tsx@@ -9,6 +9,7 @@ import NoSearchResults from 'components/to-be-cleaned/NoSearchResults'import ConfirmModal from 'components/ui/Dialogs/ConfirmDialog'import PolicyTableRow from 'components/to-be-cleaned/Auth/PolicyTableRow'import PolicyEditorModal from 'components/to-be-cleaned/Auth/PolicyEditorModal'+import NoTableState from 'components/to-be-cleaned/NoTableState'const PageContext = createContext(null)@@ -237,8 +238,10 @@ const AuthPoliciesTables = observer(() => {/></section>))- ) : (+ ) : PageState.tables.length > 0 ? (<NoSearchResults />+ ) : (+ <NoTableState message="You haven't created a table on the public schema. Get started by creating a new table." />)}<PolicyEditorModal