From c0da4fc689bc966da8ebaeef8dc6535f10b9635a Mon Sep 17 00:00:00 2001 From: Alaister Young Date: Tue, 16 Sep 2025 22:06:57 +0800 Subject: [PATCH] chore: add custom content provider label (#38745) * chore: add custom content provider label * Remove lowercase for desc in ProjectCard --------- Co-authored-by: Joshen Lim --- .../Home/ProjectList/ProjectCard.tsx | 10 ++++-- .../InstanceNode.tsx | 10 ++++-- .../custom-content/CustomContent.types.ts | 1 + .../hooks/custom-content/custom-content.json | 1 + .../custom-content/custom-content.sample.json | 36 +------------------ .../custom-content/custom-content.schema.json | 5 +++ 6 files changed, 24 insertions(+), 39 deletions(-) diff --git a/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx b/apps/studio/components/interfaces/Home/ProjectList/ProjectCard.tsx index 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/integration import { 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={

{name}

- {desc} + {desc}
{project.status !== 'INACTIVE' && projectHomepageShowInstanceSize && ( diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/InstanceNode.tsx index 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) => { const { projectHomepageShowInstanceSize } = useIsFeatureEnabled([ 'project_homepage:show_instance_size', ]) + const { infraAwsNimbusLabel } = useCustomContent(['infra:aws_nimbus_label']) + const providerLabel = provider === 'AWS_NIMBUS' ? infraAwsNimbusLabel : provider return ( <> @@ -137,7 +140,7 @@ export const PrimaryNode = ({ data }: NodeProps) => { {region.name}

- {provider} + {providerLabel} {projectHomepageShowInstanceSize && ( <> • @@ -231,6 +234,9 @@ export const ReplicaNode = ({ data }: NodeProps) => { ] as string[] ).includes(status) || initStatus === ReplicaInitializationStatus.InProgress + const { infraAwsNimbusLabel } = useCustomContent(['infra:aws_nimbus_label']) + const providerLabel = provider === 'AWS_NIMBUS' ? infraAwsNimbusLabel : provider + return ( <> @@ -298,7 +304,7 @@ export const ReplicaNode = ({ data }: NodeProps) => {

{region.name}

- {provider} + {providerLabel} {projectHomepageShowInstanceSize && !!computeSize && ( <> • diff --git a/apps/studio/hooks/custom-content/CustomContent.types.ts b/apps/studio/hooks/custom-content/CustomContent.types.ts index 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: string infraCloudProviders: CloudProvider[] + infraAwsNimbusLabel: string sslCertificateUrl: string } diff --git a/apps/studio/hooks/custom-content/custom-content.json b/apps/studio/hooks/custom-content/custom-content.json index 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.json index 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.json index 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