mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 10:55:06 +03:00
* Start new integrations page * Move cronjobs into integrations * Rearrange * Remove duplicate * Move around menu items
67 lines
1.7 KiB
TypeScript
67 lines
1.7 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
|
|
graphqlExtensionExists: boolean
|
|
}
|
|
): ProductMenuGroup[] => {
|
|
const ref = project?.ref ?? 'default'
|
|
const { pgNetExtensionExists, cronUiEnabled, graphqlExtensionExists } = 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 Jobs',
|
|
key: 'cron-jobs',
|
|
url: `/project/${ref}/integrations/cron-jobs`,
|
|
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',
|
|
},
|
|
],
|
|
},
|
|
]
|
|
}
|