From 5009355cb094e620183751e7b47a559db3d3b3bb Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Sat, 1 Feb 2025 01:05:47 +0800 Subject: [PATCH] =?UTF-8?q?Start=20workflow=20runs=20instantly=20instead?= =?UTF-8?q?=20of=20showing=20a=20notification=20which=E2=80=A6=20(#1687)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/routes/workflows/RunWorkflowForm.tsx | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx index e069990f..2c82e10b 100644 --- a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx +++ b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx @@ -17,11 +17,10 @@ import { useCredentialGetter } from "@/hooks/useCredentialGetter"; import { copyText } from "@/util/copyText"; import { apiBaseUrl } from "@/util/env"; import { CopyIcon, PlayIcon, ReloadIcon } from "@radix-ui/react-icons"; -import { ToastAction } from "@radix-ui/react-toast"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import fetchToCurl from "fetch-to-curl"; import { useForm } from "react-hook-form"; -import { Link, useParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; import { z } from "zod"; import { WorkflowParameter } from "./types/workflowTypes"; import { WorkflowParameterInput } from "./WorkflowParameterInput"; @@ -107,6 +106,7 @@ function RunWorkflowForm({ }: Props) { const { workflowPermanentId } = useParams(); const credentialGetter = useCredentialGetter(); + const navigate = useNavigate(); const queryClient = useQueryClient(); const form = useForm({ defaultValues: { @@ -131,21 +131,13 @@ function RunWorkflowForm({ variant: "success", title: "Workflow run started", description: "The workflow run has been started successfully", - action: ( - - - - ), }); queryClient.invalidateQueries({ queryKey: ["workflowRuns"], }); + navigate( + `/workflows/${workflowPermanentId}/${response.data.workflow_run_id}/overview`, + ); }, onError: (error) => { toast({