Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix

Joshen Lim7c7f462cc5e4
diff --git a/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx b/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
index 3b5cc536aa6..ebe6a994c03 100644
--- a/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
+++ b/studio/components/layouts/AppLayout/EnableBranchingButton/EnableBranchingButton.tsx
@@ -46,6 +46,8 @@ const EnableBranchingButton = () => {
// [Joshen TODO] To be dynamic
const isBranchingAllowed = true
+ const hasGithubIntegrationInstalled =
+ integrations?.some((integration) => integration.integration.name === 'GitHub') ?? false
const githubIntegration = integrations?.find(
(integration) =>
integration.integration.name === 'GitHub' &&
@@ -119,6 +121,7 @@ const EnableBranchingButton = () => {
<GithubRepositorySelection
integration={githubIntegration}
selectedBranch={selectedBranch}
+ hasGithubIntegrationInstalled={hasGithubIntegrationInstalled}
setSelectedBranch={setSelectedBranch}
onSelectConnectRepo={() => setAddConnectionType('GitHub')}
/>
diff --git a/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx b/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx
index 31ff143f088..b966cb1d4e7 100644
--- a/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx
+++ b/studio/components/layouts/AppLayout/EnableBranchingButton/GithubRepositorySelection.tsx
@@ -31,15 +31,15 @@ import { Integration } from 'data/integrations/integrations.types'
interface GithubRepositorySelectionProps {
integration?: Integration
selectedBranch?: string
+ hasGithubIntegrationInstalled: boolean
setSelectedBranch: (name: string) => void
onSelectConnectRepo: () => void
}
-// [Joshen TODO] Integrate the Github repo selector
-
const GithubRepositorySelection = ({
integration,
selectedBranch,
+ hasGithubIntegrationInstalled,
setSelectedBranch,
onSelectConnectRepo,
}: GithubRepositorySelectionProps) => {
@@ -66,7 +66,10 @@ const GithubRepositorySelection = ({
return (
<div
- className={clsx('border-t border-b', !integration ? 'border-warning-300 bg-warning-200' : '')}
+ className={clsx(
+ 'border-t border-b',
+ !hasGithubIntegrationInstalled ? 'border-warning-300 bg-warning-200' : ''
+ )}
>
<Modal.Content className="px-7">
<div className="py-6">
@@ -79,7 +82,7 @@ const GithubRepositorySelection = ({
? 'Your database preview branches will be based on the branches in the following repository that your project is connected with:'
: 'Your database preview branches will be based on the branches in the Git repository that your project is connected with.'}
</p>
- {!integration && (
+ {!hasGithubIntegrationInstalled && (
<Link passHref href="/">
<a target="_blank" rel="noreferrer">
<Button type="default" className="!mt-3">
@@ -88,7 +91,7 @@ const GithubRepositorySelection = ({
</a>
</Link>
)}
- {integration && !githubConnection && (
+ {hasGithubIntegrationInstalled && !githubConnection && (
<EmptyIntegrationConnection showNode={false} onClick={() => onSelectConnectRepo()} />
)}
{integration && githubConnection && (