Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Wrap items in is_platform

Terry Sutton0ad6cf749d40
diff --git a/studio/components/layouts/LogsLayout/LogsMenu.utils.ts b/studio/components/layouts/LogsLayout/LogsMenu.utils.ts
index 4bf8454c05a..300c227774f 100644
--- a/studio/components/layouts/LogsLayout/LogsMenu.utils.ts
+++ b/studio/components/layouts/LogsLayout/LogsMenu.utils.ts
@@ -1,49 +1,54 @@
import { Project } from 'types'
import { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
+import { IS_PLATFORM } from 'lib/constants'
export const generateLogsMenu = (project?: Project): ProductMenuGroup[] => {
const ref = project?.ref ?? 'default'
return [
- {
- items: [
- {
- name: 'Logs Explorer',
- key: 'explorer',
- url: `/project/${ref}/logs/explorer`,
- items: [],
- },
- {
- name: 'Postgres',
- key: 'postgres-logs',
- url: `/project/${ref}/logs/postgres-logs`,
- items: [],
- },
- {
- name: 'PostgREST',
- key: 'postgrest-logs',
- url: `/project/${ref}/logs/postgrest-logs`,
- items: [],
- },
- {
- name: 'Auth',
- key: 'auth-logs',
- url: `/project/${ref}/logs/auth-logs`,
- items: [],
- },
- {
- name: 'Storage',
- key: 'storage-logs',
- url: `/project/${ref}/logs/storage-logs`,
- items: [],
- },
+ ...(IS_PLATFORM
+ ? [
+ {
+ items: [
+ {
+ name: 'Logs Explorer',
+ key: 'explorer',
+ url: `/project/${ref}/logs/explorer`,
+ items: [],
+ },
+ {
+ name: 'Postgres',
+ key: 'postgres-logs',
+ url: `/project/${ref}/logs/postgres-logs`,
+ items: [],
+ },
+ {
+ name: 'PostgREST',
+ key: 'postgrest-logs',
+ url: `/project/${ref}/logs/postgrest-logs`,
+ items: [],
+ },
+ {
+ name: 'Auth',
+ key: 'auth-logs',
+ url: `/project/${ref}/logs/auth-logs`,
+ items: [],
+ },
+ {
+ name: 'Storage',
+ key: 'storage-logs',
+ url: `/project/${ref}/logs/storage-logs`,
+ items: [],
+ },
- {
- name: 'Realtime',
- key: 'realtime-logs',
- url: `/project/${ref}/logs/realtime-logs`,
- items: [],
- },
- ],
- },
+ {
+ name: 'Realtime',
+ key: 'realtime-logs',
+ url: `/project/${ref}/logs/realtime-logs`,
+ items: [],
+ },
+ ],
+ },
+ ]
+ : []),
]
}
diff --git a/studio/components/layouts/ReportsLayout/ReportsMenu.utils.ts b/studio/components/layouts/ReportsLayout/ReportsMenu.utils.ts
index 4e078ee8c89..28c14e91e92 100644
--- a/studio/components/layouts/ReportsLayout/ReportsMenu.utils.ts
+++ b/studio/components/layouts/ReportsLayout/ReportsMenu.utils.ts
@@ -1,8 +1,10 @@
import { Project } from 'types'
import { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
+import { useFlag } from 'hooks'
export const generateReportsMenu = (project?: Project): ProductMenuGroup[] => {
const ref = project?.ref ?? 'default'
+ const productReports = useFlag('productReports')
return [
{
@@ -14,12 +16,16 @@ export const generateReportsMenu = (project?: Project): ProductMenuGroup[] => {
url: `/project/${ref}/reports`,
items: [],
},
- {
- name: 'API',
- key: 'api-usage',
- url: `/project/${ref}/reports/api-usage`,
- items: [],
- },
+ ...(productReports
+ ? [
+ {
+ name: 'API usage',
+ key: 'api-usage',
+ url: `/project/${ref}/reports/api-usage`,
+ items: [],
+ },
+ ]
+ : []),
{
name: 'Database',
key: 'database',
diff --git a/studio/components/layouts/SettingsLayout/SettingsMenu.utils.ts b/studio/components/layouts/SettingsLayout/SettingsMenu.utils.ts
index c9b26d031e7..72aace81800 100644
--- a/studio/components/layouts/SettingsLayout/SettingsMenu.utils.ts
+++ b/studio/components/layouts/SettingsLayout/SettingsMenu.utils.ts
@@ -60,28 +60,34 @@ export const generateSettingsMenu = (ref: string, project?: ProjectBase): Produc
: []),
],
},
- {
- title: 'Billing',
- items: [
- {
- name: 'Subscription',
- key: 'subscription',
- url: isProjectBuilding ? buildingUrl : `/project/${ref}/settings/billing/subscription`,
- items: [],
- },
- {
- name: 'Usage',
- key: 'usage',
- url: isProjectBuilding ? buildingUrl : `/project/${ref}/settings/billing/usage`,
- items: [],
- },
- {
- name: 'Invoices',
- key: 'invoices',
- url: isProjectBuilding ? buildingUrl : `/project/${ref}/settings/billing/invoices`,
- items: [],
- },
- ],
- },
+ ...(IS_PLATFORM
+ ? [
+ {
+ title: 'Billing',
+ items: [
+ {
+ name: 'Subscription',
+ key: 'subscription',
+ url: isProjectBuilding
+ ? buildingUrl
+ : `/project/${ref}/settings/billing/subscription`,
+ items: [],
+ },
+ {
+ name: 'Usage',
+ key: 'usage',
+ url: isProjectBuilding ? buildingUrl : `/project/${ref}/settings/billing/usage`,
+ items: [],
+ },
+ {
+ name: 'Invoices',
+ key: 'invoices',
+ url: isProjectBuilding ? buildingUrl : `/project/${ref}/settings/billing/invoices`,
+ items: [],
+ },
+ ],
+ },
+ ]
+ : []),
]
}
diff --git a/studio/pages/project/[ref]/settings/general.tsx b/studio/pages/project/[ref]/settings/general.tsx
index ab210d6762c..63f43cd3ca1 100644
--- a/studio/pages/project/[ref]/settings/general.tsx
+++ b/studio/pages/project/[ref]/settings/general.tsx
@@ -1,12 +1,11 @@
import { observer } from 'mobx-react-lite'
import { NextPageWithLayout } from 'types'
import { SettingsLayout } from 'components/layouts'
-import { FormsContainer } from 'components/ui/Forms'
import { General, Infrastructure, DeleteProjectPanel } from 'components/interfaces/Settings/General'
const ProjectSettings: NextPageWithLayout = () => {
return (
- <div className="1xl:px-28 mx-auto flex flex-col gap-4 px-5 py-6 lg:px-16 xl:px-24 2xl:px-32 ">
+ <div className="1xl:px-28 mx-auto flex flex-col gap-8 px-5 py-6 lg:px-16 xl:px-24 2xl:px-32 ">
<General />
<Infrastructure />
<DeleteProjectPanel />