The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Fix sql editor + api settings
Joshen Lim9e69e97b01a7
diff --git a/studio/components/layouts/ProjectLayout/ProjectLayout.tsx b/studio/components/layouts/ProjectLayout/ProjectLayout.tsxindex 4d49810b970..11c972561ba 100644--- a/studio/components/layouts/ProjectLayout/ProjectLayout.tsx+++ b/studio/components/layouts/ProjectLayout/ProjectLayout.tsx@@ -168,55 +168,57 @@ const ContentWrapper = observer(({ isLoading, children }: ContentWrapperProps) =* We'll eventually want to use this instead of the current ProjectLayout to prevent* a catch-all spinner on the dashboard*/-export const ProjectLayoutNonBlocking = ({- title,- product = '',- productMenu,- children,- hideHeader = false,- hideIconBar = false,-}: ProjectLayoutProps) => {- const { ui } = useStore()- const router = useRouter()- const { ref: projectRef } = useParams()- const ongoingIncident = useFlag('ongoingIncident')- const isPaused = ui.selectedProject?.status === PROJECT_STATUS.INACTIVE- const ignorePausedState =- router.pathname === '/project/[ref]' || router.pathname.includes('/project/[ref]/settings')- const showPausedState = isPaused && !ignorePausedState-- return (- <ProjectContextProvider projectRef={projectRef}>- <Head>- <title>{title ? `${title} | Supabase` : 'Supabase'}</title>- <meta name="description" content="Supabase Studio" />- <link rel="icon" href="/favicon.ico" />- </Head>- <div className="flex h-full">- {/* Left-most navigation side bar to access products */}- {!hideIconBar && <NavigationBar />}-- {/* Product menu bar */}- {productMenu && !showPausedState && (- <ProductMenuBar title={product}>{productMenu}</ProductMenuBar>- )}+export const ProjectLayoutNonBlocking = observer(+ ({+ title,+ product = '',+ productMenu,+ children,+ hideHeader = false,+ hideIconBar = false,+ }: ProjectLayoutProps) => {+ const { ui } = useStore()+ const router = useRouter()+ const { ref: projectRef } = useParams()+ const ongoingIncident = useFlag('ongoingIncident')+ const isPaused = ui.selectedProject?.status === PROJECT_STATUS.INACTIVE+ const ignorePausedState =+ router.pathname === '/project/[ref]' || router.pathname.includes('/project/[ref]/settings')+ const showPausedState = isPaused && !ignorePausedState++ return (+ <ProjectContextProvider projectRef={projectRef}>+ <Head>+ <title>{title ? `${title} | Supabase` : 'Supabase'}</title>+ <meta name="description" content="Supabase Studio" />+ <link rel="icon" href="/favicon.ico" />+ </Head>+ <div className="flex h-full">+ {/* Left-most navigation side bar to access products */}+ {!hideIconBar && <NavigationBar />}++ {/* Product menu bar */}+ {productMenu && !showPausedState && (+ <ProductMenuBar title={product}>{productMenu}</ProductMenuBar>+ )}- <main- className="flex w-full flex-1 flex-col overflow-x-hidden"- style={{ height: ongoingIncident ? 'calc(100vh - 44px)' : '100vh' }}- >- {!hideHeader && <LayoutHeader />}- {showPausedState ? (- <div className="mx-auto my-16 w-full h-full max-w-7xl flex items-center">- <div className="w-full">- <ProjectPausedState product={product} />+ <main+ className="flex w-full flex-1 flex-col overflow-x-hidden"+ style={{ height: ongoingIncident ? 'calc(100vh - 44px)' : '100vh' }}+ >+ {!hideHeader && <LayoutHeader />}+ {showPausedState ? (+ <div className="mx-auto my-16 w-full h-full max-w-7xl flex items-center">+ <div className="w-full">+ <ProjectPausedState product={product} />+ </div></div>- </div>- ) : (- children- )}- </main>- </div>- </ProjectContextProvider>- )-}+ ) : (+ children+ )}+ </main>+ </div>+ </ProjectContextProvider>+ )+ }+)diff --git a/studio/pages/project/[ref]/settings/api.tsx b/studio/pages/project/[ref]/settings/api.tsxindex 96df8c04768..fee5c50f794 100644--- a/studio/pages/project/[ref]/settings/api.tsx+++ b/studio/pages/project/[ref]/settings/api.tsx@@ -1,4 +1,4 @@-import { createContext } from 'react'+import { createContext, useEffect } from 'react'import { observer, useLocalObservable } from 'mobx-react-lite'import { useStore } from 'hooks'@@ -6,6 +6,8 @@ import { useParams } from 'common/hooks'import { NextPageWithLayout } from 'types'import { SettingsLayout } from 'components/layouts'import ServiceList from 'components/interfaces/Settings/API/ServiceList'+import { PROJECT_STATUS } from 'lib/constants'+import { IconAlertCircle } from 'ui'export const PageContext: any = createContext(null)@@ -13,7 +15,9 @@ const ApiSettings: NextPageWithLayout = () => {const { ref } = useParams()const { meta, ui } = useStore()const project = ui.selectedProject+ const isActive = ui.selectedProject?.status === PROJECT_STATUS.ACTIVE_HEALTHY+ // [Joshen] Will need to deprecate thisconst PageState: any = useLocalObservable(() => ({project: null,projectRef: ref,@@ -22,21 +26,28 @@ const ApiSettings: NextPageWithLayout = () => {PageContext.meta = metaPageContext.project = project+ if (meta) PageState.meta = meta- // load schemas- const load = async () => {- await meta.schemas.load()- }-- if (meta) {- PageState.meta = meta- load()- }+ useEffect(() => {+ if (project?.ref) meta.schemas.load()+ }, [project?.ref])return (<PageContext.Provider value={PageState}><div className="flex flex-col gap-8 px-5 py-6 mx-auto 1xl:px-28 lg:px-16 xl:px-24 2xl:px-32">- <ServiceList />+ {isActive ? (+ <ServiceList />+ ) : (+ <div>+ <h3 className="mb-6 text-xl text-scale-1200">API Settings</h3>+ <div className="flex items-center justify-center rounded border border-scale-400 bg-scale-300 p-8">+ <IconAlertCircle strokeWidth={1.5} />+ <p className="text-sm text-scale-1100 ml-2">+ API settings are unavailable as the project is not active+ </p>+ </div>+ </div>+ )}</div></PageContext.Provider>)