mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 06:09:08 +03:00
push button
This commit is contained in:
1 parent
a4a7890b6d
commit
35aa3774a3
1 file changed
+27
@@ -210,6 +210,17 @@ const MergePage: NextPageWithLayout = () => {
|
||||
return hasDatabaseChanges || hasEdgeFunctionChanges
|
||||
}
|
||||
|
||||
const { mutate: pushBranch, isLoading: isPushing } = useBranchPushMutation({
|
||||
onSuccess: () => {
|
||||
toast.success('Branch pushed successfully!')
|
||||
// Refresh the diff after pushing
|
||||
refetchDiff()
|
||||
},
|
||||
onError: (error) => {
|
||||
toast.error(`Failed to push branch: ${error.message}`)
|
||||
},
|
||||
})
|
||||
|
||||
const { mutate: mergeBranch, isLoading: isMerging } = useBranchMergeMutation({
|
||||
onSuccess: (data) => {
|
||||
setIsSubmitting(false)
|
||||
@@ -244,6 +255,14 @@ const MergePage: NextPageWithLayout = () => {
|
||||
},
|
||||
})
|
||||
|
||||
const handlePush = () => {
|
||||
if (!currentBranch?.id || !parentProjectRef) return
|
||||
pushBranch({
|
||||
id: currentBranch.id,
|
||||
projectRef: parentProjectRef,
|
||||
})
|
||||
}
|
||||
|
||||
const handleMerge = () => {
|
||||
if (!currentBranch?.id || !parentProjectRef || !ref) return
|
||||
setIsSubmitting(true)
|
||||
@@ -351,6 +370,14 @@ const MergePage: NextPageWithLayout = () => {
|
||||
|
||||
const primaryActions = (
|
||||
<div className="flex items-end gap-2">
|
||||
<Button
|
||||
type="default"
|
||||
loading={isPushing}
|
||||
onClick={handlePush}
|
||||
icon={<GitBranchIcon size={16} strokeWidth={1.5} />}
|
||||
>
|
||||
{isPushing ? 'Pushing...' : 'Push branch'}
|
||||
</Button>
|
||||
{isMergeDisabled ? (
|
||||
<ButtonTooltip
|
||||
tooltip={{
|
||||
|
||||
Reference in new issue
Block a user