Skip to content

Commit a7db531

Browse files
authored
update api keys section in connect dialog (supabase#41638)
* update api keys section in connect dialog * handle non platform * fix links
1 parent f9f1e40 commit a7db531

2 files changed

Lines changed: 33 additions & 12 deletions

File tree

apps/studio/components/interfaces/Connect/Connect.tsx

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PermissionAction } from '@supabase/shared-types/out/constants'
2-
import { useParams } from 'common'
2+
import { IS_PLATFORM, useParams } from 'common'
33
import { ExternalLink, Plug } from 'lucide-react'
44
import { parseAsBoolean, parseAsString, useQueryState } from 'nuqs'
55
import { useEffect, useMemo, useState } from 'react'
@@ -13,7 +13,7 @@ import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query
1313
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
1414
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
1515
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
16-
import { PROJECT_STATUS } from 'lib/constants'
16+
import { BASE_PATH, PROJECT_STATUS } from 'lib/constants'
1717
import { useRouter } from 'next/router'
1818
import {
1919
Button,
@@ -36,6 +36,7 @@ import { CONNECTION_TYPES, ConnectionType, FRAMEWORKS, MOBILES, ORMS } from './C
3636
import { getContentFilePath, inferConnectTabFromParentKey } from './Connect.utils'
3737
import { ConnectDropdown } from './ConnectDropdown'
3838
import { ConnectTabContent } from './ConnectTabContent'
39+
import Link from 'next/link'
3940

4041
export const Connect = () => {
4142
const router = useRouter()
@@ -483,15 +484,35 @@ export const Connect = () => {
483484
selectedFrameworkOrTool={selectedFrameworkOrTool}
484485
className="rounded-b-none"
485486
/>
486-
<Panel.Notice
487-
className="border border-t-0 rounded-lg rounded-t-none"
488-
title="New API keys coming 2025"
489-
description={`
490-
\`anon\` and \`service_role\` API keys will be changing to \`publishable\` and \`secret\` API keys.
491-
`}
492-
href="https://github.com/orgs/supabase/discussions/29260"
493-
buttonText="Read the announcement"
494-
/>
487+
{IS_PLATFORM && (
488+
<Panel.Notice
489+
className="border border-t-0 rounded-lg rounded-t-none"
490+
badgeLabel="Changelog"
491+
title="New publishable and secret API keys"
492+
description={
493+
<>
494+
<p>
495+
View your publishable and secret API keys from the project{' '}
496+
<Link href={`${BASE_PATH}/project/${projectRef}/settings/api-keys`}>
497+
API settings page
498+
</Link>
499+
</p>
500+
<p>
501+
To learn more about the new API keys, read the{' '}
502+
<a
503+
href="https://supabase.com/docs/guides/api/api-keys"
504+
target="_blank"
505+
rel="noreferrer"
506+
>
507+
documentation
508+
</a>
509+
</p>
510+
</>
511+
}
512+
href={`${BASE_PATH}/project/${projectRef}/settings/api-keys`}
513+
buttonText="View API keys"
514+
/>
515+
)}
495516
</TabsContent_Shadcn_>
496517
)
497518
})}

apps/studio/components/ui/Panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const PanelNotice = forwardRef<
7070
{
7171
className?: string | false
7272
title?: string
73-
description?: string
73+
description?: ReactNode
7474
href?: string
7575
buttonText?: string
7676
layout?: 'horizontal' | 'vertical'

0 commit comments

Comments
 (0)