Skip to content

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

Fix: added check to ensure github is connected before showing the logo on branch (#40687)

Ali Waseem5d3493914a15
diff --git a/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx b/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx
index 55285d3368d..629739d8ef4 100644
--- a/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx
@@ -62,6 +62,7 @@ interface BranchRowProps {
repo: string
label?: string | ReactNode
branch: Branch
+ isGithubConnected: boolean
rowLink?: string
external?: boolean
rowActions?: ReactNode
@@ -69,6 +70,7 @@ interface BranchRowProps {
export const BranchRow = ({
branch,
+ isGithubConnected,
label,
repo,
rowLink,
@@ -87,7 +89,7 @@ export const BranchRow = ({
return (
<div className="w-full flex items-center justify-between px-4 py-2.5 hover:bg-surface-100">
<div className="flex items-center gap-x-3">
- {branch.git_branch && (
+ {branch.git_branch && isGithubConnected && (
<ButtonTooltip
asChild
type="default"
diff --git a/apps/studio/components/interfaces/BranchManagement/Overview.tsx b/apps/studio/components/interfaces/BranchManagement/Overview.tsx
index 64ef6818bae..11b3b5f781f 100644
--- a/apps/studio/components/interfaces/BranchManagement/Overview.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/Overview.tsx
@@ -38,6 +38,7 @@ import { EditBranchModal } from './EditBranchModal'
import { PreviewBranchesEmptyState } from './EmptyStates'
interface OverviewProps {
+ isGithubConnected: boolean
isLoading: boolean
isSuccess: boolean
repo: string
@@ -49,6 +50,7 @@ interface OverviewProps {
}
export const Overview = ({
+ isGithubConnected,
isLoading,
isSuccess,
repo,
@@ -71,6 +73,7 @@ export const Overview = ({
{isSuccess && mainBranch !== undefined && (
<BranchRow
branch={mainBranch}
+ isGithubConnected={isGithubConnected}
label={
<div className="flex items-center gap-x-2">
<Shield size={14} strokeWidth={1.5} className="text-warning" />
@@ -109,6 +112,7 @@ export const Overview = ({
persistentBranches.map((branch) => {
return (
<BranchRow
+ isGithubConnected={isGithubConnected}
key={branch.id}
repo={repo}
branch={branch}
@@ -135,6 +139,7 @@ export const Overview = ({
ephemeralBranches.map((branch) => {
return (
<BranchRow
+ isGithubConnected={isGithubConnected}
key={branch.id}
repo={repo}
branch={branch}
diff --git a/apps/studio/pages/project/[ref]/branches/index.tsx b/apps/studio/pages/project/[ref]/branches/index.tsx
index c7ef6910775..5805ad4ce2e 100644
--- a/apps/studio/pages/project/[ref]/branches/index.tsx
+++ b/apps/studio/pages/project/[ref]/branches/index.tsx
@@ -77,6 +77,8 @@ const BranchesPage: NextPageWithLayout = () => {
const isLoading = isLoadingConnections || isLoadingBranches
const isSuccess = isSuccessConnections && isSuccessBranches
+ const isGithubConnected = githubConnection !== undefined
+
const { mutate: deleteBranch, isPending: isDeleting } = useBranchDeleteMutation({
onSuccess: () => {
toast.success('Successfully deleted branch')
@@ -145,6 +147,7 @@ const BranchesPage: NextPageWithLayout = () => {
{!isError && (
<Overview
+ isGithubConnected={isGithubConnected}
isLoading={isLoading}
isSuccess={isSuccess}
repo={repo}
diff --git a/apps/studio/pages/project/[ref]/branches/merge-requests.tsx b/apps/studio/pages/project/[ref]/branches/merge-requests.tsx
index f045acb4a0c..ebed655e877 100644
--- a/apps/studio/pages/project/[ref]/branches/merge-requests.tsx
+++ b/apps/studio/pages/project/[ref]/branches/merge-requests.tsx
@@ -89,6 +89,8 @@ const MergeRequestsPage: NextPageWithLayout = () => {
const isError = isErrorConnections || isErrorBranches
+ const isGithubConnected = githubConnection !== undefined
+
const { mutate: sendEvent } = useSendEventMutation()
const { mutate: updateBranch, isPending: isUpdating } = useBranchUpdateMutation({
@@ -228,6 +230,7 @@ const MergeRequestsPage: NextPageWithLayout = () => {
: `/project/${branch.project_ref}/merge`
return (
<BranchRow
+ isGithubConnected={isGithubConnected}
key={branch.id}
label={
<div className="flex items-center gap-x-4">