The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore: add custom content provider label (#38745)
Alaister Youngc0da4fc689bc
diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsxindex ada3f39721b..35afb66f841 100644--- a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx+++ b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx@@ -7,6 +7,7 @@ import type { IntegrationProjectConnection } from 'data/integrations/integrationimport { ProjectIndexPageLink } from 'data/prefetchers/project.$ref'import { OrgProject } from 'data/projects/projects-infinite-query'import type { ResourceWarning } from 'data/usage/resource-warnings-query'+import { useCustomContent } from 'hooks/custom-content/useCustomContent'import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'import { BASE_PATH } from 'lib/constants'import { inferProjectStatus } from './ProjectCard.utils'@@ -28,7 +29,12 @@ export const ProjectCard = ({resourceWarnings,}: ProjectCardProps) => {const { name, ref: projectRef } = project- const desc = `${project.cloud_provider} | ${project.region}`++ const { infraAwsNimbusLabel } = useCustomContent(['infra:aws_nimbus_label'])+ const providerLabel =+ project.cloud_provider === 'AWS_NIMBUS' ? infraAwsNimbusLabel : project.cloud_provider++ const desc = `${providerLabel} | ${project.region}`const { projectHomepageShowInstanceSize } = useIsFeatureEnabled(['project_homepage:show_instance_size',@@ -47,7 +53,7 @@ export const ProjectCard = ({title={<div className="w-full justify-between space-y-1.5 px-5"><p className="flex-shrink truncate text-sm pr-4">{name}</p>- <span className="text-sm lowercase text-foreground-light">{desc}</span>+ <span className="text-sm text-foreground-light">{desc}</span><div className="flex items-center gap-x-1.5">{project.status !== 'INACTIVE' && projectHomepageShowInstanceSize && (<ComputeBadgeWrapper project={project} />diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsxindex 07dc3bf0674..98f1611f4c6 100644--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsx+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsx@@ -14,6 +14,7 @@ import {useReadReplicasStatusesQuery,} from 'data/read-replicas/replicas-status-query'import { formatDatabaseID } from 'data/read-replicas/replicas.utils'+import { useCustomContent } from 'hooks/custom-content/useCustomContent'import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'import { BASE_PATH } from 'lib/constants'@@ -113,6 +114,8 @@ export const PrimaryNode = ({ data }: NodeProps<PrimaryNodeData>) => {const { projectHomepageShowInstanceSize } = useIsFeatureEnabled(['project_homepage:show_instance_size',])+ const { infraAwsNimbusLabel } = useCustomContent(['infra:aws_nimbus_label'])+ const providerLabel = provider === 'AWS_NIMBUS' ? infraAwsNimbusLabel : providerreturn (<>@@ -137,7 +140,7 @@ export const PrimaryNode = ({ data }: NodeProps<PrimaryNodeData>) => {<span className="text-sm text-foreground-light">{region.name}</span></p><p className="flex items-center gap-x-1">- <span className="text-sm text-foreground-light">{provider}</span>+ <span className="text-sm text-foreground-light">{providerLabel}</span>{projectHomepageShowInstanceSize && (<><span className="text-sm text-foreground-light">•</span>@@ -231,6 +234,9 @@ export const ReplicaNode = ({ data }: NodeProps<ReplicaNodeData>) => {] as string[]).includes(status) || initStatus === ReplicaInitializationStatus.InProgress+ const { infraAwsNimbusLabel } = useCustomContent(['infra:aws_nimbus_label'])+ const providerLabel = provider === 'AWS_NIMBUS' ? infraAwsNimbusLabel : provider+return (<><Handle type="target" position={Position.Top} style={{ background: 'transparent' }} />@@ -298,7 +304,7 @@ export const ReplicaNode = ({ data }: NodeProps<ReplicaNodeData>) => {<div className="my-0.5"><p className="text-sm text-foreground-light">{region.name}</p><p className="flex text-sm text-foreground-light items-center gap-x-1">- <span>{provider}</span>+ <span>{providerLabel}</span>{projectHomepageShowInstanceSize && !!computeSize && (<><span>•</span>diff --git a/apps/studio/hooks/custom-content/CustomContent.types.ts b/apps/studio/hooks/custom-content/CustomContent.types.tsindex 8d79b162c03..7fbe87e0741 100644--- a/apps/studio/hooks/custom-content/CustomContent.types.ts+++ b/apps/studio/hooks/custom-content/CustomContent.types.ts@@ -28,6 +28,7 @@ export type CustomContentTypes = {logsDefaultQuery: stringinfraCloudProviders: CloudProvider[]+ infraAwsNimbusLabel: stringsslCertificateUrl: string}diff --git a/apps/studio/hooks/custom-content/custom-content.json b/apps/studio/hooks/custom-content/custom-content.jsonindex 65686e6f129..2702c8c2728 100644--- a/apps/studio/hooks/custom-content/custom-content.json+++ b/apps/studio/hooks/custom-content/custom-content.json@@ -50,6 +50,7 @@"logs:default_query": null,"infra:cloud_providers": ["AWS", "AWS_K8S", "FLY"],+ "infra:aws_nimbus_label": "AWS Nimbus","ssl:certificate_url": "https://supabase-downloads.s3-ap-southeast-1.amazonaws.com/${env}/ssl/${env}-ca-2021.crt"}diff --git a/apps/studio/hooks/custom-content/custom-content.sample.json b/apps/studio/hooks/custom-content/custom-content.sample.jsonindex 3573fc9471a..b7adc83af68 100644--- a/apps/studio/hooks/custom-content/custom-content.sample.json+++ b/apps/studio/hooks/custom-content/custom-content.sample.json@@ -49,42 +49,8 @@"logs:default_query": "This is a sample query",- "connect:frameworks": {- "key": "frameworks",- "label": "Frameworks",- "obj": [- {- "key": "framework-1",- "label": "Framework 1",- "icon": "https://supabase.com/dashboard/img/supabase-logo.svg",- "guideLink": "https://supabase.com/docs",- "children": [],- "files": [- {- "name": "sample_env",- "content": "NEXT_PUBLIC_SUPABASE_URL={{apiUrl}}\nNEXT_PUBLIC_SUPABASE_ANON_KEY={{anonKey}}"- },- {- "name": "sample.ts",- "content": "import { createClient } from \"@supabase/supabase-js\";\n\nconst supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;\nconst supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;\n\nexport const supabase = createClient(supabaseUrl, supabaseKey);"- }- ]- },- {- "key": "framework-2",- "label": "Framework 2",- "icon": "https://supabase.com/dashboard/img/supabase-logo.svg",- "guideLink": "https://supabase.com/docs",- "children": [],- "files": [- { "name": "file3.tsx", "content": "Content of File 3" },- { "name": "file4.tsx", "content": "Content of File 4" }- ]- }- ]- },-"infra:cloud_providers": ["AWS_NIMBUS"],+ "infra:aws_nimbus_label": "AWS Nimbus","ssl:certificate_url": "https://supabase-downloads.s3-ap-southeast-1.amazonaws.com/${env}/ssl/${env}-ca-2021.crt"}diff --git a/apps/studio/hooks/custom-content/custom-content.schema.json b/apps/studio/hooks/custom-content/custom-content.schema.jsonindex bb7f5f8a8a0..5569c4d71fa 100644--- a/apps/studio/hooks/custom-content/custom-content.schema.json+++ b/apps/studio/hooks/custom-content/custom-content.schema.json@@ -74,6 +74,10 @@"enum": ["AWS", "AWS_K8S", "AWS_NIMBUS", "FLY"]}},+ "infra:aws_nimbus_label": {+ "type": "string",+ "description": "The label of the AWS Nimbus provider"+ },"ssl:certificate_url": {"type": "string",@@ -86,6 +90,7 @@"project_homepage:example_projects","logs:default_query","infra:cloud_providers",+ "infra:aws_nimbus_label","ssl:certificate_url"],"additionalProperties": false