mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## Context
Final clean up of deprecated Scaffold components, just touches
- Account audit logs
- Project home page
- Database -> Column privileges
- Storage -> Analytics bucket details
- Storage -> Vector bucket details
- Settings -> Infrastructure -> Disk management
- Settings -> Infrastructure -> Read replica details
- Integrations -> Wrappers overview (Only for non supported integration
UI)
- Edge functions -> Empty state
- Auth -> Performance
Also replaces usage of `ScaffoldDivider` with just the `Separator`
component
And also adjusts the page container sizes of database pages from large
to default - these only have visual differences on viewport widths
larger than a laptop
Testing just needs a quick sweep of all these surfaces to make sure
nothing looks weird - will do so on my end too once the builds go
through!
For @supabase/security's review - review requirement was triggered as
`Documents.tsx` was updated in the organization settings page. But it
was just to change the Divider component 🙏
80 lines
2.7 KiB
TypeScript
80 lines
2.7 KiB
TypeScript
import { createFileRoute, Link } from '@tanstack/react-router'
|
|
import { BreadcrumbItem, BreadcrumbLink, BreadcrumbList } from 'ui'
|
|
import { PageBreadcrumbs } from 'ui-patterns/PageBreadcrumbs'
|
|
import { PageContainer } from 'ui-patterns/PageContainer'
|
|
import {
|
|
PageHeader,
|
|
PageHeaderMeta,
|
|
PageHeaderSummary,
|
|
PageHeaderTitle,
|
|
} from 'ui-patterns/PageHeader'
|
|
import { PageSection, PageSectionContent } from 'ui-patterns/PageSection'
|
|
import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'
|
|
|
|
import { PublicationsTables } from '@/components/interfaces/Database/Publications/PublicationsTables'
|
|
import { NoPermission } from '@/components/ui/NoPermission'
|
|
import { useDatabasePublicationsQuery } from '@/data/database-publications/database-publications-query'
|
|
import { FGA_PERMISSIONS, useAsyncCheckPermissionsV2 } from '@/hooks/misc/useCheckPermissionsV2'
|
|
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
|
|
|
|
export const Route = createFileRoute('/project/$ref/database/publications/$id')({
|
|
component: DatabasePublications,
|
|
staticData: {
|
|
databaseLayoutTitle: 'Publications',
|
|
},
|
|
})
|
|
|
|
function DatabasePublications() {
|
|
const { ref, id } = Route.useParams()
|
|
const { data: project } = useSelectedProjectQuery()
|
|
const { can: canViewPublications, isSuccess: isPermissionsLoaded } = useAsyncCheckPermissionsV2(
|
|
FGA_PERMISSIONS.PROJECT.DATABASE_READ
|
|
)
|
|
|
|
const { data: publications = [], isPending } = useDatabasePublicationsQuery({
|
|
projectRef: project?.ref,
|
|
connectionString: project?.connectionString,
|
|
})
|
|
const selectedPublication = publications.find((pub) => pub.id === Number(id))
|
|
|
|
if (isPermissionsLoaded && !canViewPublications) {
|
|
return <NoPermission isFullPage resourceText="view database publications" />
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<PageBreadcrumbs>
|
|
<BreadcrumbList>
|
|
<BreadcrumbItem>
|
|
<BreadcrumbLink asChild>
|
|
<Link to="/project/$ref/database/publications" params={{ ref }}>
|
|
Publications
|
|
</Link>
|
|
</BreadcrumbLink>
|
|
</BreadcrumbItem>
|
|
</BreadcrumbList>
|
|
</PageBreadcrumbs>
|
|
<PageHeader size="default">
|
|
<PageHeaderMeta>
|
|
<PageHeaderSummary>
|
|
<PageHeaderTitle>
|
|
{isPending ? (
|
|
<ShimmeringLoader className="w-40" />
|
|
) : (
|
|
(selectedPublication?.name ?? '')
|
|
)}
|
|
</PageHeaderTitle>
|
|
</PageHeaderSummary>
|
|
</PageHeaderMeta>
|
|
</PageHeader>
|
|
<PageContainer size="default">
|
|
<PageSection>
|
|
<PageSectionContent>
|
|
<PublicationsTables />
|
|
</PageSectionContent>
|
|
</PageSection>
|
|
</PageContainer>
|
|
</>
|
|
)
|
|
}
|