diff --git a/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.tsx b/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.tsx index cce80055c86..09fafe9e864 100644 --- a/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.tsx +++ b/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.tsx @@ -25,13 +25,13 @@ import { } from 'lucide-react' import dynamic from 'next/dynamic' import { useMemo } from 'react' +import type { CommandOptions, ICommand } from 'ui-patterns/CommandMenu' import { PageType, useRegisterCommands, useRegisterPage, useSetCommandMenuOpen, } from 'ui-patterns/CommandMenu' -import type { CommandOptions, ICommand } from 'ui-patterns/CommandMenu' import { COMMAND_MENU_SECTIONS } from './CommandMenu.utils' import { @@ -58,7 +58,6 @@ export function useCreateCommands(options?: CommandOptions) { setPage, openSidebar, snap, - authenticationOauth21, authEnabled, edgeFunctionsEnabled, storageEnabled, @@ -184,7 +183,7 @@ export function useCreateCommands(options?: CommandOptions) { }, ] : []), - ...(IS_PLATFORM && authenticationOauth21 + ...(IS_PLATFORM ? [ { id: 'create-oauth-app', @@ -207,7 +206,6 @@ export function useCreateCommands(options?: CommandOptions) { passwordVerificationHook, passwordVerificationHookEnabled, beforeUserCreatedHook, - authenticationOauth21, ] ) diff --git a/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.utils.tsx b/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.utils.tsx index 58d54a6af07..4c7adb5bdea 100644 --- a/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.utils.tsx +++ b/apps/studio/components/interfaces/App/CommandMenu/CreateCommands.utils.tsx @@ -1,4 +1,4 @@ -import { useFlag, useParams } from 'common' +import { useParams } from 'common' import type { Hook } from 'components/interfaces/Auth/Hooks/hooks.constants' import { HOOKS_DEFINITIONS } from 'components/interfaces/Auth/Hooks/hooks.constants' import { extractMethod, isValidHook } from 'components/interfaces/Auth/Hooks/hooks.utils' @@ -89,9 +89,6 @@ export function useCreateCommandsConfig() { const { openSidebar } = useSidebarManagerSnapshot() const snap = useAiAssistantStateSnapshot() - // Auth - const authenticationOauth21 = useFlag('EnableOAuth21') - const { projectAuthAll: authEnabled, projectEdgeFunctionAll: edgeFunctionsEnabled, @@ -182,7 +179,6 @@ export function useCreateCommandsConfig() { setPage, openSidebar, snap, - authenticationOauth21, authEnabled, edgeFunctionsEnabled, storageEnabled, diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx index c63dbd112e9..0ec643b3029 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx @@ -93,8 +93,7 @@ export const useUnifiedLogsPreview = () => { export const useIsBranching2Enabled = () => { const { flags } = useFeaturePreviewContext() - const gitlessBranchingEnabled = useFlag('gitlessBranching') - return gitlessBranchingEnabled && flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_BRANCHING_2_0] + return flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_BRANCHING_2_0] } export const useIsPgDeltaDiffEnabled = () => { @@ -105,8 +104,7 @@ export const useIsPgDeltaDiffEnabled = () => { export const useIsAdvisorRulesEnabled = () => { const { flags } = useFeaturePreviewContext() - const advisorRulesEnabled = useFlag('advisorRules') - return advisorRulesEnabled && flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_ADVISOR_RULES] + return flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_ADVISOR_RULES] } export const useIsQueueOperationsEnabled = () => { diff --git a/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts b/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts index ce54a339df1..c0c957bce91 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts +++ b/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts @@ -14,8 +14,6 @@ type FeaturePreview = { } export const useFeaturePreviews = (): FeaturePreview[] => { - const gitlessBranchingEnabled = useFlag('gitlessBranching') - const advisorRulesEnabled = useFlag('advisorRules') const isUnifiedLogsPreviewAvailable = useFlag('unifiedLogs') const tableEditorNewFilterBar = useFlag('tableEditorNewFilterBar') const pgDeltaDiffEnabled = useFlag('pgdeltaDiff') @@ -34,7 +32,7 @@ export const useFeaturePreviews = (): FeaturePreview[] => { key: LOCAL_STORAGE_KEYS.UI_PREVIEW_BRANCHING_2_0, name: 'Branching via dashboard', discussionsUrl: 'https://github.com/orgs/supabase/discussions/branching-2-0', - enabled: gitlessBranchingEnabled, + enabled: true, isNew: false, isPlatformOnly: true, isDefaultOptIn: false, @@ -43,7 +41,7 @@ export const useFeaturePreviews = (): FeaturePreview[] => { key: LOCAL_STORAGE_KEYS.UI_PREVIEW_ADVISOR_RULES, name: 'Disable Advisor rules', discussionsUrl: undefined, - enabled: advisorRulesEnabled, + enabled: true, isNew: false, isPlatformOnly: true, isDefaultOptIn: false, diff --git a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AddIntegrationDropdown.tsx b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AddIntegrationDropdown.tsx index 6b76fa8c9ef..d5ab1fa1936 100644 --- a/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AddIntegrationDropdown.tsx +++ b/apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AddIntegrationDropdown.tsx @@ -1,7 +1,5 @@ import { ChevronDown } from 'lucide-react' import Image from 'next/image' - -import { useFlag } from 'common' import { Button, cn, @@ -12,6 +10,7 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from 'ui' + import { getIntegrationTypeIcon, getIntegrationTypeLabel, @@ -52,8 +51,6 @@ export const AddIntegrationDropdown = ({ align = 'end', onSelectIntegrationType, }: AddIntegrationDropdownProps) => { - const isWorkOSEnabled = useFlag('isWorkOSTPAEnabled') - return ( @@ -64,12 +61,9 @@ export const AddIntegrationDropdown = ({ Select provider - - {isWorkOSEnabled && ( - - )} + diff --git a/apps/studio/components/interfaces/Integrations/Landing/useInstalledIntegrations.tsx b/apps/studio/components/interfaces/Integrations/Landing/useInstalledIntegrations.tsx index e28a7e7375b..b9d362895f7 100644 --- a/apps/studio/components/interfaces/Integrations/Landing/useInstalledIntegrations.tsx +++ b/apps/studio/components/interfaces/Integrations/Landing/useInstalledIntegrations.tsx @@ -1,4 +1,3 @@ -import { useFlag } from 'common' import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-extensions-query' import { useSchemasQuery } from 'data/database/schemas-query' import { useFDWsQuery } from 'data/fdw/fdws-query' @@ -19,7 +18,6 @@ import { export const useInstalledIntegrations = () => { const { data: project } = useSelectedProjectQuery() const { integrationsWrappers } = useIsFeatureEnabled(['integrations:wrappers']) - const stripeSyncEnabled = useFlag('enableStripeSyncEngineIntegration') const allIntegrations = useMemo(() => { return INTEGRATIONS.filter((integration) => { @@ -29,15 +27,12 @@ export const useInstalledIntegrations = () => { ) { return false } - if (!stripeSyncEnabled && integration.id === 'stripe_sync_engine') { - return false - } if (!IS_PLATFORM && integration.id === 'data_api') { return false } return true }) - }, [integrationsWrappers, stripeSyncEnabled]) + }, [integrationsWrappers]) const { data, diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx index d10fe19b30b..dc881ea3bbb 100644 --- a/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx +++ b/apps/studio/components/interfaces/JwtSecrets/jwt-secret-keys-table/index.tsx @@ -1,10 +1,5 @@ import { PermissionAction } from '@supabase/shared-types/out/constants' -import { AnimatePresence } from 'framer-motion' -import { AlertCircle, RotateCw, Timer } from 'lucide-react' -import { useMemo, useState } from 'react' -import { toast } from 'sonner' - -import { useFlag, useParams } from 'common' +import { useParams } from 'common' import { TextConfirmModal } from 'components/ui/TextConfirmModalWrapper' import { useLegacyAPIKeysStatusQuery } from 'data/api-keys/legacy-api-keys-status-query' import { useJWTSigningKeyDeleteMutation } from 'data/jwt-signing-keys/jwt-signing-key-delete-mutation' @@ -12,8 +7,12 @@ import { useJWTSigningKeyUpdateMutation } from 'data/jwt-signing-keys/jwt-signin import { JWTSigningKey, useJWTSigningKeysQuery } from 'data/jwt-signing-keys/jwt-signing-keys-query' import { useLegacyJWTSigningKeyCreateMutation } from 'data/jwt-signing-keys/legacy-jwt-signing-key-create-mutation' import { useLegacyJWTSigningKeyQuery } from 'data/jwt-signing-keys/legacy-jwt-signing-key-query' +import { AnimatePresence } from 'framer-motion' import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions' import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' +import { AlertCircle, RotateCw, Timer } from 'lucide-react' +import { useMemo, useState } from 'react' +import { toast } from 'sonner' import { AlertDialog, AlertDialogCancel, @@ -39,7 +38,7 @@ import { TableRow, } from 'ui' import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader' -import { SigningKeysComingSoonBanner } from '../signing-keys-coming-soon' + import { StartUsingJwtSigningKeysBanner } from '../start-using-keys-banner' import { ActionPanel } from './action-panel' import { CreateKeyDialog } from './create-key-dialog' @@ -53,8 +52,6 @@ export const JWTSecretKeysTable = () => { const { ref: projectRef } = useParams() const { data: project, isPending: isProjectLoading } = useSelectedProjectQuery() - const newJwtSecrets = useFlag('newJwtSecrets') - const [selectedKey, setSelectedKey] = useState() const [selectedKeyToUpdate, setSelectedKeyToUpdate] = useState() const [shownDialog, setShownDialog] = useState() @@ -182,10 +179,6 @@ export const JWTSecretKeysTable = () => { return } - if (!newJwtSecrets) { - return - } - return ( <>
diff --git a/apps/studio/components/interfaces/JwtSecrets/jwt-settings.tsx b/apps/studio/components/interfaces/JwtSecrets/jwt-settings.tsx index 47272a107c7..56a5d66fad1 100644 --- a/apps/studio/components/interfaces/JwtSecrets/jwt-settings.tsx +++ b/apps/studio/components/interfaces/JwtSecrets/jwt-settings.tsx @@ -4,6 +4,20 @@ import { JwtSecretUpdateProgress, JwtSecretUpdateStatus, } from '@supabase/shared-types/out/events' +import { useParams } from 'common' +import { ButtonTooltip } from 'components/ui/ButtonTooltip' +import { FormActions } from 'components/ui/Forms/FormActions' +import Panel from 'components/ui/Panel' +import { TextConfirmModal } from 'components/ui/TextConfirmModalWrapper' +import { useLegacyAPIKeysStatusQuery } from 'data/api-keys/legacy-api-keys-status-query' +import { useAuthConfigQuery } from 'data/auth/auth-config-query' +import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation' +import { useJwtSecretUpdateMutation } from 'data/config/jwt-secret-update-mutation' +import { useJwtSecretUpdatingStatusQuery } from 'data/config/jwt-secret-updating-status-query' +import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-config-query' +import { useLegacyJWTSigningKeyQuery } from 'data/jwt-signing-keys/legacy-jwt-signing-key-query' +import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions' +import { uuidv4 } from 'lib/helpers' import { AlertCircle, ChevronDown, @@ -23,21 +37,6 @@ import { import Link from 'next/link' import { Dispatch, SetStateAction, useState } from 'react' import { toast } from 'sonner' - -import { useFlag, useParams } from 'common' -import { ButtonTooltip } from 'components/ui/ButtonTooltip' -import { FormActions } from 'components/ui/Forms/FormActions' -import Panel from 'components/ui/Panel' -import { TextConfirmModal } from 'components/ui/TextConfirmModalWrapper' -import { useLegacyAPIKeysStatusQuery } from 'data/api-keys/legacy-api-keys-status-query' -import { useAuthConfigQuery } from 'data/auth/auth-config-query' -import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation' -import { useJwtSecretUpdateMutation } from 'data/config/jwt-secret-update-mutation' -import { useJwtSecretUpdatingStatusQuery } from 'data/config/jwt-secret-updating-status-query' -import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-config-query' -import { useLegacyJWTSigningKeyQuery } from 'data/jwt-signing-keys/legacy-jwt-signing-key-query' -import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions' -import { uuidv4 } from 'lib/helpers' import { Button, DropdownMenu, @@ -52,6 +51,7 @@ import { } from 'ui' import { Admonition } from 'ui-patterns/admonition' import { number, object } from 'yup' + import { JWT_SECRET_UPDATE_ERROR_MESSAGES, JWT_SECRET_UPDATE_PROGRESS_MESSAGES, @@ -66,8 +66,6 @@ const schema = object({ const JWTSettings = () => { const { ref: projectRef } = useParams() - const newJwtSecrets = useFlag('newJwtSecrets') - const [customToken, setCustomToken] = useState('') const [showCustomTokenInput, setShowCustomTokenInput] = useState(false) const [isCreatingKey, setIsCreatingKey] = useState(false) @@ -276,7 +274,7 @@ const JWTSettings = () => { disabled={!canUpdateConfig || isLoadingAuthConfig} /> - {newJwtSecrets && !legacyKey && ( + {!legacyKey && ( <> {isUpdatingJwtSecret && (
@@ -388,89 +386,6 @@ const JWTSettings = () => {
)} - - {!newJwtSecrets && ( -
-
- {isUpdatingJwtSecret ? ( -
- -

- Updating JWT secret: {jwtSecretUpdateProgressMessage} -

-
- ) : ( -
-
-
-

Generate a new JWT secret

-

- A random secret will be created, or you can create your own. -

-
-
- {isUpdatingJwtSecret ? ( - - ) : !canGenerateNewJWTSecret ? ( - } - tooltip={{ - content: { - side: 'bottom', - text: 'You need additional permissions to generate a new JWT secret', - }, - }} - > - Generate a new secret - - ) : ( - - - - - - setIsGeneratingKey(true)} - > - -

Generate a random secret

-
- - setIsCreatingKey(true)} - > - -

Create my own secret

-
-
-
- )} -
-
-
- )} -
- {isJwtSecretUpdateFailed ? ( - - Please try again. If the failures persist, please contact Supabase - support with the following details:
- Change tracking ID: {data?.changeTrackingId}
- Error message: {jwtSecretUpdateErrorMessage} -
- ) : null} -
- )} )} diff --git a/apps/studio/components/interfaces/JwtSecrets/signing-keys-coming-soon.tsx b/apps/studio/components/interfaces/JwtSecrets/signing-keys-coming-soon.tsx deleted file mode 100644 index dcfdb7999ff..00000000000 --- a/apps/studio/components/interfaces/JwtSecrets/signing-keys-coming-soon.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { Github } from 'lucide-react' -import { Button } from 'ui' - -import { FeatureBanner } from 'components/ui/FeatureBanner' - -export const SigningKeysComingSoonBanner = () => { - return ( - -
-

JWT signing keys are coming soon

-

- We're rolling out JWT signing keys to better support your application needs. -

-
- -
-
-
- ) -} diff --git a/apps/studio/components/interfaces/QueryPerformance/QueryDetail.tsx b/apps/studio/components/interfaces/QueryPerformance/QueryDetail.tsx index 4aa6696c21e..3d1bcdcf98f 100644 --- a/apps/studio/components/interfaces/QueryPerformance/QueryDetail.tsx +++ b/apps/studio/components/interfaces/QueryPerformance/QueryDetail.tsx @@ -1,4 +1,3 @@ -import { useFlag } from 'common' import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider' import { AiAssistantDropdown } from 'components/ui/AiAssistantDropdown' import { formatSql } from 'lib/formatSql' @@ -40,8 +39,6 @@ export const QueryDetail = ({ selectedRow, onClickViewSuggestion, onClose }: Que const aiSnap = useAiAssistantStateSnapshot() const track = useTrack() - const showExplainWithAiInQueryPerformance = useFlag('ShowExplainWithAiInQueryPerformance') - useEffect(() => { if (selectedRow !== undefined) { const formattedQuery = formatSql(selectedRow['query']) @@ -85,16 +82,14 @@ export const QueryDetail = ({ selectedRow, onClickViewSuggestion, onClose }: Que

Query pattern

- {showExplainWithAiInQueryPerformance && ( - - )} +
{ const showVercelIntegration = useIsFeatureEnabled('integrations:vercel') const showAWSPrivateLinkFeature = useIsFeatureEnabled('integrations:aws_private_link') - const showAWSPrivateLinkConfigCat = useFlag('awsPrivateLinkIntegration') // PrivateLink is not available in eu-central-2 (Zurich) until Feb 2026 const isPrivateLinkUnsupportedRegion = project?.region === 'eu-central-2' - const showAWSPrivateLink = - showAWSPrivateLinkFeature && showAWSPrivateLinkConfigCat && !isPrivateLinkUnsupportedRegion + const showAWSPrivateLink = showAWSPrivateLinkFeature && !isPrivateLinkUnsupportedRegion return ( <> diff --git a/apps/studio/components/layouts/AdvisorsLayout/AdvisorsMenu.utils.tsx b/apps/studio/components/layouts/AdvisorsLayout/AdvisorsMenu.utils.tsx index 64ae4be38c5..142d8f93ac1 100644 --- a/apps/studio/components/layouts/AdvisorsLayout/AdvisorsMenu.utils.tsx +++ b/apps/studio/components/layouts/AdvisorsLayout/AdvisorsMenu.utils.tsx @@ -3,10 +3,7 @@ import type { Project } from 'data/projects/project-detail-query' import { IS_PLATFORM } from 'lib/constants' import { ArrowUpRight } from 'lucide-react' -export const generateAdvisorsMenu = ( - project?: Project, - features?: { advisorRules: boolean } -): ProductMenuGroup[] => { +export const generateAdvisorsMenu = (project?: Project): ProductMenuGroup[] => { const ref = project?.ref ?? 'default' return [ @@ -34,7 +31,7 @@ export const generateAdvisorsMenu = ( }, ], }, - ...(IS_PLATFORM && features?.advisorRules + ...(IS_PLATFORM ? [ { title: 'Configuration', diff --git a/apps/studio/components/layouts/AdvisorsLayout/AdvisorsSidebarMenu.tsx b/apps/studio/components/layouts/AdvisorsLayout/AdvisorsSidebarMenu.tsx index 1e37981afd9..770e0788420 100644 --- a/apps/studio/components/layouts/AdvisorsLayout/AdvisorsSidebarMenu.tsx +++ b/apps/studio/components/layouts/AdvisorsLayout/AdvisorsSidebarMenu.tsx @@ -1,9 +1,9 @@ -import { useIsAdvisorRulesEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider' import { ProductMenu } from 'components/ui/ProductMenu' import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state' import { Badge, Button } from 'ui' + import { FeaturePreviewSidebarPanel } from '../../ui/FeaturePreviewSidebarPanel' import { generateAdvisorsMenu } from './AdvisorsMenu.utils' @@ -13,7 +13,6 @@ interface AdvisorsSidebarMenuProps { export function AdvisorsSidebarMenu({ page }: AdvisorsSidebarMenuProps) { const { data: project } = useSelectedProjectQuery() - const advisorRules = useIsAdvisorRulesEnabled() const { toggleSidebar } = useSidebarManagerSnapshot() const handleOpenAdvisor = () => { @@ -34,7 +33,7 @@ export function AdvisorsSidebarMenu({ page }: AdvisorsSidebarMenuProps) { } /> - +
) } diff --git a/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx b/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx index 1c0d21ef48e..716618a7645 100644 --- a/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx +++ b/apps/studio/components/layouts/AuthLayout/AuthLayout.tsx @@ -1,55 +1,23 @@ +import { useParams } from 'common' +import { ProductMenu } from 'components/ui/ProductMenu' +import { useAuthConfigPrefetch } from 'data/auth/auth-config-query' +import { withAuth } from 'hooks/misc/withAuth' import { useRouter } from 'next/router' import { PropsWithChildren } from 'react' -import { useFlag, useParams } from 'common' -import { ProductMenu } from 'components/ui/ProductMenu' -import { useAuthConfigPrefetch } from 'data/auth/auth-config-query' -import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled' -import { withAuth } from 'hooks/misc/withAuth' import { ProjectLayout } from '../ProjectLayout' -import { generateAuthMenu } from './AuthLayout.utils' +import { useGenerateAuthMenu } from './AuthLayout.utils' const AuthProductMenu = () => { const router = useRouter() const { ref: projectRef = 'default' } = useParams() - const authenticationShowOverview = useFlag('authOverviewPage') - const authenticationOauth21 = useFlag('EnableOAuth21') - - const { - authenticationSignInProviders, - authenticationRateLimits, - authenticationEmails, - authenticationMultiFactor, - authenticationAttackProtection, - authenticationPerformance, - } = useIsFeatureEnabled([ - 'authentication:sign_in_providers', - 'authentication:rate_limits', - 'authentication:emails', - 'authentication:multi_factor', - 'authentication:attack_protection', - 'authentication:performance', - ]) - useAuthConfigPrefetch({ projectRef }) const page = router.pathname.split('/')[4] - return ( - - ) + const menu = useGenerateAuthMenu() + + return } const AuthLayout = ({ children }: PropsWithChildren<{}>) => { diff --git a/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts b/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts index 478aea25486..1fe0504cf67 100644 --- a/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts +++ b/apps/studio/components/layouts/AuthLayout/AuthLayout.utils.ts @@ -1,48 +1,45 @@ +import { useFlag, useParams } from 'common' import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types' import { IS_PLATFORM } from 'lib/constants' -export const generateAuthMenu = ( - ref: string, - flags?: { - authenticationSignInProviders: boolean - authenticationRateLimits: boolean - authenticationEmails: boolean - authenticationMultiFactor: boolean - authenticationAttackProtection: boolean - authenticationShowOverview: boolean - authenticationOauth21: boolean - authenticationPerformance: boolean - } -): ProductMenuGroup[] => { +import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled' + +export const useGenerateAuthMenu = (): ProductMenuGroup[] => { + const { ref } = useParams() + const authenticationShowOverview = useFlag('authOverviewPage') + const { authenticationSignInProviders, authenticationRateLimits, authenticationEmails, authenticationMultiFactor, authenticationAttackProtection, - authenticationShowOverview, - authenticationOauth21, authenticationPerformance, - } = flags ?? {} + } = useIsFeatureEnabled([ + 'authentication:sign_in_providers', + 'authentication:rate_limits', + 'authentication:emails', + 'authentication:multi_factor', + 'authentication:attack_protection', + 'authentication:performance', + ]) + + const baseUrl = `/project/${ref}/auth` return [ { title: 'Manage', items: [ ...(authenticationShowOverview - ? [{ name: 'Overview', key: 'overview', url: `/project/${ref}/auth/overview`, items: [] }] - : []), - { name: 'Users', key: 'users', url: `/project/${ref}/auth/users`, items: [] }, - ...(authenticationOauth21 - ? [ - { - name: 'OAuth Apps', - key: 'oauth-apps', - url: `/project/${ref}/auth/oauth-apps`, - items: [], - }, - ] + ? [{ name: 'Overview', key: 'overview', url: `${baseUrl}/overview`, items: [] }] : []), + { name: 'Users', key: 'users', url: `${baseUrl}/users`, items: [] }, + { + name: 'OAuth Apps', + key: 'oauth-apps', + url: `${baseUrl}/oauth-apps`, + items: [], + }, ], }, ...(authenticationEmails && IS_PLATFORM @@ -56,7 +53,7 @@ export const generateAuthMenu = ( name: 'Email', key: 'email', pages: ['templates', 'smtp'], - url: `/project/${ref}/auth/templates`, + url: `${baseUrl}/templates`, items: [], }, ] @@ -71,7 +68,7 @@ export const generateAuthMenu = ( { name: 'Policies', key: 'policies', - url: `/project/${ref}/auth/policies`, + url: `${baseUrl}/policies`, items: [], }, ...(IS_PLATFORM @@ -82,25 +79,21 @@ export const generateAuthMenu = ( name: 'Sign In / Providers', key: 'sign-in-up', pages: ['providers', 'third-party'], - url: `/project/${ref}/auth/providers`, + url: `${baseUrl}/providers`, items: [], }, ] : []), - ...(authenticationOauth21 - ? [ - { - name: 'OAuth Server', - key: 'oauth-server', - url: `/project/${ref}/auth/oauth-server`, - label: 'Beta', - }, - ] - : []), + { + name: 'OAuth Server', + key: 'oauth-server', + url: `${baseUrl}/oauth-server`, + label: 'Beta', + }, { name: 'Sessions', key: 'sessions', - url: `/project/${ref}/auth/sessions`, + url: `${baseUrl}/sessions`, items: [], }, ...(authenticationRateLimits @@ -108,7 +101,7 @@ export const generateAuthMenu = ( { name: 'Rate Limits', key: 'rate-limits', - url: `/project/${ref}/auth/rate-limits`, + url: `${baseUrl}/rate-limits`, items: [], }, ] @@ -118,7 +111,7 @@ export const generateAuthMenu = ( { name: 'Multi-Factor', key: 'mfa', - url: `/project/${ref}/auth/mfa`, + url: `${baseUrl}/mfa`, items: [], }, ] @@ -126,7 +119,7 @@ export const generateAuthMenu = ( { name: 'URL Configuration', key: 'url-configuration', - url: `/project/${ref}/auth/url-configuration`, + url: `${baseUrl}/url-configuration`, items: [], }, ...(authenticationAttackProtection @@ -134,7 +127,7 @@ export const generateAuthMenu = ( { name: 'Attack Protection', key: 'protection', - url: `/project/${ref}/auth/protection`, + url: `${baseUrl}/protection`, items: [], }, ] @@ -142,14 +135,14 @@ export const generateAuthMenu = ( { name: 'Auth Hooks', key: 'hooks', - url: `/project/${ref}/auth/hooks`, + url: `${baseUrl}/hooks`, items: [], label: 'Beta', }, { name: 'Audit Logs', key: 'audit-logs', - url: `/project/${ref}/auth/audit-logs`, + url: `${baseUrl}/audit-logs`, items: [], }, ...(authenticationPerformance @@ -157,7 +150,7 @@ export const generateAuthMenu = ( { name: 'Performance', key: 'performance', - url: `/project/${ref}/auth/performance`, + url: `${baseUrl}/performance`, items: [], }, ] diff --git a/apps/studio/hooks/use-check-latest-deploy.tsx b/apps/studio/hooks/use-check-latest-deploy.tsx index 8cbbae1a84c..fe19496d035 100644 --- a/apps/studio/hooks/use-check-latest-deploy.tsx +++ b/apps/studio/hooks/use-check-latest-deploy.tsx @@ -1,10 +1,9 @@ +import { IS_PLATFORM } from 'common' +import { useDeploymentCommitQuery } from 'data/utils/deployment-commit-query' import dayjs from 'dayjs' import { useRouter } from 'next/router' import { useEffect, useRef, useState } from 'react' import { toast } from 'sonner' - -import { IS_PLATFORM, useFlag } from 'common' -import { useDeploymentCommitQuery } from 'data/utils/deployment-commit-query' import { Button, StatusIcon } from 'ui' const DeployCheckToast = ({ id }: { id: string | number }) => { @@ -34,8 +33,6 @@ const DeployCheckToast = ({ id }: { id: string | number }) => { // there's a new version of Studio is available, and the user has been on the old dashboard (based on commit) for more than 24 hours. // [Joshen] K-Dog has a suggestion here to bring down the time period here by checking commits export function useCheckLatestDeploy() { - const showRefreshToast = useFlag('showRefreshToast') - const [currentCommitTime, setCurrentCommitTime] = useState('') const [isToastShown, setIsToastShown] = useState(false) @@ -59,7 +56,7 @@ export function useCheckLatestDeploy() { }, [commit]) useEffect(() => { - if (!showRefreshToast || !commit || commit.commitTime === 'unknown') { + if (!commit || commit.commitTime === 'unknown') { return } @@ -91,5 +88,5 @@ export function useCheckLatestDeploy() { position: 'bottom-right', }) setIsToastShown(true) - }, [commit, showRefreshToast, isToastShown, currentCommitTime]) + }, [commit, isToastShown, currentCommitTime]) } diff --git a/apps/studio/pages/api/integrations/stripe-sync.ts b/apps/studio/pages/api/integrations/stripe-sync.ts index 0c355302027..3e43dd7de11 100644 --- a/apps/studio/pages/api/integrations/stripe-sync.ts +++ b/apps/studio/pages/api/integrations/stripe-sync.ts @@ -4,8 +4,6 @@ import { VERSION } from 'stripe-experiment-sync' import { install, uninstall } from 'stripe-experiment-sync/supabase' import { z } from 'zod' -const ENABLE_FLAG_KEY = 'enableStripeSyncEngineIntegration' - const InstallBodySchema = z.object({ projectRef: z.string().min(1), stripeSecretKey: z.string().min(1), diff --git a/apps/studio/pages/project/[ref]/integrations/[id]/[pageId]/index.tsx b/apps/studio/pages/project/[ref]/integrations/[id]/[pageId]/index.tsx index a67fda5142d..030eb5cf126 100644 --- a/apps/studio/pages/project/[ref]/integrations/[id]/[pageId]/index.tsx +++ b/apps/studio/pages/project/[ref]/integrations/[id]/[pageId]/index.tsx @@ -1,4 +1,4 @@ -import { useFlag, useParams } from 'common' +import { useParams } from 'common' import { INTEGRATIONS } from 'components/interfaces/Integrations/Landing/Integrations.constants' import { useInstalledIntegrations } from 'components/interfaces/Integrations/Landing/useInstalledIntegrations' import { DefaultLayout } from 'components/layouts/DefaultLayout' @@ -41,7 +41,6 @@ const IntegrationPage: NextPageWithLayout = () => { const router = useRouter() const { ref, id, pageId, childId } = useParams() const { integrationsWrappers } = useIsFeatureEnabled(['integrations:wrappers']) - const stripeSyncEnabled = useFlag('enableStripeSyncEngineIntegration') const { installedIntegrations: installedIntegrations, isLoading: isIntegrationsLoading } = useInstalledIntegrations() @@ -140,10 +139,6 @@ const IntegrationPage: NextPageWithLayout = () => { return } - if (id === 'stripe_sync_engine' && !stripeSyncEnabled) { - return - } - if (!integrationsWrappers && id?.endsWith('_wrapper')) { return } diff --git a/apps/studio/pages/project/[ref]/integrations/index.tsx b/apps/studio/pages/project/[ref]/integrations/index.tsx index 4e777008403..79e163acc97 100644 --- a/apps/studio/pages/project/[ref]/integrations/index.tsx +++ b/apps/studio/pages/project/[ref]/integrations/index.tsx @@ -1,7 +1,3 @@ -import { Search } from 'lucide-react' -import { parseAsString, useQueryState } from 'nuqs' -import { useMemo } from 'react' - import { IntegrationCard, IntegrationLoadingCard, @@ -13,6 +9,9 @@ import { AlertError } from 'components/ui/AlertError' import { DocsButton } from 'components/ui/DocsButton' import { NoSearchResults } from 'components/ui/NoSearchResults' import { DOCS_URL } from 'lib/constants' +import { Search } from 'lucide-react' +import { parseAsString, useQueryState } from 'nuqs' +import { useMemo } from 'react' import type { NextPageWithLayout } from 'types' import { Input } from 'ui-patterns/DataInputs/Input' import { PageContainer } from 'ui-patterns/PageContainer' @@ -25,9 +24,8 @@ import { PageHeaderTitle, } from 'ui-patterns/PageHeader' import { PageSection, PageSectionContent, PageSectionMeta } from 'ui-patterns/PageSection' -import { useFlag } from 'common' -const FEATURED_INTEGRATIONS = ['cron', 'queues'] // + either stripe_sync_engine or stripe_wrapper depending on feature flag +const FEATURED_INTEGRATIONS = ['cron', 'queues', 'stripe_sync_engine'] // Featured integration images const FEATURED_INTEGRATION_IMAGES: Record = { @@ -47,16 +45,6 @@ const IntegrationsPage: NextPageWithLayout = () => { parseAsString.withDefault('').withOptions({ clearOnDefault: true }) ) - const isStripeSyncEngineEnabled = useFlag('enableStripeSyncEngineIntegration') - - const featuredIntegrationIds = useMemo(() => { - if (isStripeSyncEngineEnabled) { - return FEATURED_INTEGRATIONS.concat(['stripe_sync_engine']) - } else { - return FEATURED_INTEGRATIONS.concat(['stripe_wrapper']) - } - }, [isStripeSyncEngineEnabled]) - const { availableIntegrations, installedIntegrations, error, isError, isLoading, isSuccess } = useInstalledIntegrations() @@ -117,7 +105,7 @@ const IntegrationsPage: NextPageWithLayout = () => { } const featured = filteredAndSortedIntegrations.filter((i) => - featuredIntegrationIds.includes(i.id) + FEATURED_INTEGRATIONS.includes(i.id) ) const allIntegrations = filteredAndSortedIntegrations // Include all integrations, including featured