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 🙏
72 lines
2.4 KiB
TypeScript
72 lines
2.4 KiB
TypeScript
import { createFileRoute } from '@tanstack/react-router'
|
|
import { LOCAL_STORAGE_KEYS, 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 { TableList } from '@/components/interfaces/Database/Tables/TableList'
|
|
import { DeleteConfirmationDialogs } from '@/components/interfaces/TableGridEditor/DeleteConfirmationDialogs'
|
|
import { SidePanelEditor } from '@/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor'
|
|
import { useTableActions } from '@/components/interfaces/TableGridEditor/useTableActions'
|
|
import { AutoEnableRLSNotice } from '@/components/ui/AutoEnableRLSNotice'
|
|
import { useLocalStorageQuery } from '@/hooks/misc/useLocalStorage'
|
|
import { useTableEditorStateSnapshot } from '@/state/table-editor'
|
|
|
|
export const Route = createFileRoute('/project/$ref/database/tables/')({
|
|
component: DatabaseTables,
|
|
staticData: {
|
|
databaseLayoutTitle: 'Tables',
|
|
},
|
|
})
|
|
|
|
function DatabaseTables() {
|
|
const { ref: projectRef } = useParams()
|
|
const snap = useTableEditorStateSnapshot()
|
|
const { editTable, duplicateTable, deleteTable } = useTableActions()
|
|
|
|
const [isAutoEnableRLSMinimized] = useLocalStorageQuery(
|
|
LOCAL_STORAGE_KEYS.RLS_EVENT_TRIGGER_BANNER_DISMISSED(projectRef ?? ''),
|
|
false
|
|
)
|
|
|
|
return (
|
|
<>
|
|
<PageHeader size="default">
|
|
<PageHeaderMeta>
|
|
<PageHeaderSummary>
|
|
<PageHeaderTitle>Database Tables</PageHeaderTitle>
|
|
</PageHeaderSummary>
|
|
{isAutoEnableRLSMinimized && (
|
|
<PageHeaderAside>
|
|
<AutoEnableRLSNotice iconOnly />
|
|
</PageHeaderAside>
|
|
)}
|
|
</PageHeaderMeta>
|
|
</PageHeader>
|
|
<PageContainer size="default">
|
|
<PageSection>
|
|
{!isAutoEnableRLSMinimized && <AutoEnableRLSNotice />}
|
|
|
|
<PageSectionContent>
|
|
<TableList
|
|
onAddTable={snap.onAddTable}
|
|
onEditTable={(table) => editTable(table.id)}
|
|
onDeleteTable={(table) => deleteTable(table.id)}
|
|
onDuplicateTable={(table) => duplicateTable(table.id)}
|
|
/>
|
|
</PageSectionContent>
|
|
</PageSection>
|
|
</PageContainer>
|
|
|
|
<DeleteConfirmationDialogs />
|
|
<SidePanelEditor includeColumns />
|
|
</>
|
|
)
|
|
}
|