File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed
components/interfaces/BranchManagement
pages/project/[ref]/branches Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -62,13 +62,15 @@ interface BranchRowProps {
6262 repo : string
6363 label ?: string | ReactNode
6464 branch : Branch
65+ isGithubConnected : boolean
6566 rowLink ?: string
6667 external ?: boolean
6768 rowActions ?: ReactNode
6869}
6970
7071export const BranchRow = ( {
7172 branch,
73+ isGithubConnected,
7274 label,
7375 repo,
7476 rowLink,
@@ -87,7 +89,7 @@ export const BranchRow = ({
8789 return (
8890 < div className = "w-full flex items-center justify-between px-4 py-2.5 hover:bg-surface-100" >
8991 < div className = "flex items-center gap-x-3" >
90- { branch . git_branch && (
92+ { branch . git_branch && isGithubConnected && (
9193 < ButtonTooltip
9294 asChild
9395 type = "default"
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import { EditBranchModal } from './EditBranchModal'
3838import { PreviewBranchesEmptyState } from './EmptyStates'
3939
4040interface OverviewProps {
41+ isGithubConnected : boolean
4142 isLoading : boolean
4243 isSuccess : boolean
4344 repo : string
@@ -49,6 +50,7 @@ interface OverviewProps {
4950}
5051
5152export const Overview = ( {
53+ isGithubConnected,
5254 isLoading,
5355 isSuccess,
5456 repo,
@@ -71,6 +73,7 @@ export const Overview = ({
7173 { isSuccess && mainBranch !== undefined && (
7274 < BranchRow
7375 branch = { mainBranch }
76+ isGithubConnected = { isGithubConnected }
7477 label = {
7578 < div className = "flex items-center gap-x-2" >
7679 < Shield size = { 14 } strokeWidth = { 1.5 } className = "text-warning" />
@@ -109,6 +112,7 @@ export const Overview = ({
109112 persistentBranches . map ( ( branch ) => {
110113 return (
111114 < BranchRow
115+ isGithubConnected = { isGithubConnected }
112116 key = { branch . id }
113117 repo = { repo }
114118 branch = { branch }
@@ -135,6 +139,7 @@ export const Overview = ({
135139 ephemeralBranches . map ( ( branch ) => {
136140 return (
137141 < BranchRow
142+ isGithubConnected = { isGithubConnected }
138143 key = { branch . id }
139144 repo = { repo }
140145 branch = { branch }
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ const BranchesPage: NextPageWithLayout = () => {
7777 const isLoading = isLoadingConnections || isLoadingBranches
7878 const isSuccess = isSuccessConnections && isSuccessBranches
7979
80+ const isGithubConnected = githubConnection !== undefined
81+
8082 const { mutate : deleteBranch , isPending : isDeleting } = useBranchDeleteMutation ( {
8183 onSuccess : ( ) => {
8284 toast . success ( 'Successfully deleted branch' )
@@ -145,6 +147,7 @@ const BranchesPage: NextPageWithLayout = () => {
145147
146148 { ! isError && (
147149 < Overview
150+ isGithubConnected = { isGithubConnected }
148151 isLoading = { isLoading }
149152 isSuccess = { isSuccess }
150153 repo = { repo }
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ const MergeRequestsPage: NextPageWithLayout = () => {
8989
9090 const isError = isErrorConnections || isErrorBranches
9191
92+ const isGithubConnected = githubConnection !== undefined
93+
9294 const { mutate : sendEvent } = useSendEventMutation ( )
9395
9496 const { mutate : updateBranch , isPending : isUpdating } = useBranchUpdateMutation ( {
@@ -228,6 +230,7 @@ const MergeRequestsPage: NextPageWithLayout = () => {
228230 : `/project/${ branch . project_ref } /merge`
229231 return (
230232 < BranchRow
233+ isGithubConnected = { isGithubConnected }
231234 key = { branch . id }
232235 label = {
233236 < div className = "flex items-center gap-x-4" >
You can’t perform that action at this time.
0 commit comments