Add Delete branch buttons (#13826)

Deleting branches containing a filter isn't yet supported by the
backend, but I set up the button in the frontend.



https://github.com/user-attachments/assets/f27234c4-ff9c-4f5c-930c-64d824981454
This commit is contained in:
Baptiste Devessier
2025-08-11 17:38:22 +02:00
committed by GitHub
parent 32cdb66802
commit 3e5b60a923
3 changed files with 47 additions and 18 deletions
@@ -1,14 +1,15 @@
import { useGetUpdatableWorkflowVersion } from '@/workflow/hooks/useGetUpdatableWorkflowVersion';
import { type WorkflowWithCurrentVersion } from '@/workflow/types/Workflow';
import { assertWorkflowWithCurrentVersionIsDefined } from '@/workflow/utils/assertWorkflowWithCurrentVersionIsDefined';
import { type WorkflowDiagramEdge } from '@/workflow/workflow-diagram/types/WorkflowDiagramEdge';
import { useDeleteWorkflowVersionEdge } from '@/workflow/workflow-steps/hooks/useDeleteWorkflowVersionEdge';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { type WorkflowDiagramEdge } from '@/workflow/workflow-diagram/types/WorkflowDiagramEdge';
export const useDeleteEdge = ({
workflow,
}: {
workflow: WorkflowWithCurrentVersion;
workflow: WorkflowWithCurrentVersion | undefined;
}) => {
const [isLoading, setIsLoading] = useState(false);
@@ -17,6 +18,8 @@ export const useDeleteEdge = ({
const { getUpdatableWorkflowVersion } = useGetUpdatableWorkflowVersion();
const deleteEdge = async ({ source, target }: WorkflowDiagramEdge) => {
assertWorkflowWithCurrentVersionIsDefined(workflow);
if (isLoading) {
return;
}