added parameter picker to conditional block (#4326)
This commit is contained in:
@@ -14,7 +14,6 @@ import {
|
|||||||
import type { Node } from "@xyflow/react";
|
import type { Node } from "@xyflow/react";
|
||||||
|
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Input } from "@/components/ui/input";
|
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
@@ -39,6 +38,7 @@ import {
|
|||||||
} from "./types";
|
} from "./types";
|
||||||
import type { BranchCondition } from "../../../types/workflowTypes";
|
import type { BranchCondition } from "../../../types/workflowTypes";
|
||||||
import { HelpTooltip } from "@/components/HelpTooltip";
|
import { HelpTooltip } from "@/components/HelpTooltip";
|
||||||
|
import { WorkflowBlockInput } from "@/components/WorkflowBlockInput";
|
||||||
|
|
||||||
function ConditionalNodeComponent({ id, data }: NodeProps<ConditionalNode>) {
|
function ConditionalNodeComponent({ id, data }: NodeProps<ConditionalNode>) {
|
||||||
const nodes = useNodes<AppNode>();
|
const nodes = useNodes<AppNode>();
|
||||||
@@ -686,15 +686,16 @@ function ConditionalNodeComponent({ id, data }: NodeProps<ConditionalNode>) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Input
|
<WorkflowBlockInput
|
||||||
|
nodeId={id}
|
||||||
value={
|
value={
|
||||||
activeBranch.is_default
|
activeBranch.is_default
|
||||||
? "Executed when no other condition matches"
|
? "Executed when no other condition matches"
|
||||||
: activeBranch.criteria?.expression ?? ""
|
: activeBranch.criteria?.expression ?? ""
|
||||||
}
|
}
|
||||||
disabled={!data.editable || activeBranch.is_default}
|
disabled={!data.editable || activeBranch.is_default}
|
||||||
onChange={(event) => {
|
onChange={(value) => {
|
||||||
handleExpressionChange(event.target.value);
|
handleExpressionChange(value);
|
||||||
}}
|
}}
|
||||||
placeholder="Enter condition to evaluate (Jinja or natural language)"
|
placeholder="Enter condition to evaluate (Jinja or natural language)"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user