chore: add custom content provider label (#38745)

* chore: add custom content provider label

* Remove lowercase for desc in ProjectCard

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
This commit is contained in:
Alaister YoungandJoshen Lim authored and GitHub committed 2025-09-16 22:06:57 +08:00
1 parent e09df40f93
commit c0da4fc689
6 files changed
+24 -39

No files matched your search

@@ -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={
<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} />
@@ -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 : provider
return (
<>
@@ -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>
@@ -28,6 +28,7 @@ export type CustomContentTypes = {
logsDefaultQuery: string
infraCloudProviders: CloudProvider[]
infraAwsNimbusLabel: string
sslCertificateUrl: string
}
@@ -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"
}
@@ -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"
}
@@ -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