diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreview.constants.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreview.constants.tsx index f7448acba9807..9a56fd87b21e4 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreview.constants.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreview.constants.tsx @@ -1,9 +1,16 @@ import { LOCAL_STORAGE_KEYS } from 'common' export const FEATURE_PREVIEWS = [ + { + key: LOCAL_STORAGE_KEYS.UI_PREVIEW_NEW_STORAGE_UI, + name: 'New Storage interface', + discussionsUrl: undefined, + isNew: true, + isPlatformOnly: false, + }, { key: LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS, - name: 'New Logs Interface', + name: 'New Logs interface', discussionsUrl: 'https://github.com/orgs/supabase/discussions/37234', isNew: true, isPlatformOnly: true, diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx index e33348dd18dc4..885724aca13c0 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx @@ -110,12 +110,18 @@ export const useIsAdvisorRulesEnabled = () => { return flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_ADVISOR_RULES] } +export const useIsNewStorageUIEnabled = () => { + const { flags } = useFeaturePreviewContext() + return flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_NEW_STORAGE_UI] +} + export const useFeaturePreviewModal = () => { const [featurePreviewModal, setFeaturePreviewModal] = useQueryState('featurePreviewModal') const gitlessBranchingEnabled = useFlag('gitlessBranching') const advisorRulesEnabled = useFlag('advisorRules') const isUnifiedLogsPreviewAvailable = useFlag('unifiedLogs') + const isNewStorageUIAvailable = useFlag('storageAnalyticsVector') const selectedFeatureKeyFromQuery = featurePreviewModal?.trim() ?? null const showFeaturePreviewModal = selectedFeatureKeyFromQuery !== null @@ -130,6 +136,8 @@ export const useFeaturePreviewModal = () => { return advisorRulesEnabled case 'supabase-ui-preview-unified-logs': return isUnifiedLogsPreviewAvailable + case 'new-storage-ui': + return isNewStorageUIAvailable default: return true } diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx index 751c08f92c961..ec463be8a6477 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx @@ -14,6 +14,7 @@ import { CLSPreview } from './CLSPreview' import { FEATURE_PREVIEWS } from './FeaturePreview.constants' import { useFeaturePreviewContext, useFeaturePreviewModal } from './FeaturePreviewContext' import { InlineEditorPreview } from './InlineEditorPreview' +import { NewStorageUIPreview } from './NewStorageUIPreview' import { UnifiedLogsPreview } from './UnifiedLogsPreview' const FEATURE_PREVIEW_KEY_TO_CONTENT: { @@ -25,6 +26,7 @@ const FEATURE_PREVIEW_KEY_TO_CONTENT: { [LOCAL_STORAGE_KEYS.UI_PREVIEW_API_SIDE_PANEL]: , [LOCAL_STORAGE_KEYS.UI_PREVIEW_CLS]: , [LOCAL_STORAGE_KEYS.UI_PREVIEW_UNIFIED_LOGS]: , + [LOCAL_STORAGE_KEYS.UI_PREVIEW_NEW_STORAGE_UI]: , } const FeaturePreviewModal = () => { diff --git a/apps/studio/components/interfaces/App/FeaturePreview/NewStorageUIPreview.tsx b/apps/studio/components/interfaces/App/FeaturePreview/NewStorageUIPreview.tsx new file mode 100644 index 0000000000000..6225b04d5237c --- /dev/null +++ b/apps/studio/components/interfaces/App/FeaturePreview/NewStorageUIPreview.tsx @@ -0,0 +1,42 @@ +import Image from 'next/image' + +import { useParams } from 'common' +import { InlineLink } from 'components/ui/InlineLink' +import { BASE_PATH } from 'lib/constants' +import { useIsNewStorageUIEnabled } from './FeaturePreviewContext' + +export const NewStorageUIPreview = () => { + const { ref } = useParams() + const isStorageV2 = useIsNewStorageUIEnabled() + + return ( +
+

+ Experience our enhanced{' '} + + Storage interface + {' '} + with support for analytics and vector bucket types. +

+ new-storage-preview +
+

Enabling this preview will:

+
    +
  • Move Storage buckets from the sidebar into the main content area
  • +
  • Change the role of the sidebar to a bucket type selector
  • +
  • Nest settings and policies under their respective bucket types
  • +
+

+ These changes are necessary to support incoming analytics and vector bucket types. File + storage will remain the default, and be shown by default when entering Storage. +

+
+
+ ) +} diff --git a/apps/studio/components/interfaces/App/FeaturePreview/UnifiedLogsPreview.tsx b/apps/studio/components/interfaces/App/FeaturePreview/UnifiedLogsPreview.tsx index b757cba8f45a1..0edff67d49fe8 100644 --- a/apps/studio/components/interfaces/App/FeaturePreview/UnifiedLogsPreview.tsx +++ b/apps/studio/components/interfaces/App/FeaturePreview/UnifiedLogsPreview.tsx @@ -16,7 +16,7 @@ export const UnifiedLogsPreview = () => { className="rounded border mb-4" />

- Experience our enhanced logs interface with improved filtering, real-time updates, and a + 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.

@@ -26,8 +26,8 @@ export const UnifiedLogsPreview = () => {

Enabling this preview will:

  • - Replace the current logs interface on the{' '} - logs page with a unified view + Replace the current Logs interface on the{' '} + Logs page with a unified view
  • Provide enhanced filtering capabilities and real-time log streaming
  • Improve performance with optimized data loading and virtualization
  • diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx index 186616f953ee6..b7a152514bebb 100644 --- a/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx +++ b/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx @@ -4,10 +4,9 @@ import { useRouter } from 'next/router' import { useState } from 'react' import { useParams } from 'common/hooks' -import Table from 'components/to-be-cleaned/Table' +import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query' import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query' import type { EdgeFunctionsResponse } from 'data/edge-functions/edge-functions-query' -import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' import { copyToClipboard, TableCell, TableRow, Tooltip, TooltipContent, TooltipTrigger } from 'ui' interface EdgeFunctionsListItemProps { @@ -17,20 +16,17 @@ interface EdgeFunctionsListItemProps { export const EdgeFunctionsListItem = ({ function: item }: EdgeFunctionsListItemProps) => { const router = useRouter() const { ref } = useParams() - const { data: project } = useSelectedProjectQuery() const [isCopied, setIsCopied] = useState(false) + const { data: settings } = useProjectSettingsV2Query({ projectRef: ref }) const { data: customDomainData } = useCustomDomainsQuery({ projectRef: ref }) - // get the .co or .net TLD from the restUrl - const restUrl = project?.restUrl - const restUrlTld = restUrl !== undefined ? new URL(restUrl).hostname.split('.').pop() : 'co' - const functionUrl = `https://${ref}.supabase.${restUrlTld}/functions/v1/${item.slug}` - - const endpoint = + const protocol = settings?.app_config?.protocol ?? 'https' + const endpoint = settings?.app_config?.endpoint ?? '' + const functionUrl = customDomainData?.customDomain?.status === 'active' ? `https://${customDomainData.customDomain.hostname}/functions/v1/${item.slug}` - : functionUrl + : `${protocol}://${endpoint}/functions/v1/${item.slug}` return (
    -

    - {endpoint} +

    + {functionUrl}