From ba2c83decca26abfd12b8caeec2f9701de49d1d2 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Fri, 18 Jul 2025 01:08:13 +0800 Subject: [PATCH] Gate unified logs to team and above (#37260) --- .../App/FeaturePreview/FeaturePreviewContext.tsx | 7 ++++++- .../interfaces/App/FeaturePreview/UnifiedLogsPreview.tsx | 3 +++ .../components/layouts/LogsLayout/LogsSidebarMenuV2.tsx | 7 ++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx index 0ab0b040922..2578ca33fa2 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx @@ -11,6 +11,7 @@ import { } from 'react' import { FeatureFlagContext, LOCAL_STORAGE_KEYS } from 'common' +import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization' import { useFlag, useIsRealtimeSettingsFFEnabled } from 'hooks/ui/useFlag' import { EMPTY_OBJ } from 'lib/void' import { FEATURE_PREVIEWS } from './FeaturePreview.constants' @@ -91,8 +92,12 @@ export const useIsInlineEditorEnabled = () => { } export const useUnifiedLogsPreview = () => { + const organization = useSelectedOrganization() const { flags, onUpdateFlag } = useFeaturePreviewContext() - const isEnabled = flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS] + + const isTeamsOrEnterprise = ['team', 'enterprise'].includes(organization?.plan.id ?? '') + const isEnabled = isTeamsOrEnterprise && flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS] + const enable = () => onUpdateFlag(LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS, true) const disable = () => onUpdateFlag(LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS, false) return { isEnabled, enable, disable } diff --git a/apps/studio/components/interfaces/App/FeaturePreview/UnifiedLogsPreview.tsx b/apps/studio/components/interfaces/App/FeaturePreview/UnifiedLogsPreview.tsx index 981d98ad42e..b757cba8f45 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/UnifiedLogsPreview.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/UnifiedLogsPreview.tsx @@ -19,6 +19,9 @@ export const UnifiedLogsPreview = () => { Experience our enhanced logs interface with improved filtering, real-time updates, and a unified view across all your services. Built for better performance and easier debugging.

+

+ This interface will only be available for organizations on the Team plan or above. +

Enabling this preview will: