From de3eacda5ba4cd45106cecf3eb79781caa03ec43 Mon Sep 17 00:00:00 2001 From: Alaister Young Date: Mon, 15 Sep 2025 16:58:54 +0800 Subject: [PATCH] chore: add sso settings to enabled features (#38694) * chore: add sso settings to enabled features * mark as required * Smol tweaks --------- Co-authored-by: Joshen Lim --- .../components/layouts/OrganizationLayout.tsx | 10 +++++----- .../OrganizationSettingsLayout.tsx | 17 ++++++++++++----- apps/studio/pages/org/[slug]/sso.tsx | 10 ++++++++++ .../enabled-features/enabled-features.json | 3 +++ .../enabled-features.schema.json | 6 ++++++ 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/apps/studio/components/layouts/OrganizationLayout.tsx b/apps/studio/components/layouts/OrganizationLayout.tsx index ce196c37f7..427749ca00 100644 --- a/apps/studio/components/layouts/OrganizationLayout.tsx +++ b/apps/studio/components/layouts/OrganizationLayout.tsx @@ -3,14 +3,14 @@ import { type PropsWithChildren } from 'react' import PartnerIcon from 'components/ui/PartnerIcon' import { PARTNER_TO_NAME } from 'components/ui/PartnerManagedResource' +import { useAwsRedirectQuery } from 'data/integrations/aws-redirect-query' import { useVercelRedirectQuery } from 'data/integrations/vercel-redirect-query' import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization' import { withAuth } from 'hooks/misc/withAuth' -import { Alert_Shadcn_, AlertTitle_Shadcn_, Button, cn } from 'ui' -import { useAwsRedirectQuery } from 'data/integrations/aws-redirect-query' import { MANAGED_BY } from 'lib/constants/infrastructure' +import { Alert_Shadcn_, AlertTitle_Shadcn_, Button, cn } from 'ui' -const OrganizationLayoutContent = ({ children }: PropsWithChildren<{}>) => { +const OrganizationLayoutContent = ({ children }: PropsWithChildren) => { const { data: selectedOrganization } = useSelectedOrganizationQuery() const vercelQuery = useVercelRedirectQuery( @@ -53,12 +53,12 @@ const OrganizationLayoutContent = ({ children }: PropsWithChildren<{}>) => { )} -
{children}
+
{children}
) } -const OrganizationLayout = ({ children }: PropsWithChildren<{}>) => { +const OrganizationLayout = ({ children }: PropsWithChildren) => { return {children} } diff --git a/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx b/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx index 848edfc8da..d198aee651 100644 --- a/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx +++ b/apps/studio/components/layouts/ProjectLayout/OrganizationSettingsLayout.tsx @@ -3,6 +3,7 @@ import { PropsWithChildren } from 'react' import { useParams } from 'common' import { useCurrentPath } from 'hooks/misc/useCurrentPath' +import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled' import { NavMenu, NavMenuItem } from 'ui' import { ScaffoldContainerLegacy, ScaffoldTitle } from '../Scaffold' @@ -12,6 +13,8 @@ function OrganizationSettingsLayout({ children }: PropsWithChildren) { const fullCurrentPath = useCurrentPath() const [currentPath] = fullCurrentPath.split('#') + const showSsoSettings = useIsFeatureEnabled('organization:show_sso_settings') + const navMenuItems = [ { label: 'General', @@ -26,10 +29,14 @@ function OrganizationSettingsLayout({ children }: PropsWithChildren) { href: `/org/${slug}/apps`, }, - { - label: 'SSO', - href: `/org/${slug}/sso`, - }, + ...(showSsoSettings + ? [ + { + label: 'SSO', + href: `/org/${slug}/sso`, + }, + ] + : []), { label: 'Audit Logs', @@ -53,7 +60,7 @@ function OrganizationSettingsLayout({ children }: PropsWithChildren) { ))} -
{children}
+
{children}
) } diff --git a/apps/studio/pages/org/[slug]/sso.tsx b/apps/studio/pages/org/[slug]/sso.tsx index ede0545671..899b1cf7c7 100644 --- a/apps/studio/pages/org/[slug]/sso.tsx +++ b/apps/studio/pages/org/[slug]/sso.tsx @@ -1,10 +1,20 @@ +import { useParams } from 'common' import { SSOConfig } from 'components/interfaces/Organization/SSO/SSOConfig' 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 OrgSSO: NextPageWithLayout = () => { + const { slug } = useParams() + const showSsoSettings = useIsFeatureEnabled('organization:show_sso_settings') + + if (!showSsoSettings) { + return + } + return } diff --git a/packages/common/enabled-features/enabled-features.json b/packages/common/enabled-features/enabled-features.json index 440a848432..866280cf51 100644 --- a/packages/common/enabled-features/enabled-features.json +++ b/packages/common/enabled-features/enabled-features.json @@ -44,6 +44,8 @@ "logs:templates": true, "logs:collections": true, + "organization:show_sso_settings": true, + "profile:show_email": true, "profile:show_information": true, "profile:show_analytics_and_marketing": true, @@ -58,6 +60,7 @@ "project_homepage:show_examples": true, "project_addons:dedicated_ipv4_address": true, + "project_settings:custom_domains": true, "project_settings:show_disable_legacy_api_keys": true, "project_settings:legacy_jwt_keys": true, diff --git a/packages/common/enabled-features/enabled-features.schema.json b/packages/common/enabled-features/enabled-features.schema.json index d68bad99e3..91aa791d6b 100644 --- a/packages/common/enabled-features/enabled-features.schema.json +++ b/packages/common/enabled-features/enabled-features.schema.json @@ -148,6 +148,11 @@ "description": "Enable the logs collections page" }, + "organization:show_sso_settings": { + "type": "boolean", + "description": "Show the SSO settings tab in the organization settings page" + }, + "profile:show_email": { "type": "boolean", "description": "Show the user's email address in the toolbar" @@ -273,6 +278,7 @@ "profile:show_account_deletion", "logs:templates", "logs:collections", + "organization:show_sso_settings", "project_creation:show_advanced_config", "project_homepage:show_instance_size", "project_homepage:show_examples",