mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
* Make the title prop on ProjectIntegrationLayout mandatory. Fix the title on some of the integration pages. Fix wrong layout on wrappers/new. * Add code for the initial page. * Make the FilterPopover more type-safe. * Add a page to list message in a single queue. * Add feature flag for queues. * Handle the case where pgmq is not available on the database. * Minor fixes. * Some minor fixes. * Fix the query when fetching only archived messages. * Fix the filters when there's no choices selected. * Add a comment for local dev. * Add a max size to the queue name input.
69 lines
2.1 KiB
TypeScript
69 lines
2.1 KiB
TypeScript
import { useRouter } from 'next/router'
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
import { IS_PLATFORM } from 'common'
|
|
import { ProductMenu } from 'components/ui/ProductMenu'
|
|
import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-extensions-query'
|
|
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
|
|
import { withAuth } from 'hooks/misc/withAuth'
|
|
import { useFlag } from 'hooks/ui/useFlag'
|
|
import ProjectLayout from '../ProjectLayout/ProjectLayout'
|
|
import { generateProjectIntegrationsMenu } from './ProjectIntegrationsMenu.utils'
|
|
|
|
export interface ProjectIntegrationsLayoutProps {
|
|
title: string
|
|
}
|
|
|
|
const ProjectIntegrationsMenu = () => {
|
|
// if running on self-hosted, cron UI should be always enabled
|
|
const cronUiEnabled = useFlag('cronUi') || !IS_PLATFORM
|
|
const queuesUiEnabled = useFlag('queues')
|
|
const project = useSelectedProject()
|
|
|
|
const router = useRouter()
|
|
const page = router.pathname.split('/')[4]
|
|
|
|
const { data } = useDatabaseExtensionsQuery({
|
|
projectRef: project?.ref,
|
|
connectionString: project?.connectionString,
|
|
})
|
|
|
|
const pgNetExtensionExists = (data ?? []).find((ext) => ext.name === 'pg_net') !== undefined
|
|
const graphqlExtensionExists = (data ?? []).find((ext) => ext.name === 'pg_graphql') !== undefined
|
|
// TODO: Change this to true for local development to work
|
|
const pgmqExtensionExists = (data ?? []).find((ext) => ext.name === 'pgmq') !== undefined
|
|
|
|
return (
|
|
<>
|
|
<ProductMenu
|
|
page={page}
|
|
menu={generateProjectIntegrationsMenu(project, {
|
|
pgNetExtensionExists,
|
|
cronUiEnabled,
|
|
queuesUiEnabled,
|
|
graphqlExtensionExists,
|
|
pgmqExtensionExists,
|
|
})}
|
|
/>
|
|
</>
|
|
)
|
|
}
|
|
|
|
const ProjectIntegrationsLayout = ({
|
|
children,
|
|
title,
|
|
}: PropsWithChildren<ProjectIntegrationsLayoutProps>) => {
|
|
return (
|
|
<ProjectLayout
|
|
title={title}
|
|
product="Integrations"
|
|
productMenu={<ProjectIntegrationsMenu />}
|
|
isBlocking={false}
|
|
>
|
|
{children}
|
|
</ProjectLayout>
|
|
)
|
|
}
|
|
|
|
export default withAuth(ProjectIntegrationsLayout)
|