From a64da9270065f6b718cff3314e9180582ac29c37 Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Mon, 16 Dec 2024 15:47:51 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'skyvern-fronte?= =?UTF-8?q?nd/src/'=20with=20remote=20'skyvern-frontend/src/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > [!IMPORTANT] > Reuse `proxyLocation` when rerunning workflows, defaulting to `ProxyLocation.Residential` if not set, in `WorkflowRun` and `WorkflowRunParameters`. > > - **Behavior**: > - Reuse `proxyLocation` when rerunning workflows in `WorkflowRun` and `WorkflowRunParameters`. > - Default to `ProxyLocation.Residential` if `proxyLocation` is not set. > - **State Management**: > - Pass `proxyLocation` in `state` when navigating to rerun a workflow in `WorkflowRun`. > - Retrieve `proxyLocation` from `location.state` in `WorkflowRunParameters`. > - **Initial Settings**: > - Set `proxyLocation` in `initialSettings` of `RunWorkflowForm` in `WorkflowRunParameters`. > > This description was created by [Ellipsis](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral) for 04fd4ccfaa4b55918b808e1d046b008777878b2d. It will automatically update as commits are pushed. --- skyvern-frontend/src/routes/workflows/WorkflowRun.tsx | 4 ++++ .../src/routes/workflows/WorkflowRunParameters.tsx | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx b/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx index a81586d41..32ec25b31 100644 --- a/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx +++ b/skyvern-frontend/src/routes/workflows/WorkflowRun.tsx @@ -30,6 +30,7 @@ import { statusIsFinalized, statusIsRunningOrQueued } from "../tasks/types"; import { useWorkflowQuery } from "./hooks/useWorkflowQuery"; import { useWorkflowRunQuery } from "./hooks/useWorkflowRunQuery"; import { cn } from "@/util/utils"; +import { ProxyLocation } from "@/api/types"; function WorkflowRun() { const { workflowRunId, workflowPermanentId } = useParams(); @@ -79,6 +80,8 @@ function WorkflowRun() { const workflowRunIsFinalized = workflowRun && statusIsFinalized(workflowRun); const parameters = workflowRun?.parameters ?? {}; + const proxyLocation = + workflowRun?.proxy_location ?? ProxyLocation.Residential; const title = workflowIsLoading ? ( @@ -189,6 +192,7 @@ function WorkflowRun() { to={`/workflows/${workflowPermanentId}/run`} state={{ data: parameters, + proxyLocation, }} > diff --git a/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx b/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx index f7e61da88..7520675c3 100644 --- a/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx +++ b/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx @@ -27,6 +27,10 @@ function WorkflowRunParameters() { (parameter) => parameter.parameter_type === "workflow", ); + const proxyLocation = location.state + ? (location.state.proxyLocation as ProxyLocation) + : null; + const initialValues = location.state?.data ? location.state.data : workflowParameters?.reduce( @@ -95,7 +99,10 @@ function WorkflowRunParameters() { initialValues={initialValues} workflowParameters={workflowParameters} initialSettings={{ - proxyLocation: workflow.proxy_location ?? ProxyLocation.Residential, + proxyLocation: + proxyLocation ?? + workflow.proxy_location ?? + ProxyLocation.Residential, webhookCallbackUrl: workflow.webhook_callback_url ?? "", }} />