update 'Scripts' -> 'Code'; update some other verbiage (#3316)
This commit is contained in:
@@ -96,7 +96,7 @@ function ScrollableActionList({
|
|||||||
</div>
|
</div>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent className="max-w-[250px]">
|
<TooltipContent className="max-w-[250px]">
|
||||||
Scripted Execution
|
Code Execution
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ function WorkflowHeader({
|
|||||||
}
|
}
|
||||||
onCacheKeyValuesKeydown(e);
|
onCacheKeyValuesKeydown(e);
|
||||||
}}
|
}}
|
||||||
placeholder="Script Key Value"
|
placeholder="Code Key Value"
|
||||||
value={chosenCacheKeyValue ?? undefined}
|
value={chosenCacheKeyValue ?? undefined}
|
||||||
onBlur={(e) => {
|
onBlur={(e) => {
|
||||||
onCacheKeyValuesBlurred(e.target.value);
|
onCacheKeyValuesBlurred(e.target.value);
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ function Workspace({
|
|||||||
onError: (error: AxiosError) => {
|
onError: (error: AxiosError) => {
|
||||||
toast({
|
toast({
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
title: "Failed to delete cache key value",
|
title: "Failed to delete code key value",
|
||||||
description: error.message,
|
description: error.message,
|
||||||
});
|
});
|
||||||
setToDeleteCacheKeyValue(null);
|
setToDeleteCacheKeyValue(null);
|
||||||
@@ -534,15 +534,15 @@ function Workspace({
|
|||||||
>
|
>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Delete A Script Key Value</DialogTitle>
|
<DialogTitle>Delete A Code Key Value</DialogTitle>
|
||||||
<DialogDescription>
|
<DialogDescription>
|
||||||
<div className="w-full pb-2 pt-4 text-sm text-slate-400">
|
<div className="w-full pb-2 pt-4 text-sm text-slate-400">
|
||||||
{deleteCacheKeyValue.isPending ? (
|
{deleteCacheKeyValue.isPending ? (
|
||||||
"Deleting script key value..."
|
"Deleting code key value..."
|
||||||
) : (
|
) : (
|
||||||
<div className="flex w-full flex-col gap-2">
|
<div className="flex w-full flex-col gap-2">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
Are you sure you want to delete this script key value?
|
Are you sure you want to delete this code key value?
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="max-w-[29rem] overflow-hidden text-ellipsis whitespace-nowrap text-sm font-bold text-slate-400"
|
className="max-w-[29rem] overflow-hidden text-ellipsis whitespace-nowrap text-sm font-bold text-slate-400"
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ function NodeActionMenu({
|
|||||||
onShowScript();
|
onShowScript();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{showScriptText ?? "Show Script"}
|
{showScriptText ?? "Show Code"}
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
)}
|
)}
|
||||||
</OrgWalled>
|
</OrgWalled>
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
<NodeActionMenu
|
<NodeActionMenu
|
||||||
isDeletable={false}
|
isDeletable={false}
|
||||||
isScriptable={true}
|
isScriptable={true}
|
||||||
showScriptText="Show All Scripts"
|
showScriptText="Show All Code"
|
||||||
onShowScript={showAllScripts}
|
onShowScript={showAllScripts}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -218,8 +218,8 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
<OrgWalled className="flex flex-col gap-4">
|
<OrgWalled className="flex flex-col gap-4">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Label>Generate Script</Label>
|
<Label>Generate Code</Label>
|
||||||
<HelpTooltip content="Generate & use cached scripts for faster execution." />
|
<HelpTooltip content="Generate & use cached code for faster execution." />
|
||||||
<Switch
|
<Switch
|
||||||
className="ml-auto"
|
className="ml-auto"
|
||||||
checked={inputs.useScriptCache}
|
checked={inputs.useScriptCache}
|
||||||
@@ -232,7 +232,8 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
{inputs.useScriptCache && (
|
{inputs.useScriptCache && (
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<Label>Script Key (optional)</Label>
|
<Label>Code Key (optional)</Label>
|
||||||
|
<HelpTooltip content="A static or dynamic key for directing code generation." />
|
||||||
</div>
|
</div>
|
||||||
<WorkflowBlockInputTextarea
|
<WorkflowBlockInputTextarea
|
||||||
nodeId={id}
|
nodeId={id}
|
||||||
|
|||||||
@@ -44,16 +44,16 @@ function WorkflowCacheKeyValuesPanel({
|
|||||||
>
|
>
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<header>
|
<header>
|
||||||
<h1 className="text-lg">Cached Scripts</h1>
|
<h1 className="text-lg">Code Cache</h1>
|
||||||
<span className="text-sm text-slate-400">
|
<span className="text-sm text-slate-400">
|
||||||
Given your script key,{" "}
|
Given your code key,{" "}
|
||||||
<code className="font-mono text-xs text-slate-200">
|
<code className="font-mono text-xs text-slate-200">
|
||||||
{scriptKey}
|
{scriptKey}
|
||||||
</code>
|
</code>
|
||||||
, search for scripts using a script key value. For this script key
|
, search for saved code using a code key value. For this code 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> code
|
||||||
script key {totalCount === 1 ? "value" : "values"}
|
key {totalCount === 1 ? "value" : "values"}
|
||||||
{filteredCount !== totalCount && (
|
{filteredCount !== totalCount && (
|
||||||
<>
|
<>
|
||||||
{" "}
|
{" "}
|
||||||
|
|||||||
@@ -98,10 +98,10 @@ const getInitialParameters = (workflow: WorkflowApiResponse) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempt to construct a valid cache key value from the workflow parameters.
|
* Attempt to construct a valid code key value from the workflow parameters.
|
||||||
*/
|
*/
|
||||||
const constructCacheKeyValue = (
|
const constructCacheKeyValue = (
|
||||||
cacheKey: string,
|
codeKey: string,
|
||||||
workflow: WorkflowApiResponse,
|
workflow: WorkflowApiResponse,
|
||||||
) => {
|
) => {
|
||||||
const workflowParameters = getInitialParameters(workflow)
|
const workflowParameters = getInitialParameters(workflow)
|
||||||
@@ -119,14 +119,14 @@ const constructCacheKeyValue = (
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
cacheKey = cacheKey.replace(`{{${name}}}`, value.toString());
|
codeKey = codeKey.replace(`{{${name}}}`, value.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cacheKey.includes("{") || cacheKey.includes("}")) {
|
if (codeKey.includes("{") || codeKey.includes("}")) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return cacheKey;
|
return codeKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
export { constructCacheKeyValue, getInitialParameters };
|
export { constructCacheKeyValue, getInitialParameters };
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ function ActionCard({ action, onClick, active, index }: Props) {
|
|||||||
</div>
|
</div>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent className="max-w-[250px]">
|
<TooltipContent className="max-w-[250px]">
|
||||||
Scripted Execution
|
Code Execution
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
|
|||||||
Reference in New Issue
Block a user