Files
supabase/apps/studio/routes/project/$ref/database/functions.tsx
Joshen Lim 434c00cb14 Joshenlim/fe 5196 move off scaffold components for remaining (#53911)
## 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 🙏
2026-11-26 21:28:17 +07:00

70 lines
1.9 KiB
TypeScript

import { createFileRoute } from '@tanstack/react-router'
import { useParams } from 'common'
import { PageContainer } from 'ui-patterns/PageContainer'
import {
PageHeader,
PageHeaderAside,
PageHeaderMeta,
PageHeaderSummary,
PageHeaderTitle,
} from 'ui-patterns/PageHeader'
import { PageSection, PageSectionContent } from 'ui-patterns/PageSection'
import { FunctionsList } from '@/components/interfaces/Database/Functions/FunctionsList/FunctionsList'
import { AlertError } from '@/components/ui/AlertError'
import { DocsButton } from '@/components/ui/DocsButton'
import { NoPermission } from '@/components/ui/NoPermission'
import { DOCS_URL } from '@/lib/constants'
import { useGrant } from '@/lib/grants'
export const Route = createFileRoute('/project/$ref/database/functions')({
component: DatabaseFunctionsPage,
staticData: {
databaseLayoutTitle: 'Functions',
},
})
function DatabaseFunctionsPage() {
const { ref: projectRef } = useParams()
const readGrant = useGrant(
'POST /platform/pg-meta/{ref}/query',
{ projectRef },
{ variant: 'read' }
)
if (readGrant.status === 'denied') {
return <NoPermission isFullPage resourceText="view database functions" />
}
if (readGrant.status === 'error') {
return (
<AlertError
error={readGrant.error}
subject="Failed to check database functions permissions"
/>
)
}
return (
<>
<PageHeader size="default">
<PageHeaderMeta>
<PageHeaderSummary>
<PageHeaderTitle>Database Functions</PageHeaderTitle>
</PageHeaderSummary>
<PageHeaderAside>
<DocsButton href={`${DOCS_URL}/guides/database/functions`} />
</PageHeaderAside>
</PageHeaderMeta>
</PageHeader>
<PageContainer size="default">
<PageSection>
<PageSectionContent>
<FunctionsList />
</PageSectionContent>
</PageSection>
</PageContainer>
</>
)
}