mirror of
https://github.com/supabase/supabase.git
synced 2026-09-22 13:37:53 +08:00
2e435986c9
## What kind of change does this PR introduce? Studio UI and interaction polish. This is the second PR in the Pipelines review stack and depends on #50251. ## What is the current behaviour? Pipeline rows require a separate view action, cannot be sorted, and present lifecycle, lag, and destination terminology inconsistently. ## What is the new behaviour? Makes rows navigable with link-like mouse and keyboard behaviour, adds Name and Status sorting, reuses cached status queries, and moves row actions into the overflow menu. It also clarifies pipeline terminology, adds Docs and feedback actions, and standardises state, error, lag, and loading presentation with accessible announcements. | Before | After | | --- | --- | | <img width="1280" height="1323" alt="Replication Database ETL BigTable ETL Team Supabase" src="https://github.com/user-attachments/assets/53a62283-0e58-4408-8409-2b87a38af159" /> | <img width="1280" height="1323" alt="Replication Database Agua Basket Supabase" src="https://github.com/user-attachments/assets/ba4de1e0-4a84-43b4-8975-ca05a3056bcf" /> | ## To test 1. Open `/project/<ref>/database/replication`. 2. Sort by Name and Status, then confirm failed and stopped pipelines surface first when Status is ascending. 3. Click a row, use Enter or Space, and modifier-click or middle-click to verify link behaviour. 4. Open the row overflow menu and confirm it does not navigate. 5. Check loading, initial sync, caught up, numeric lag, unavailable lag, and table-error states where available. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added sortable pipeline lists with clearer loading, empty, and error states. - Pipeline rows now support direct navigation, detail viewing, status indicators, lag progress, and table error summaries. - Added initial-sync progress indicators and accessible status announcements. - Added documentation and feedback links. - Improved pipeline version update and enable/disable dialogs. - **Bug Fixes** - Prevented right-clicks from triggering navigation. - Improved unavailable lag and initial-sync handling. - **Style** - Standardized replication terminology and confirmation messaging around pipelines. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
82 lines
2.4 KiB
TypeScript
82 lines
2.4 KiB
TypeScript
import { useParams } from 'common'
|
|
import { useState } from 'react'
|
|
import { toast } from 'sonner'
|
|
import {
|
|
AlertDialog,
|
|
AlertDialogAction,
|
|
AlertDialogBody,
|
|
AlertDialogCancel,
|
|
AlertDialogContent,
|
|
AlertDialogDescription,
|
|
AlertDialogFooter,
|
|
AlertDialogHeader,
|
|
AlertDialogTitle,
|
|
} from 'ui'
|
|
import { Admonition } from 'ui-patterns/Admonition'
|
|
|
|
import { useDeleteReplicationTenantMutation } from '@/data/replication/delete-tenant-mutation'
|
|
|
|
interface DisablePipelinesDialogProps {
|
|
open: boolean
|
|
setOpen: (value: boolean) => void
|
|
}
|
|
|
|
export const DisablePipelinesDialog = ({ open, setOpen }: DisablePipelinesDialogProps) => {
|
|
const { ref: projectRef } = useParams()
|
|
const [error, setError] = useState<string | null>(null)
|
|
|
|
const { mutateAsync: deleteReplicationTenant, isPending: isSubmitting } =
|
|
useDeleteReplicationTenantMutation({
|
|
onSuccess: () => {
|
|
toast.success('Pipelines has been disabled')
|
|
setOpen(false)
|
|
},
|
|
onError: () => {},
|
|
})
|
|
|
|
const onConfirm = async () => {
|
|
setError(null)
|
|
|
|
try {
|
|
if (!projectRef) throw new Error('Project ref is required')
|
|
await deleteReplicationTenant({ projectRef })
|
|
} catch (error) {
|
|
setError(
|
|
error instanceof Error
|
|
? error.message
|
|
: 'An unknown error occurred while disabling Pipelines'
|
|
)
|
|
throw error
|
|
}
|
|
}
|
|
|
|
return (
|
|
<AlertDialog open={open} onOpenChange={(open) => !isSubmitting && setOpen(open)}>
|
|
<AlertDialogContent size="small">
|
|
<AlertDialogHeader>
|
|
<AlertDialogTitle>Disable Pipelines</AlertDialogTitle>
|
|
<AlertDialogDescription>
|
|
This removes the etl schema and all Pipelines-managed resources from your database. Data
|
|
already at destinations is kept. Read replicas are not affected.
|
|
</AlertDialogDescription>
|
|
</AlertDialogHeader>
|
|
{error && (
|
|
<AlertDialogBody>
|
|
<Admonition
|
|
type="destructive"
|
|
title="Unable to disable Pipelines"
|
|
description={error}
|
|
/>
|
|
</AlertDialogBody>
|
|
)}
|
|
<AlertDialogFooter>
|
|
<AlertDialogCancel disabled={isSubmitting}>Cancel</AlertDialogCancel>
|
|
<AlertDialogAction variant="danger" loading={isSubmitting} onClick={onConfirm}>
|
|
Disable Pipelines
|
|
</AlertDialogAction>
|
|
</AlertDialogFooter>
|
|
</AlertDialogContent>
|
|
</AlertDialog>
|
|
)
|
|
}
|