diff --git a/apps/studio/components/interfaces/Database/Replication/ComingSoon.tsx b/apps/studio/components/interfaces/Database/Replication/ComingSoon.tsx new file mode 100644 index 00000000000..d51bdf2f5d4 --- /dev/null +++ b/apps/studio/components/interfaces/Database/Replication/ComingSoon.tsx @@ -0,0 +1,309 @@ +import Table from 'components/to-be-cleaned/Table' +import { motion } from 'framer-motion' +import { BASE_PATH } from 'lib/constants' +import { ArrowUpRight, Circle, Database, MoreVertical, Plus, Search } from 'lucide-react' +import { useTheme } from 'next-themes' +import Link from 'next/link' +import { useMemo } from 'react' +import ReactFlow, { Background, Handle, Position, ReactFlowProvider } from 'reactflow' +import 'reactflow/dist/style.css' +import { Button, Input } from 'ui' +import { NODE_WIDTH } from '../../Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants' + +const STATIC_NODES = [ + { + id: '1', + type: 'primary', + data: { + label: 'Primary Database', + region: 'East US (Ohio)', + provider: 'AWS', + regionIcon: 'EAST_US', + }, + position: { x: 825, y: 0 }, + }, + { + id: '2', + type: 'replica', + data: { + label: 'Iceberg', + details: '3 tables', + regionIcon: 'WEST_US', + }, + position: { x: 875, y: 110 }, + }, + { + id: '3', + type: 'replica', + data: { + label: 'BigQuery', + details: '5 tables', + regionIcon: 'WEST_US', + }, + position: { x: 875, y: 200 }, + }, + { + id: '4', + type: 'blank', + position: { x: 875, y: 290 }, + data: {}, + }, + { + id: '5', + type: 'cta', + position: { x: 125, y: 20 }, + data: {}, + }, +] + +const STATIC_EDGES = [ + { id: 'e1-2', source: '1', target: '2', type: 'smoothstep', animated: true }, + { id: 'e1-3', source: '1', target: '3', type: 'smoothstep', animated: true }, + { id: 'e1-4', source: '1', target: '4', type: 'smoothstep', animated: true }, +] + +const ReplicationStaticMockup = () => { + const nodes = useMemo(() => STATIC_NODES, []) + const edges = useMemo(() => STATIC_EDGES, []) + + const { resolvedTheme } = useTheme() + + const backgroundPatternColor = + resolvedTheme === 'dark' ? 'rgba(255, 255, 255, 0.3)' : 'rgba(0, 0, 0, 0.4)' + + const nodeTypes = useMemo( + () => ({ + primary: PrimaryNode, + replica: ReplicaNode, + blank: BlankNode, + cta: CTANode, + }), + [] + ) + + return ( +
+
+ + + +
+ +
+ ) +} + +const ReplicationComingSoon = () => { + return ( + + + + ) +} + +export default ReplicationComingSoon + +const PrimaryNode = ({ + data, +}: { + data: { label: string; region: string; provider: string; regionIcon: string } +}) => { + return ( +
+
+
+
+ +
+
+

{data.label}

+

+ {data.region} +

+

+ {data.provider} +

+
+
+
+ region icon + +
+
+ +
+ ) +} +const ReplicaNode = ({ + data, +}: { + data: { label: string; details: string; regionIcon: string } +}) => { + return ( +
+
+
+
+

{data.label}

+

+ {data.details} +

+
+
+
+ region icon + +
+
+ + +
+ ) +} + +const BlankNode = () => { + return ( +
+
+
+
+ + Add new +
+
+ +
+
+ ) +} + +const CTANode = () => { + return ( + +
+ Early Access +

Replicate Your Data in Real Time

+

+ Stream changes from your Postgres database into your data warehouse—no manual exports, no + lag. +

+

+ We're rolling this out to a limited group of early adopters. Sign up to get early access. +

+

+ +

+
+
+ ) +} + +const StaticDestinations = () => { + const mockRows = [ + { name: 'BigQuery', tables: 4, lag: '55ms', status: 'Enabled' }, + { name: 'Iceberg', tables: 4, lag: '85ms', status: 'Enabled' }, + { name: 'US East', tables: 4, lag: '125ms', status: 'Enabled' }, + ] + + return ( + <> +
+
+
+ } + placeholder="Search..." + /> + +
+ Name, + Publication, + Lag, + Status, + , + ]} + className="mt-4" + body={mockRows.map((row, i) => ( + + {row.name} + + + All + {row.tables} tables + + + {row.lag} + + + + {row.status} + + + + + + + ))} + /> + + + ) +} diff --git a/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx b/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx index 232a284f306..65db568881e 100644 --- a/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx +++ b/apps/studio/components/layouts/DatabaseLayout/DatabaseLayout.tsx @@ -30,7 +30,6 @@ const DatabaseProductMenu = () => { const pgNetExtensionExists = (data ?? []).find((ext) => ext.name === 'pg_net') !== undefined const pitrEnabled = addons?.selected_addons.find((addon) => addon.type === 'pitr') !== undefined const columnLevelPrivileges = useIsColumnLevelPrivilegesEnabled() - const enablePgReplicate = useFlag('enablePgReplicate') return ( <> @@ -40,7 +39,6 @@ const DatabaseProductMenu = () => { pgNetExtensionExists, pitrEnabled, columnLevelPrivileges, - enablePgReplicate, })} /> diff --git a/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx b/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx index c440c327ed6..2b98e71d439 100644 --- a/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx +++ b/apps/studio/components/layouts/DatabaseLayout/DatabaseMenu.utils.tsx @@ -9,12 +9,10 @@ export const generateDatabaseMenu = ( pgNetExtensionExists: boolean pitrEnabled: boolean columnLevelPrivileges: boolean - enablePgReplicate: boolean } ): ProductMenuGroup[] => { const ref = project?.ref ?? 'default' - const { pgNetExtensionExists, pitrEnabled, columnLevelPrivileges, enablePgReplicate } = - flags || {} + const { pgNetExtensionExists, pitrEnabled, columnLevelPrivileges } = flags || {} return [ { @@ -64,16 +62,13 @@ export const generateDatabaseMenu = ( url: `/project/${ref}/database/publications`, items: [], }, - ...(enablePgReplicate - ? [ - { - name: 'Replication', - key: 'replication', - url: `/project/${ref}/database/replication`, - items: [], - }, - ] - : []), + { + name: 'Replication', + key: 'replication', + url: `/project/${ref}/database/replication`, + label: 'Coming Soon', + items: [], + }, ], }, { diff --git a/apps/studio/pages/project/[ref]/database/replication.tsx b/apps/studio/pages/project/[ref]/database/replication.tsx index bedb7735d5a..785012a64b2 100644 --- a/apps/studio/pages/project/[ref]/database/replication.tsx +++ b/apps/studio/pages/project/[ref]/database/replication.tsx @@ -1,21 +1,32 @@ -import type { NextPageWithLayout } from 'types' -import Destinations from 'components/interfaces/Database/Replication/Destinations' -import { ScaffoldContainer, ScaffoldSection } from 'components/layouts/Scaffold' -import DefaultLayout from 'components/layouts/DefaultLayout' -import { useFlag } from 'hooks/ui/useFlag' -import { PageLayout } from 'components/layouts/PageLayout/PageLayout' -import { Admonition } from 'ui-patterns' +import ReplicationComingSoon from 'components/interfaces/Database/Replication/ComingSoon' import DatabaseLayout from 'components/layouts/DatabaseLayout/DatabaseLayout' +import DefaultLayout from 'components/layouts/DefaultLayout' +import { + ScaffoldContainer, + ScaffoldDescription, + ScaffoldHeader, + ScaffoldSection, + ScaffoldTitle, +} from 'components/layouts/Scaffold' +import type { NextPageWithLayout } from 'types' +import { Admonition } from 'ui-patterns' const DatabaseReplicationPage: NextPageWithLayout = () => { - const enablePgReplicate = useFlag('enablePgReplicate') + //const enablePgReplicate = useFlag('enablePgReplicate') + const enablePgReplicate = true return ( <> {enablePgReplicate ? ( - - - + <> + + + Replication + Send data to other destinations + + + + ) : ( @@ -31,11 +42,7 @@ const DatabaseReplicationPage: NextPageWithLayout = () => { DatabaseReplicationPage.getLayout = (page) => ( - - - {page} - - + {page} )