From 164bcf57c9e56af4e52070226cf51833b43e7519 Mon Sep 17 00:00:00 2001 From: Jonathan Dobson Date: Fri, 22 Aug 2025 17:34:53 -0400 Subject: [PATCH] make missing script key value 'default' (#3278) --- .../workflows/editor/WorkflowHeader.tsx | 2 +- .../src/routes/workflows/editor/Workspace.tsx | 2 +- .../editor/nodes/StartNode/StartNode.tsx | 25 +++++++++++-------- .../panels/WorkflowCacheKeyValuesPanel.tsx | 6 ++--- .../src/store/WorkflowHasChangesStore.ts | 6 ++++- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx b/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx index 5ceb67ce..97be0ceb 100644 --- a/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/WorkflowHeader.tsx @@ -181,7 +181,7 @@ function WorkflowHeader({ } onCacheKeyValuesKeydown(e); }} - placeholder="Script Key" + placeholder="Script Key Value" value={chosenCacheKeyValue ?? undefined} onBlur={(e) => { onCacheKeyValuesBlurred(e.target.value); diff --git a/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx b/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx index 3f081ba6..78dd7a11 100644 --- a/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/Workspace.tsx @@ -681,7 +681,7 @@ function Workspace({ "} + scriptKey={workflow.cache_key ?? "default"} onDelete={(cacheKeyValue) => { setToDeleteCacheKeyValue(cacheKeyValue); setOpenConfirmCacheKeyValueDeleteDialogue(true); diff --git a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx index 5558a7be..0339bbb6 100644 --- a/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/nodes/StartNode/StartNode.tsx @@ -151,16 +151,21 @@ function StartNode({ id, data }: NodeProps) { {inputs.useScriptCache && ( - { - const v = value.length ? value : null; - handleChange("scriptCacheKey", v); - }} - value={inputs.scriptCacheKey ?? ""} - placeholder={placeholders["scripts"]["scriptKey"]} - className="nopan text-xs" - /> +
+
+ +
+ { + const v = value.length ? value : null; + handleChange("scriptCacheKey", v); + }} + value={inputs.scriptCacheKey ?? ""} + placeholder={placeholders["scripts"]["scriptKey"]} + className="nopan text-xs" + /> +
)}
diff --git a/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowCacheKeyValuesPanel.tsx b/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowCacheKeyValuesPanel.tsx index 0a960ed5..9881bd8a 100644 --- a/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowCacheKeyValuesPanel.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/panels/WorkflowCacheKeyValuesPanel.tsx @@ -50,10 +50,10 @@ function WorkflowCacheKeyValuesPanel({ {scriptKey} - , search for a cached value to see scripts for. For this script key + , search for scripts using a script key value. For this script key there {totalCount === 1 ? "is" : "are"}{" "} {totalCount}{" "} - cached {totalCount === 1 ? "value" : "values"} + script key {totalCount === 1 ? "value" : "values"} {filteredCount !== totalCount && ( <> {" "} @@ -140,7 +140,7 @@ function WorkflowCacheKeyValuesPanel({
- {displayPage} of {totalPages} + {displayPage} of {isNaN(totalPages) ? 0 : totalPages}
diff --git a/skyvern-frontend/src/store/WorkflowHasChangesStore.ts b/skyvern-frontend/src/store/WorkflowHasChangesStore.ts index 802fa079..0c702164 100644 --- a/skyvern-frontend/src/store/WorkflowHasChangesStore.ts +++ b/skyvern-frontend/src/store/WorkflowHasChangesStore.ts @@ -100,6 +100,10 @@ const useWorkflowSave = () => { } } + const scriptCacheKey = saveData.settings.scriptCacheKey ?? ""; + const normalizedKey = + scriptCacheKey === "" ? "default" : saveData.settings.scriptCacheKey; + const requestBody: WorkflowCreateYAMLRequest = { title: saveData.title, description: saveData.workflow.description, @@ -111,7 +115,7 @@ const useWorkflowSave = () => { totp_verification_url: saveData.workflow.totp_verification_url, extra_http_headers: extraHttpHeaders, generate_script: saveData.settings.useScriptCache, - cache_key: saveData.settings.scriptCacheKey, + cache_key: normalizedKey, workflow_definition: { parameters: saveData.parameters, blocks: saveData.blocks,