mirror of
https://github.com/supabase/supabase.git
synced 2026-10-10 20:05:06 +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>
50 lines
1.6 KiB
TypeScript
50 lines
1.6 KiB
TypeScript
import { observer } from 'mobx-react-lite'
|
|
import { useRouter } from 'next/router'
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
import ProductMenu from 'components/ui/ProductMenu'
|
|
import { useDatabaseExtensionsQuery } from 'data/database-extensions/database-extensions-query'
|
|
import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
|
|
import { useSelectedProject, withAuth } from 'hooks'
|
|
import ProjectLayout from '../'
|
|
import { generateDatabaseMenu } from './DatabaseMenu.utils'
|
|
|
|
export interface DatabaseLayoutProps {
|
|
title?: string
|
|
}
|
|
|
|
const DatabaseLayout = ({ children }: PropsWithChildren<DatabaseLayoutProps>) => {
|
|
const project = useSelectedProject()
|
|
|
|
const router = useRouter()
|
|
const page = router.pathname.split('/')[4]
|
|
|
|
const { data } = useDatabaseExtensionsQuery({
|
|
projectRef: project?.ref,
|
|
connectionString: project?.connectionString,
|
|
})
|
|
const { data: addons } = useProjectAddonsQuery({ projectRef: project?.ref })
|
|
|
|
const pgNetExtensionExists = (data ?? []).find((ext) => ext.name === 'pg_net') !== undefined
|
|
const pitrEnabled = addons?.selected_addons.find((addon) => addon.type === 'pitr') !== undefined
|
|
|
|
return (
|
|
<ProjectLayout
|
|
product="Database"
|
|
productMenu={
|
|
<ProductMenu
|
|
page={page}
|
|
menu={generateDatabaseMenu(project, { pgNetExtensionExists, pitrEnabled })}
|
|
/>
|
|
}
|
|
isBlocking={false}
|
|
>
|
|
<main style={{ maxHeight: '100vh' }} className="flex-1 overflow-y-auto">
|
|
{children}
|
|
</main>
|
|
</ProjectLayout>
|
|
)
|
|
}
|
|
|
|
export default withAuth(observer(DatabaseLayout))
|