Skip to content

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

chore: hideable legal org documents tab (#39531)

Alaister Youngc6a09b3fcf1d
diff --git a/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx b/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx
index 836ad3584ac..b9f974dc654 100644
--- a/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx
@@ -16,7 +16,12 @@ function OrganizationSettingsLayout({ children }: PropsWithChildren) {
const {
organizationShowSsoSettings: showSsoSettings,
organizationShowSecuritySettings: showSecuritySettings,
- } = useIsFeatureEnabled(['organization:show_sso_settings', 'organization:show_security_settings'])
+ organizationShowLegalDocuments: showLegalDocuments,
+ } = useIsFeatureEnabled([
+ 'organization:show_sso_settings',
+ 'organization:show_security_settings',
+ 'organization:show_legal_documents',
+ ])
const navMenuItems = [
{
@@ -48,10 +53,14 @@ function OrganizationSettingsLayout({ children }: PropsWithChildren) {
label: 'Audit Logs',
href: `/org/${slug}/audit`,
},
- {
- label: 'Legal Documents',
- href: `/org/${slug}/documents`,
- },
+ ...(showLegalDocuments
+ ? [
+ {
+ label: 'Legal Documents',
+ href: `/org/${slug}/documents`,
+ },
+ ]
+ : []),
]
return (
diff --git a/apps/studio/pages/org/[slug]/documents.tsx b/apps/studio/pages/org/[slug]/documents.tsx
index 829b83ba8d7..1d2fb1e44d5 100644
--- a/apps/studio/pages/org/[slug]/documents.tsx
+++ b/apps/studio/pages/org/[slug]/documents.tsx
@@ -1,11 +1,21 @@
+import { useParams } from 'common'
import { Documents } from 'components/interfaces/Organization'
-import AppLayout from 'components/layouts/AppLayout/AppLayout'
import DefaultLayout from 'components/layouts/DefaultLayout'
import OrganizationLayout from 'components/layouts/OrganizationLayout'
import OrganizationSettingsLayout from 'components/layouts/ProjectLayout/OrganizationSettingsLayout'
+import { UnknownInterface } from 'components/ui/UnknownInterface'
+import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import type { NextPageWithLayout } from 'types'
const OrgDocuments: NextPageWithLayout = () => {
+ const { slug } = useParams()
+
+ const showLegalDocuments = useIsFeatureEnabled('organization:show_legal_documents')
+
+ if (!showLegalDocuments) {
+ return <UnknownInterface urlBack={`/org/${slug}`} />
+ }
+
return <Documents />
}
diff --git a/packages/common/enabled-features/enabled-features.json b/packages/common/enabled-features/enabled-features.json
index 5e51a564817..6420164ff23 100644
--- a/packages/common/enabled-features/enabled-features.json
+++ b/packages/common/enabled-features/enabled-features.json
@@ -79,6 +79,7 @@
"organization:show_sso_settings": true,
"organization:show_security_settings": true,
+ "organization:show_legal_documents": true,
"profile:show_email": true,
"profile:show_information": true,
diff --git a/packages/common/enabled-features/enabled-features.schema.json b/packages/common/enabled-features/enabled-features.schema.json
index 37cfcfdf325..c742c5a2848 100644
--- a/packages/common/enabled-features/enabled-features.schema.json
+++ b/packages/common/enabled-features/enabled-features.schema.json
@@ -276,6 +276,10 @@
"type": "boolean",
"description": "Show the security settings tab in the organization settings page"
},
+ "organization:show_legal_documents": {
+ "type": "boolean",
+ "description": "Show the legal documents tab in the organization settings page"
+ },
"profile:show_email": {
"type": "boolean",
@@ -472,6 +476,8 @@
"logs:metadata",
"logs:show_metadata_ip_template",
"organization:show_sso_settings",
+ "organization:show_security_settings",
+ "organization:show_legal_documents",
"project_creation:show_advanced_config",
"project_homepage:show_instance_size",
"project_homepage:show_examples",