From ceed8bf792fc53bd2ab4b549733011faf7ca8619 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Mon, 10 Feb 2025 16:03:35 +0800 Subject: [PATCH] Fix text overlapping in PublicSchemaNotEnabledAlert (#33473) * Fix text overlapping in PublicSchemaNotEnabledAlert * Update * Smol fix --- .../Database/Schemas/SchemaGraph.tsx | 2 +- .../interfaces/Docs/Introduction.tsx | 6 +-- .../Docs/Pages/Tables/Introduction.tsx | 9 ++-- .../Docs/PublicSchemaNotEnabledAlert.tsx | 44 ++++++++----------- 4 files changed, 27 insertions(+), 34 deletions(-) diff --git a/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx b/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx index 7bd792f6b5e..2c9b2aa0fe3 100644 --- a/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx +++ b/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx @@ -172,7 +172,7 @@ export const SchemaGraph = () => { deletable: false, style: { stroke: 'hsl(var(--border-stronger))', - strokeWidth: 0.5, + strokeWidth: 1, }, }} nodeTypes={nodeTypes} diff --git a/apps/studio/components/interfaces/Docs/Introduction.tsx b/apps/studio/components/interfaces/Docs/Introduction.tsx index ae8dd1b4f9d..18ee355957d 100644 --- a/apps/studio/components/interfaces/Docs/Introduction.tsx +++ b/apps/studio/components/interfaces/Docs/Introduction.tsx @@ -15,7 +15,7 @@ export default function Introduction({ selectedLang }: Props) { const { ref: projectRef } = useParams() const { data: settings } = useProjectSettingsV2Query({ projectRef }) - const { data: config } = useProjectPostgrestConfigQuery({ projectRef }) + const { data: config, isSuccess } = useProjectPostgrestConfigQuery({ projectRef }) const protocol = settings?.app_config?.protocol ?? 'https' const hostEndpoint = settings?.app_config?.endpoint @@ -42,9 +42,9 @@ export default function Introduction({ selectedLang }: Props) { the easiest way to interact with everything we offer within the Supabase ecosystem.

-
+
- {!isPublicSchemaEnabled && } + {isSuccess && !isPublicSchemaEnabled && }
diff --git a/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx b/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx index d3116933cb6..5a7ad40d0f1 100644 --- a/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx +++ b/apps/studio/components/interfaces/Docs/Pages/Tables/Introduction.tsx @@ -13,7 +13,7 @@ interface IntroductionProps { const Introduction = ({ selectedLang }: IntroductionProps) => { const { ref: projectRef } = useParams() - const { data: config } = useProjectPostgrestConfigQuery({ projectRef }) + const { data: config, isSuccess } = useProjectPostgrestConfigQuery({ projectRef }) const isPublicSchemaEnabled = config?.db_schema .split(',') @@ -24,13 +24,14 @@ const Introduction = ({ selectedLang }: IntroductionProps) => { <>

Introduction

-
+

All views and tables in the public schema and accessible by the active database role for a request are available for querying.

- - {!isPublicSchemaEnabled && } +
+
+ {isSuccess && !isPublicSchemaEnabled && }
diff --git a/apps/studio/components/interfaces/Docs/PublicSchemaNotEnabledAlert.tsx b/apps/studio/components/interfaces/Docs/PublicSchemaNotEnabledAlert.tsx index 99be76b020f..15d2a8b505c 100644 --- a/apps/studio/components/interfaces/Docs/PublicSchemaNotEnabledAlert.tsx +++ b/apps/studio/components/interfaces/Docs/PublicSchemaNotEnabledAlert.tsx @@ -1,36 +1,28 @@ -import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Button } from 'ui' -import { Info } from 'lucide-react' -import ReactMarkdown from 'react-markdown' import Link from 'next/link' + import { useParams } from 'common' +import { Button } from 'ui' +import { Admonition } from 'ui-patterns' const PublicSchemaNotEnabledAlert = () => { const { ref: projectRef } = useParams() return ( - - - - The `public` schema for this project is not exposed - - - - You will not be able to query tables and views in the `public` schema via supabase-js or - HTTP clients. - - -
- -
-
-
+ +

The public schema for this project is not exposed

+

+ You will not be able to query tables and views in the public schema via supabase-js or HTTP + clients. Configure this behavior in your project's Data API settings. +

+ +
) }