diff --git a/skyvern-frontend/src/routes/workflows/WorkflowActions.tsx b/skyvern-frontend/src/routes/workflows/WorkflowActions.tsx index 45e3b4ff..86e828d6 100644 --- a/skyvern-frontend/src/routes/workflows/WorkflowActions.tsx +++ b/skyvern-frontend/src/routes/workflows/WorkflowActions.tsx @@ -39,6 +39,7 @@ import { WorkflowCreateYAMLRequest } from "./types/workflowYamlTypes"; type Props = { workflow: WorkflowApiResponse; + onSuccessfullyDeleted?: () => void; }; function downloadFile(fileName: string, contents: string) { @@ -57,7 +58,7 @@ function downloadFile(fileName: string, contents: string) { document.body.removeChild(element); } -function WorkflowActions({ workflow }: Props) { +function WorkflowActions({ workflow, onSuccessfullyDeleted }: Props) { const credentialGetter = useCredentialGetter(); const queryClient = useQueryClient(); const navigate = useNavigate(); @@ -105,6 +106,7 @@ function WorkflowActions({ workflow }: Props) { queryClient.invalidateQueries({ queryKey: ["workflows"], }); + onSuccessfullyDeleted?.(); }, onError: (error: AxiosError) => { toast({ @@ -164,7 +166,6 @@ function WorkflowActions({ workflow }: Props) { - @@ -176,7 +177,11 @@ function WorkflowActions({ workflow }: Props) { e.preventDefault()}> Are you sure? - This workflow will be deleted. + + The workflow{" "} + {workflow.title}{" "} + will be deleted. + diff --git a/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx b/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx index 6404b6b7..d9d83514 100644 --- a/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx +++ b/skyvern-frontend/src/routes/workflows/WorkflowPage.tsx @@ -31,6 +31,7 @@ import { useSearchParams, } from "react-router-dom"; import { WorkflowApiResponse } from "./types/workflowTypes"; +import { WorkflowActions } from "./WorkflowActions"; function WorkflowPage() { const credentialGetter = useCredentialGetter(); @@ -88,6 +89,12 @@ function WorkflowPage() { )}
+ {workflow && ( + navigate("/workflows")} + /> + )}