make missing script key value 'default' (#3278)
This commit is contained in:
@@ -181,7 +181,7 @@ function WorkflowHeader({
|
|||||||
}
|
}
|
||||||
onCacheKeyValuesKeydown(e);
|
onCacheKeyValuesKeydown(e);
|
||||||
}}
|
}}
|
||||||
placeholder="Script Key"
|
placeholder="Script Key Value"
|
||||||
value={chosenCacheKeyValue ?? undefined}
|
value={chosenCacheKeyValue ?? undefined}
|
||||||
onBlur={(e) => {
|
onBlur={(e) => {
|
||||||
onCacheKeyValuesBlurred(e.target.value);
|
onCacheKeyValuesBlurred(e.target.value);
|
||||||
|
|||||||
@@ -681,7 +681,7 @@ function Workspace({
|
|||||||
<WorkflowCacheKeyValuesPanel
|
<WorkflowCacheKeyValuesPanel
|
||||||
cacheKeyValues={cacheKeyValues}
|
cacheKeyValues={cacheKeyValues}
|
||||||
pending={cacheKeyValuesLoading}
|
pending={cacheKeyValuesLoading}
|
||||||
scriptKey={workflow.cache_key ?? "<none>"}
|
scriptKey={workflow.cache_key ?? "default"}
|
||||||
onDelete={(cacheKeyValue) => {
|
onDelete={(cacheKeyValue) => {
|
||||||
setToDeleteCacheKeyValue(cacheKeyValue);
|
setToDeleteCacheKeyValue(cacheKeyValue);
|
||||||
setOpenConfirmCacheKeyValueDeleteDialogue(true);
|
setOpenConfirmCacheKeyValueDeleteDialogue(true);
|
||||||
|
|||||||
@@ -151,16 +151,21 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{inputs.useScriptCache && (
|
{inputs.useScriptCache && (
|
||||||
<WorkflowBlockInputTextarea
|
<div className="space-y-2">
|
||||||
nodeId={id}
|
<div className="flex gap-2">
|
||||||
onChange={(value) => {
|
<Label>Script Key (optional)</Label>
|
||||||
const v = value.length ? value : null;
|
</div>
|
||||||
handleChange("scriptCacheKey", v);
|
<WorkflowBlockInputTextarea
|
||||||
}}
|
nodeId={id}
|
||||||
value={inputs.scriptCacheKey ?? ""}
|
onChange={(value) => {
|
||||||
placeholder={placeholders["scripts"]["scriptKey"]}
|
const v = value.length ? value : null;
|
||||||
className="nopan text-xs"
|
handleChange("scriptCacheKey", v);
|
||||||
/>
|
}}
|
||||||
|
value={inputs.scriptCacheKey ?? ""}
|
||||||
|
placeholder={placeholders["scripts"]["scriptKey"]}
|
||||||
|
className="nopan text-xs"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</OrgWalled>
|
</OrgWalled>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ function WorkflowCacheKeyValuesPanel({
|
|||||||
<code className="font-mono text-xs text-slate-200">
|
<code className="font-mono text-xs text-slate-200">
|
||||||
{scriptKey}
|
{scriptKey}
|
||||||
</code>
|
</code>
|
||||||
, 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"}{" "}
|
there {totalCount === 1 ? "is" : "are"}{" "}
|
||||||
<span className="font-bold text-slate-200">{totalCount}</span>{" "}
|
<span className="font-bold text-slate-200">{totalCount}</span>{" "}
|
||||||
cached {totalCount === 1 ? "value" : "values"}
|
script key {totalCount === 1 ? "value" : "values"}
|
||||||
{filteredCount !== totalCount && (
|
{filteredCount !== totalCount && (
|
||||||
<>
|
<>
|
||||||
{" "}
|
{" "}
|
||||||
@@ -140,7 +140,7 @@ function WorkflowCacheKeyValuesPanel({
|
|||||||
</PaginationItem>
|
</PaginationItem>
|
||||||
<PaginationItem>
|
<PaginationItem>
|
||||||
<div className="text-sm font-bold">
|
<div className="text-sm font-bold">
|
||||||
{displayPage} of {totalPages}
|
{displayPage} of {isNaN(totalPages) ? 0 : totalPages}
|
||||||
</div>
|
</div>
|
||||||
</PaginationItem>
|
</PaginationItem>
|
||||||
<PaginationItem>
|
<PaginationItem>
|
||||||
|
|||||||
@@ -100,6 +100,10 @@ const useWorkflowSave = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const scriptCacheKey = saveData.settings.scriptCacheKey ?? "";
|
||||||
|
const normalizedKey =
|
||||||
|
scriptCacheKey === "" ? "default" : saveData.settings.scriptCacheKey;
|
||||||
|
|
||||||
const requestBody: WorkflowCreateYAMLRequest = {
|
const requestBody: WorkflowCreateYAMLRequest = {
|
||||||
title: saveData.title,
|
title: saveData.title,
|
||||||
description: saveData.workflow.description,
|
description: saveData.workflow.description,
|
||||||
@@ -111,7 +115,7 @@ const useWorkflowSave = () => {
|
|||||||
totp_verification_url: saveData.workflow.totp_verification_url,
|
totp_verification_url: saveData.workflow.totp_verification_url,
|
||||||
extra_http_headers: extraHttpHeaders,
|
extra_http_headers: extraHttpHeaders,
|
||||||
generate_script: saveData.settings.useScriptCache,
|
generate_script: saveData.settings.useScriptCache,
|
||||||
cache_key: saveData.settings.scriptCacheKey,
|
cache_key: normalizedKey,
|
||||||
workflow_definition: {
|
workflow_definition: {
|
||||||
parameters: saveData.parameters,
|
parameters: saveData.parameters,
|
||||||
blocks: saveData.blocks,
|
blocks: saveData.blocks,
|
||||||
|
|||||||
Reference in New Issue
Block a user