mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
* Rename cron jobs to cron * Missing history link * Add polling to update list
85 lines
2.0 KiB
TypeScript
85 lines
2.0 KiB
TypeScript
import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
|
|
import type { Project } from 'data/projects/project-detail-query'
|
|
|
|
export const generateProjectIntegrationsMenu = (
|
|
project?: Project,
|
|
flags?: {
|
|
pgNetExtensionExists: boolean
|
|
cronUiEnabled: boolean
|
|
queuesUiEnabled: boolean
|
|
graphqlExtensionExists: boolean
|
|
pgmqExtensionExists: boolean
|
|
}
|
|
): ProductMenuGroup[] => {
|
|
const ref = project?.ref ?? 'default'
|
|
const {
|
|
pgNetExtensionExists,
|
|
cronUiEnabled,
|
|
queuesUiEnabled,
|
|
graphqlExtensionExists,
|
|
pgmqExtensionExists,
|
|
} = flags || {}
|
|
|
|
return [
|
|
{
|
|
title: 'Manage',
|
|
items: [
|
|
{
|
|
name: 'Wrappers',
|
|
key: 'wrappers',
|
|
url: `/project/${ref}/integrations/wrappers`,
|
|
items: [],
|
|
},
|
|
...(!!pgNetExtensionExists
|
|
? [
|
|
{
|
|
name: 'Webhooks',
|
|
key: 'hooks',
|
|
url: `/project/${ref}/integrations/hooks`,
|
|
items: [],
|
|
},
|
|
]
|
|
: []),
|
|
|
|
...(!!cronUiEnabled
|
|
? [
|
|
{
|
|
name: 'Cron',
|
|
key: 'cron-jobs',
|
|
url: `/project/${ref}/integrations/cron`,
|
|
items: [],
|
|
},
|
|
]
|
|
: []),
|
|
...(!!graphqlExtensionExists
|
|
? [
|
|
{
|
|
name: 'GraphiQL',
|
|
key: 'graphiql',
|
|
url: `/project/${ref}/integrations/graphiql`,
|
|
items: [],
|
|
},
|
|
]
|
|
: []),
|
|
{
|
|
name: 'Vault',
|
|
key: 'vault',
|
|
url: `/project/${ref}/integrations/vault/secrets`,
|
|
items: [],
|
|
label: 'BETA',
|
|
},
|
|
...(!!(queuesUiEnabled && pgmqExtensionExists)
|
|
? [
|
|
{
|
|
name: 'Queues',
|
|
key: 'queues',
|
|
url: `/project/${ref}/integrations/queues`,
|
|
items: [],
|
|
},
|
|
]
|
|
: []),
|
|
],
|
|
},
|
|
]
|
|
}
|