mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
Temporarily disables backups/pitr and realtime on HA projects until they are supported. Requires https://github.com/supabase/supabase/pull/47322 to be merged first. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added reusable High Availability empty-state and notice components for consistent messaging across the studio. * High Availability projects now show a dedicated blocked state in Realtime and PITR views. * Updated schema handling so certain schemas are hidden when High Availability is enabled. * **Bug Fixes** * Improved loading behavior on the PITR page by waiting for project, backup, and entitlement checks. * Refined upgrade messaging to better match the user’s current access level. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
74 lines
2.6 KiB
TypeScript
74 lines
2.6 KiB
TypeScript
import { Realtime } from 'icons'
|
|
import Head from 'next/head'
|
|
import { useRouter } from 'next/router'
|
|
import type { PropsWithChildren } from 'react'
|
|
|
|
import { ProjectLayout } from '../ProjectLayout'
|
|
import { generateRealtimeMenu } from './RealtimeMenu.utils'
|
|
import { HighAvailabilityDisabledEmptyState } from '@/components/ui/HighAvailability/HighAvailabilityDisabledEmptyState'
|
|
import { ProductMenu } from '@/components/ui/ProductMenu'
|
|
import { ProductMenuShortcuts } from '@/components/ui/ProductMenu/ProductMenuShortcuts'
|
|
import { useHighAvailability } from '@/hooks/misc/useHighAvailability'
|
|
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
|
|
import { withAuth } from '@/hooks/misc/withAuth'
|
|
|
|
/**
|
|
* Menu-only component for the Realtime section. Used by the desktop sidebar and by the
|
|
* mobile sheet submenu. Must not wrap ProjectLayout so that opening the realtime submenu
|
|
* in the mobile sheet does not overwrite registerOpenMenu and break the menu button.
|
|
*/
|
|
export const RealtimeProductMenu = () => {
|
|
const router = useRouter()
|
|
const { data: project } = useSelectedProjectQuery()
|
|
const page = router.pathname.split('/')[4]
|
|
|
|
return <ProductMenu page={page} menu={generateRealtimeMenu(project ?? undefined)} />
|
|
}
|
|
|
|
export interface RealtimeLayoutProps {
|
|
title: string
|
|
}
|
|
|
|
export const RealtimeLayout = ({ title, children }: PropsWithChildren<RealtimeLayoutProps>) => {
|
|
const { data: project } = useSelectedProjectQuery()
|
|
const { isHighAvailability } = useHighAvailability()
|
|
const router = useRouter()
|
|
const page = router.pathname.split('/')[4]
|
|
const menu = generateRealtimeMenu(project)
|
|
|
|
if (isHighAvailability) {
|
|
return (
|
|
<>
|
|
<Head>
|
|
<title>{title}</title>
|
|
<meta name="description" content="Supabase Studio" />
|
|
</Head>
|
|
<main
|
|
id="panel-project-content"
|
|
className="h-full w-full xl:min-w-[600px] flex items-center justify-center overflow-y-auto overflow-x-hidden bg-dash-sidebar p-6 @container"
|
|
>
|
|
<HighAvailabilityDisabledEmptyState
|
|
icon={<Realtime size={22} strokeWidth={1.5} />}
|
|
title="Realtime unavailable on High Availability projects"
|
|
description="We're working to bring realtime to High Availability projects. Contact support if this is blocking your work."
|
|
/>
|
|
</main>
|
|
</>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<ProjectLayout
|
|
product="Realtime"
|
|
browserTitle={{ section: title }}
|
|
productMenu={<ProductMenu page={page} menu={menu} />}
|
|
isBlocking={false}
|
|
>
|
|
<ProductMenuShortcuts menu={menu} />
|
|
{children}
|
|
</ProjectLayout>
|
|
)
|
|
}
|
|
|
|
export default withAuth(RealtimeLayout)
|