Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

More standardization

Joshen Lim23c864c947e6
diff --git a/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx b/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx
index 7c408e29d19..17f5d89ea69 100644
--- a/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx
+++ b/studio/components/interfaces/Database/Hooks/HooksList/HooksList.tsx
@@ -1,21 +1,20 @@
-import Link from 'next/link'
-import { useState } from 'react'
-import { includes, uniqBy, map as lodashMap } from 'lodash'
-import { observer } from 'mobx-react-lite'
import * as Tooltip from '@radix-ui/react-tooltip'
-import { Button, Input, IconSearch, IconExternalLink } from 'ui'
import { PermissionAction } from '@supabase/shared-types/out/constants'
-
-import { useCheckPermissions } from 'hooks'
-import SchemaTable from './SchemaTable'
-import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState'
+import { includes, map as lodashMap, uniqBy } from 'lodash'
+import { observer } from 'mobx-react-lite'
+import Link from 'next/link'
+import { useState } from 'react'
+import { Button, IconExternalLink, IconSearch, Input } from 'ui'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
-import { useDatabaseHooks } from 'data/database-triggers/database-triggers-query'
+import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState'
+import AlertError from 'components/ui/AlertError'
import { FormHeader } from 'components/ui/Forms'
-import ShimmeringLoader from 'components/ui/ShimmeringLoader'
-import ClientLoadingError from 'components/ui/ClientLoadingError'
import NoSearchResults from 'components/ui/NoSearchResults'
+import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
+import { useDatabaseHooks } from 'data/database-triggers/database-triggers-query'
+import { useCheckPermissions } from 'hooks'
+import SchemaTable from './SchemaTable'
export interface HooksListProps {
createHook: () => void
@@ -30,6 +29,7 @@ const HooksList = ({
}: HooksListProps) => {
const { project } = useProjectContext()
const {
+ error,
data: hooks,
isLoading,
isError,
@@ -48,16 +48,11 @@ const HooksList = ({
return (
<>
{isLoading ? (
- <div className="py-4 space-y-2">
- <ShimmeringLoader />
- <ShimmeringLoader className="w-3/4" />
- <ShimmeringLoader className="w-1/2" />
+ <div className="py-4">
+ <GenericSkeletonLoader />
</div>
) : isError ? (
- <ClientLoadingError
- projectRef={project?.ref ?? ''}
- description="Failed to retrieve database webhooks"
- />
+ <AlertError error={error} subject="Failed to retrieve database webhooks" />
) : (hooks || []).length == 0 ? (
<div className="flex h-full w-full items-center justify-center">
<ProductEmptyState
diff --git a/studio/components/interfaces/Database/Indexes/Indexes.tsx b/studio/components/interfaces/Database/Indexes/Indexes.tsx
index fc61add7086..1037a534d6b 100644
--- a/studio/components/interfaces/Database/Indexes/Indexes.tsx
+++ b/studio/components/interfaces/Database/Indexes/Indexes.tsx
@@ -98,7 +98,7 @@ const Indexes = () => {
<div className="pb-8">
<div className="flex items-center justify-between mb-6">
<div>
- <h3 className="mb-2 text-xl text-scale-1200">Indexes</h3>
+ <h3 className="mb-1 text-xl text-scale-1200">Database Indexes</h3>
<div className="text-sm text-scale-900">
Improve query performance against your database
</div>
diff --git a/studio/components/interfaces/Database/Migrations/Migrations.tsx b/studio/components/interfaces/Database/Migrations/Migrations.tsx
index 5ee1fc8b5ad..5cc00cf4ce7 100644
--- a/studio/components/interfaces/Database/Migrations/Migrations.tsx
+++ b/studio/components/interfaces/Database/Migrations/Migrations.tsx
@@ -1,3 +1,4 @@
+import dayjs from 'dayjs'
import { observer } from 'mobx-react-lite'
import Link from 'next/link'
import { useState } from 'react'
@@ -9,7 +10,6 @@ import CodeEditor from 'components/ui/CodeEditor'
import ShimmeringLoader from 'components/ui/ShimmeringLoader'
import { DatabaseMigration, useMigrationsQuery } from 'data/database/migrations-query'
import MigrationsEmptyState from './MigrationsEmptyState'
-import dayjs from 'dayjs'
const Migrations = () => {
const [search, setSearch] = useState('')
@@ -32,7 +32,7 @@ const Migrations = () => {
<div>
<div className="flex items-center justify-between mb-6">
<div>
- <h3 className="mb-2 text-xl text-scale-1200">Migrations</h3>
+ <h3 className="mb-1 text-xl text-scale-1200">Database Migrations</h3>
<div className="text-sm text-scale-900">
History of migrations that have been run on your database
</div>
diff --git a/studio/components/interfaces/Database/Tables/ColumnList.tsx b/studio/components/interfaces/Database/Tables/ColumnList.tsx
index 63f0c15a2ce..ab3888fcde2 100644
--- a/studio/components/interfaces/Database/Tables/ColumnList.tsx
+++ b/studio/components/interfaces/Database/Tables/ColumnList.tsx
@@ -4,11 +4,21 @@ import { PermissionAction } from '@supabase/shared-types/out/constants'
import { noop } from 'lodash'
import { observer } from 'mobx-react-lite'
import { useState } from 'react'
-import { Button, IconChevronLeft, IconEdit3, IconPlus, IconSearch, IconTrash, Input } from 'ui'
+import {
+ Button,
+ IconChevronLeft,
+ IconChevronRight,
+ IconEdit3,
+ IconPlus,
+ IconSearch,
+ IconTrash,
+ Input,
+} from 'ui'
import NoSearchResults from 'components/to-be-cleaned/NoSearchResults'
import Table from 'components/to-be-cleaned/Table'
import { useCheckPermissions, useStore } from 'hooks'
+import { ScaffoldHeader } from 'components/layouts/Scaffold'
interface ColumnListProps {
selectedTable: PostgresTable
@@ -37,6 +47,14 @@ const ColumnList = ({
return (
<>
+ <div className="mb-4 flex items-center space-x-2">
+ <div className="flex items-center space-x-2">
+ <h3 className="mb-1 text-xl text-scale-1200">Database Tables</h3>
+ <IconChevronRight strokeWidth={1.5} className="text-light" />
+ <h3 className="mb-1 text-xl text-scale-1200">{selectedTable.name}</h3>
+ </div>
+ </div>
+
<div className="mb-4">
<div className="flex items-center justify-between">
<div className="flex items-center">
@@ -48,7 +66,6 @@ const ColumnList = ({
icon={<IconChevronLeft size="small" />}
style={{ padding: '5px' }}
/>
- <code>{selectedTable.name}</code>
</div>
<div>
<Input
diff --git a/studio/components/interfaces/Database/Tables/TableList.tsx b/studio/components/interfaces/Database/Tables/TableList.tsx
index 4e4cc3bc7e8..999b193bb92 100644
--- a/studio/components/interfaces/Database/Tables/TableList.tsx
+++ b/studio/components/interfaces/Database/Tables/TableList.tsx
@@ -20,6 +20,7 @@ import {
import Table from 'components/to-be-cleaned/Table'
import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { useCheckPermissions, useStore } from 'hooks'
+import { ScaffoldHeader } from 'components/layouts/Scaffold'
interface TableListProps {
selectedSchema: string
@@ -67,6 +68,10 @@ const TableList = ({
return (
<>
+ <div className="mb-4">
+ <h3 className="mb-1 text-xl text-scale-1200">Database Tables</h3>
+ </div>
+
<div className="flex items-center justify-between">
<div className="flex items-center space-x-4">
<div className="w-[260px]">
diff --git a/studio/components/interfaces/Database/Wrappers/Wrappers.tsx b/studio/components/interfaces/Database/Wrappers/Wrappers.tsx
index 2c1204ac060..6a2816aefe1 100644
--- a/studio/components/interfaces/Database/Wrappers/Wrappers.tsx
+++ b/studio/components/interfaces/Database/Wrappers/Wrappers.tsx
@@ -5,7 +5,7 @@ import { useState } from 'react'
import { Button, IconExternalLink } from 'ui'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
-import ShimmeringLoader from 'components/ui/ShimmeringLoader'
+import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'
import { FDW, useFDWsQuery } from 'data/fdw/fdws-query'
import { useStore } from 'hooks'
import DeleteWrapperModal from './DeleteWrapperModal'
@@ -43,7 +43,7 @@ const Wrappers = () => {
<div>
<div className="flex items-center justify-between mb-6">
<div>
- <h3 className="mb-2 text-xl text-scale-1200">Foreign Data Wrappers</h3>
+ <h3 className="mb-1 text-xl text-scale-1200">Foreign Data Wrappers</h3>
<div className="text-sm text-scale-900">
Query your data warehouse directly from your database, or third-party APIs using SQL.
</div>
@@ -62,9 +62,7 @@ const Wrappers = () => {
{isLoadingExtensions || isLoading ? (
<div className="p-12 space-y-2 border rounded border-scale-500">
- <ShimmeringLoader />
- <ShimmeringLoader className="w-3/4" />
- <ShimmeringLoader className="w-1/2" />
+ <GenericSkeletonLoader />
</div>
) : isWrappersEnabled ? (
<div>
diff --git a/studio/data/database-triggers/database-triggers-query.ts b/studio/data/database-triggers/database-triggers-query.ts
index 256c25a6a9e..83d082fcb5c 100644
--- a/studio/data/database-triggers/database-triggers-query.ts
+++ b/studio/data/database-triggers/database-triggers-query.ts
@@ -4,6 +4,7 @@ import { get } from 'lib/common/fetch'
import { API_URL } from 'lib/constants'
import { useCallback } from 'react'
import { databaseTriggerKeys } from './keys'
+import { ResponseError } from 'types'
export type DatabaseTriggersVariables = {
projectRef?: string
@@ -29,7 +30,7 @@ export async function getDatabaseTriggers(
}
export type DatabaseTriggersData = Awaited<ReturnType<typeof getDatabaseTriggers>>
-export type DatabaseTriggersError = unknown
+export type DatabaseTriggersError = ResponseError
export const useDatabaseHooks = <TData = DatabaseTriggersData>(
{ projectRef, connectionString }: DatabaseTriggersVariables,
@@ -45,7 +46,9 @@ export const useDatabaseHooks = <TData = DatabaseTriggersData>(
// @ts-ignore
select(data) {
return (data as PostgresTrigger[]).filter(
- (trigger) => trigger.function_schema === 'supabase_functions' && (trigger.schema !== 'net' || trigger.function_args.length === 0)
+ (trigger) =>
+ trigger.function_schema === 'supabase_functions' &&
+ (trigger.schema !== 'net' || trigger.function_args.length === 0)
)
},
enabled:
diff --git a/studio/pages/project/[ref]/database/backups/pitr.tsx b/studio/pages/project/[ref]/database/backups/pitr.tsx
index 8f717a99719..aca401c15ac 100644
--- a/studio/pages/project/[ref]/database/backups/pitr.tsx
+++ b/studio/pages/project/[ref]/database/backups/pitr.tsx
@@ -25,7 +25,7 @@ const DatabasePhysicalBackups: NextPageWithLayout = () => {
<ScaffoldSection>
<div className="col-span-12">
<div className="space-y-6">
- <h3 className="text-xl text-scale-1200">Backups</h3>
+ <h3 className="text-xl text-scale-1200">Database Backups</h3>
<Tabs
type="underlined"
diff --git a/studio/pages/project/[ref]/database/backups/scheduled.tsx b/studio/pages/project/[ref]/database/backups/scheduled.tsx
index 9b4da62a687..463c65f012f 100644
--- a/studio/pages/project/[ref]/database/backups/scheduled.tsx
+++ b/studio/pages/project/[ref]/database/backups/scheduled.tsx
@@ -27,7 +27,7 @@ const DatabaseScheduledBackups: NextPageWithLayout = () => {
<ScaffoldSection>
<div className="col-span-12">
<div className="space-y-6">
- <h3 className="text-xl text-scale-1200">Backups</h3>
+ <h3 className="text-xl text-scale-1200">Database Backups</h3>
<Tabs
type="underlined"
diff --git a/studio/pages/project/[ref]/database/extensions.tsx b/studio/pages/project/[ref]/database/extensions.tsx
index c77cb2ee46a..255b03f496e 100644
--- a/studio/pages/project/[ref]/database/extensions.tsx
+++ b/studio/pages/project/[ref]/database/extensions.tsx
@@ -21,6 +21,9 @@ const DatabaseExtensions: NextPageWithLayout = () => {
<ScaffoldContainer>
<ScaffoldSection>
<div className="col-span-12">
+ <div className="mb-4">
+ <h3 className="mb-1 text-xl text-scale-1200">Database Extensions</h3>
+ </div>
<Extensions />
</div>
</ScaffoldSection>
diff --git a/studio/pages/project/[ref]/database/functions.tsx b/studio/pages/project/[ref]/database/functions.tsx
index 8c92972e199..f0dc7fa55f2 100644
--- a/studio/pages/project/[ref]/database/functions.tsx
+++ b/studio/pages/project/[ref]/database/functions.tsx
@@ -54,6 +54,9 @@ const FunctionsPage: NextPageWithLayout = () => {
<ScaffoldContainer>
<ScaffoldSection>
<div className="col-span-12">
+ <div className="mb-4">
+ <h3 className="mb-1 text-xl text-scale-1200">Database Functions</h3>
+ </div>
<FunctionsList
createFunction={createFunction}
editFunction={editFunction}
diff --git a/studio/pages/project/[ref]/database/replication.tsx b/studio/pages/project/[ref]/database/replication.tsx
index ecd30cd2c89..e5e19a2fac7 100644
--- a/studio/pages/project/[ref]/database/replication.tsx
+++ b/studio/pages/project/[ref]/database/replication.tsx
@@ -33,6 +33,9 @@ const DatabaseReplication: NextPageWithLayout = () => {
<ScaffoldContainer>
<ScaffoldSection>
<div className="col-span-12">
+ <div className="mb-4">
+ <h3 className="mb-1 text-xl text-scale-1200">Database Replications</h3>
+ </div>
{selectedPublicationId === undefined ? (
<PublicationsList onSelectPublication={setSelectedPublicationId} />
) : (
diff --git a/studio/pages/project/[ref]/database/triggers.tsx b/studio/pages/project/[ref]/database/triggers.tsx
index 773879b5715..8bbdac52605 100644
--- a/studio/pages/project/[ref]/database/triggers.tsx
+++ b/studio/pages/project/[ref]/database/triggers.tsx
@@ -55,6 +55,9 @@ const TriggersPage: NextPageWithLayout = () => {
<ScaffoldContainer>
<ScaffoldSection>
<div className="col-span-12">
+ <div className="mb-4">
+ <h3 className="mb-1 text-xl text-scale-1200">Database Triggers</h3>
+ </div>
<TriggersList
createTrigger={createTrigger}
editTrigger={editTrigger}