diff --git a/apps/studio/components/interfaces/BranchManagement/Overview.tsx b/apps/studio/components/interfaces/BranchManagement/Overview.tsx
index af133208449..bec2163e23b 100644
--- a/apps/studio/components/interfaces/BranchManagement/Overview.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/Overview.tsx
@@ -8,6 +8,7 @@ import {
Infinity,
MoreVertical,
Pencil,
+ Redo,
RefreshCw,
Shield,
Trash2,
@@ -30,6 +31,7 @@ import { EditBranchModal } from './EditBranchModal'
import { PreviewBranchesEmptyState } from './EmptyStates'
import { DropdownMenuItemTooltip } from '@/components/ui/DropdownMenuItemTooltip'
import { TextConfirmModal } from '@/components/ui/TextConfirmModalWrapper'
+import { useBranchPushMutation } from '@/data/branches/branch-push-mutation'
import { useBranchQuery } from '@/data/branches/branch-query'
import { useBranchResetMutation } from '@/data/branches/branch-reset-mutation'
import { useBranchRestoreMutation } from '@/data/branches/branch-restore-mutation'
@@ -262,6 +264,7 @@ const PreviewBranchActions = ({
setShowPersistentBranchDeleteConfirmationModal,
] = useState(false)
const [showEditBranchModal, setShowEditBranchModal] = useState(false)
+ const [showConfirmRetriggersModal, setShowConfirmRetriggersModal] = useState(false)
const { mutate: resetBranch, isPending: isResetting } = useBranchResetMutation({
onSuccess() {
@@ -286,6 +289,20 @@ const PreviewBranchActions = ({
},
})
+ const { mutate: branchPushMutate, isPending: isRetriggering } = useBranchPushMutation({
+ onSuccess() {
+ toast.success('Success! Please allow a few minutes for the branch to update.')
+ setShowConfirmRetriggersModal(false)
+ },
+ onError: (data) => {
+ toast.error(`Failed to trigger workflow: ${data.message}`)
+ },
+ })
+
+ const onRetriggerBranch = () => {
+ branchPushMutate({ branchRef, projectRef })
+ }
+
const onRestoreBranch = () => {
restoreBranch({ branchRef, projectRef })
}
@@ -345,28 +362,54 @@ const PreviewBranchActions = ({
{!branch.deletion_scheduled_at && (
-
+ {branch.git_branch + ? 'This will re-run all steps of the workflow based on the latest git branch state.' + : 'This will re-run all steps of the workflow based on the latest dashboard state.'} +
+