mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
## Problem The pipeline wizard in #49243 needs its merged components composed into a full-page flow, with values preserved when moving backwards and forwards. ## Solution - Compose four full-page SteppedFlow steps behind **Pipeline creation wizard**. - Preserve values through step navigation and browser Back/Forward. Refresh starts at Destination. - Reuse Studio’s header controls and confirm before discarding changes. - Defer step validation and creation; **Start pipeline** is disabled. **Add pipeline** and preview-off visits keep the sheet. | After | | --- | | <img width="1024" height="759" alt="New Pipeline Supabase" src="https://github.com/user-attachments/assets/7c3c4511-9a00-4e64-a86a-d6d9489f7d75" /> | | _Only available by navigating to `database/pipelines/new` with the feature preview on._ | ## Review instructions 1. Open the [Pipelines preview](https://studio-staging-git-dnywh-featpipeline-stepped-n-ce5307-supabase.vercel.app/dashboard/project/_/database/pipelines), select a test project and enable **Pipeline creation wizard**. Open the [wizard preview](https://studio-staging-git-dnywh-featpipeline-stepped-n-ce5307-supabase.vercel.app/dashboard/project/_/database/pipelines/new) for that project. Check the full-page layout and header at desktop and phone widths. 2. Enter connection details, select a publication and change initial-sync and advanced settings. Use **Back/Continue**, browser **Back/Forward**, and switch destinations to confirm values remain. 3. Check Review shows your settings, masks secrets and disables **Start pipeline**. Refresh and confirm it restarts at Destination. Incomplete steps are allowed in this navigation-only slice. 4. With changes, try header navigation or **Close**. Check **Keep editing** preserves values and **Discard changes** leaves the flow. Turn the preview off and confirm the wizard URL opens the sheet.
63 lines
2.2 KiB
TypeScript
63 lines
2.2 KiB
TypeScript
import { XIcon } from 'lucide-react'
|
|
import type { MouseEvent } from 'react'
|
|
import { Button, SidebarProvider } from 'ui'
|
|
|
|
import { OrganizationDropdown } from '@/components/layouts/AppLayout/OrganizationDropdown'
|
|
import { ProjectDropdown } from '@/components/layouts/AppLayout/ProjectDropdown'
|
|
import { HomeIcon } from '@/components/layouts/Navigation/LayoutHeader/HomeIcon'
|
|
import { LayoutHeaderDivider } from '@/components/layouts/Navigation/LayoutHeader/LayoutHeaderDivider'
|
|
import { OrgSelector } from '@/components/layouts/Navigation/NavigationBar/OrgSelector'
|
|
|
|
export const PipelineCreationHeader = ({
|
|
onClose,
|
|
onNavigate,
|
|
}: {
|
|
onClose: () => void
|
|
onNavigate: (href: string) => void
|
|
}) => {
|
|
const handleLinkClick = (event: MouseEvent<HTMLElement>) => {
|
|
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
|
|
return
|
|
const link = event.target instanceof Element ? event.target.closest('a') : null
|
|
if (!link || link.target === '_blank') return
|
|
event.preventDefault()
|
|
event.stopPropagation()
|
|
onNavigate(link.href)
|
|
}
|
|
|
|
return (
|
|
<header
|
|
className="flex h-12 shrink-0 items-center justify-between gap-2 border-b bg-dash-sidebar px-3 md:px-4"
|
|
onClickCapture={handleLinkClick}
|
|
>
|
|
<nav
|
|
aria-label="Pipeline creation"
|
|
className="hide-scrollbar flex min-w-0 items-center gap-2 overflow-x-auto text-sm md:gap-0"
|
|
>
|
|
<HomeIcon className="md:mr-2" />
|
|
<LayoutHeaderDivider className="hidden shrink-0 md:block" />
|
|
<div className="hidden md:block">
|
|
<OrganizationDropdown />
|
|
</div>
|
|
<div className="md:hidden">
|
|
<SidebarProvider defaultOpen={false} className="contents">
|
|
<OrgSelector />
|
|
</SidebarProvider>
|
|
</div>
|
|
<LayoutHeaderDivider className="hidden shrink-0 md:block" />
|
|
<ProjectDropdown />
|
|
<LayoutHeaderDivider className="hidden shrink-0 md:block" />
|
|
<span className="shrink-0 text-foreground">New pipeline</span>
|
|
</nav>
|
|
<Button
|
|
type="button"
|
|
variant="text"
|
|
icon={<XIcon size={16} />}
|
|
className="shrink-0 px-1"
|
|
aria-label="Close"
|
|
onClick={onClose}
|
|
/>
|
|
</header>
|
|
)
|
|
}
|