mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 11:55:05 +03:00
* Move listEncryptedColumns method to a function. * Remove encryptColumn method since it's unused. * Add CRUD RQ queries/mutations for vault secrets. * Use the new queries/mutations. * Add RQ for secret/decrypted values of secrets. * Add RQ queries/mutations for pg-sodium keys. * Use the new hook for decrypted value. * Use the new hooks for pg sodium keys. * Remove unneeded code from the vault store. * Delete VaultStore and all usages of it. * Small style fix * Fix invalidation for create, update, delete secrets * Small UI fixes to EditSecretModal * Fix invalidation for pg-sodium-keys rq * Add default error handler for pg sodium keys rq * Undo * Add default error handler for vault secrets RQ * Remove observer on vault pages * Fix database wrappers with vault * Add loading state for vault keys * fix pg sodium keys invalidation * Opt for immutable const declaration in SecretsManagement * remove keyId and keyName context from ColumnEditor, no longer supports TLE * Address PR comments --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
|
import { observer } from 'mobx-react-lite'
|
|
import { PropsWithChildren, useMemo } from 'react'
|
|
|
|
import NoPermission from 'components/ui/NoPermission'
|
|
import { useCheckPermissions, usePermissionsLoaded } from 'hooks'
|
|
import { ProjectLayoutWithAuth } from '../'
|
|
import TableEditorMenu from './TableEditorMenu'
|
|
|
|
const TableEditorLayout = ({ children }: PropsWithChildren<{}>) => {
|
|
const canReadTables = useCheckPermissions(PermissionAction.TENANT_SQL_ADMIN_READ, 'tables')
|
|
const isPermissionsLoaded = usePermissionsLoaded()
|
|
|
|
const tableEditorMenu = useMemo(() => <TableEditorMenu />, [])
|
|
|
|
if (isPermissionsLoaded && !canReadTables) {
|
|
debugger
|
|
return (
|
|
<ProjectLayoutWithAuth isBlocking={false}>
|
|
<NoPermission isFullPage resourceText="view tables from this project" />
|
|
</ProjectLayoutWithAuth>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<ProjectLayoutWithAuth product="Table Editor" productMenu={tableEditorMenu} isBlocking={false}>
|
|
{children}
|
|
</ProjectLayoutWithAuth>
|
|
)
|
|
}
|
|
|
|
export default observer(TableEditorLayout)
|