From e5cede3d4a4d4536daec11f214ce3da3d0aaa0b4 Mon Sep 17 00:00:00 2001 From: Danny White <3104761+dnywh@users.noreply.github.com> Date: Fri, 14 Aug 2026 12:11:40 +1000 Subject: [PATCH] restack vercel privatelink prototype onto the generic ui stack --- .../steps/direct-connection/content.tsx | 16 ++ .../NetworkRestrictions.tsx | 12 ++ .../AWSPrivateLink.utils.test.ts | 20 +- .../AWSPrivateLink/AWSPrivateLink.utils.ts | 9 +- .../AWSPrivateLinkAccountItem.tsx | 18 +- .../AWSPrivateLink/AWSPrivateLinkForm.tsx | 87 ++++++-- .../AWSPrivateLink/AWSPrivateLinkSection.tsx | 10 +- .../AWSPrivateLink/preview/EXTRACT.md | 48 +++++ .../preview/PrivateLinkPreviewPanel.tsx | 116 +++++++++++ .../PrivateLinkPreviewVercelOverride.tsx | 68 ++++++ .../AWSPrivateLink/preview/index.ts | 6 + .../preview/privateLinkPreview.constants.ts | 193 ++++++++++++++++++ .../preview/privateLinkPreview.mocks.ts | 90 ++++++++ .../preview/privateLinkPreview.store.ts | 111 ++++++++++ .../preview/privateLinkPreview.utils.test.ts | 96 +++++++++ .../VercelIntegration/VercelSection.tsx | 171 ++++++++++------ .../AppLayout/OrganizationDropdown.test.tsx | 4 + .../AppLayout/OrganizationDropdown.tsx | 6 +- .../AppLayout/ProjectDropdown.test.tsx | 4 + .../layouts/AppLayout/ProjectDropdown.tsx | 13 +- .../components/layouts/DefaultLayout.tsx | 2 + .../data/aws-accounts/aws-accounts-query.ts | 3 + 22 files changed, 1004 insertions(+), 99 deletions(-) create mode 100644 apps/studio/components/interfaces/Settings/Integrations/AWSPrivateLink/preview/EXTRACT.md create mode 100644 apps/studio/components/interfaces/Settings/Integrations/AWSPrivateLink/preview/PrivateLinkPreviewPanel.tsx create mode 100644 apps/studio/components/interfaces/Settings/Integrations/AWSPrivateLink/preview/PrivateLinkPreviewVercelOverride.tsx create mode 100644 apps/studio/components/interfaces/Settings/Integrations/AWSPrivateLink/preview/index.ts create mode 100644 apps/studio/components/interfaces/Settings/Integrations/AWSPrivateLink/preview/privateLinkPreview.constants.ts create mode 100644 apps/studio/components/interfaces/Settings/Integrations/AWSPrivateLink/preview/privateLinkPreview.mocks.ts create mode 100644 apps/studio/components/interfaces/Settings/Integrations/AWSPrivateLink/preview/privateLinkPreview.store.ts create mode 100644 apps/studio/components/interfaces/Settings/Integrations/AWSPrivateLink/preview/privateLinkPreview.utils.test.ts diff --git a/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx index d6d3dc3c130..770073cb1e3 100644 --- a/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx +++ b/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx @@ -1,7 +1,9 @@ import { useParams } from 'common' import { Check, KeyRound } from 'lucide-react' import { useMemo, useState } from 'react' +import { Admonition } from 'ui-patterns/Admonition' import { CodeBlock } from 'ui-patterns/CodeBlock' +import { Input as CopyableInput } from 'ui-patterns/DataInputs/Input' import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader' import { buildConnectionStringPooler, getConnectionStrings } from '../../../DatabaseSettings.utils' @@ -29,6 +31,10 @@ import { } from '@/components/interfaces/ConnectSheet/ConnectionString.utils' import { PasswordEncodingNote } from '@/components/interfaces/ConnectSheet/PasswordEncodingNote' import { ResetDbPasswordDialog } from '@/components/interfaces/Settings/Database/DatabaseSettings/ResetDbPasswordDialog' +import { + PRIVATE_LINK_PREVIEW_HOSTNAME, + usePrivateLinkPreview, +} from '@/components/interfaces/Settings/Integrations/AWSPrivateLink/preview' import { InlineLink } from '@/components/ui/InlineLink' import { usePgbouncerConfigQuery } from '@/data/database/pgbouncer-config-query' import { useSupavisorConfigurationQuery } from '@/data/database/supavisor-configuration-query' @@ -153,6 +159,7 @@ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) { const track = useTrack() const { hasAccess: hasDedicatedPooler } = useCheckEntitlements('dedicated_pooler') const isHighAvailability = useIsHighAvailability() + const { showPrivateHostname } = usePrivateLinkPreview() const [temporaryDatabasePassword, setTemporaryDatabasePassword] = useState('') const connectionSource = state.connectionSource @@ -245,6 +252,15 @@ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) { return (
{databaseLabel}
}+ Prototype only. Off unless the URL has `{PRIVATE_LINK_PREVIEW_QUERY}=1`. Do not ship. +
+{preview.config.description}
++ {preview.config.source === 'real-api' ? 'Real API' : 'Mocked platform'} +
+ + {preview.b5Note && ( ++ {preview.b5Note} +
+ )} + + {preview.scenario === 'aws-direct-waiting' && ( + + )} + + ++ Private database path is in AWS PrivateLink below. +
+
Your Vercel connection can access {vercelProjectCount} Vercel projects. To change
which projects Supabase may use, open your organization’s{' '}
@@ -235,3 +239,40 @@ export const VercelSection = ({ isProjectScoped }: { isProjectScoped: boolean })
)
}
+
+function VercelInstallEmptyState({ href, disabled = false }: { href: string; disabled?: boolean }) {
+ return (
+