From 571a5a04e5795ec9a7589f6ed3f003ae82dc46f3 Mon Sep 17 00:00:00 2001 From: Nikhil-Doye Date: Mon, 27 Oct 2025 14:56:56 -0400 Subject: [PATCH] Add test input configuration feature to ExecutionPanel - Introduced TestInputConfigurator component for configuring test inputs in workflows. - Enhanced ExecutionPanel to include a button for opening the test input configuration modal. - Integrated test input management logic using the new TestInputManager service to handle input mappings and validation. - Updated workflow execution logic to apply test inputs based on user configuration, improving flexibility and usability in testing scenarios. --- src/components/ExecutionPanel.tsx | 41 +++ src/components/TestInputConfigurator.tsx | 344 +++++++++++++++++++++++ src/services/testInputManager.ts | 303 ++++++++++++++++++++ src/store/workflowStore.ts | 38 ++- 4 files changed, 705 insertions(+), 21 deletions(-) create mode 100644 src/components/TestInputConfigurator.tsx create mode 100644 src/services/testInputManager.ts diff --git a/src/components/ExecutionPanel.tsx b/src/components/ExecutionPanel.tsx index 61a6da1..0c13779 100644 --- a/src/components/ExecutionPanel.tsx +++ b/src/components/ExecutionPanel.tsx @@ -1,7 +1,12 @@ import React from "react"; +import { TestInputConfigurator } from "./TestInputConfigurator"; import { useWorkflowStore } from "../store/workflowStore"; import { ExecutionConfiguration } from "./ExecutionConfiguration"; import { ExecutionPlanPreview } from "./ExecutionPlanPreview"; +import { + testInputManager, + TestInputConfig, +} from "../services/testInputManager"; import { Zap, Play, @@ -19,6 +24,9 @@ import { BarChart3, Layers, GitBranch, + Zap as TestIcon, + Trash2, + X, } from "lucide-react"; export const ExecutionPanel: React.FC = () => { @@ -41,6 +49,9 @@ export const ExecutionPanel: React.FC = () => { const [showStats, setShowStats] = React.useState(false); const [showConfig, setShowConfig] = React.useState(false); const [showPlanPreview, setShowPlanPreview] = React.useState(false); + const [showTestInputConfig, setShowTestInputConfig] = React.useState(false); + const [testInputConfig, setTestInputConfig] = + React.useState(null); const handleExecute = async () => { if (isExecuting) { @@ -51,6 +62,8 @@ export const ExecutionPanel: React.FC = () => { if (!currentWorkflow) return; try { + // For now, execute without test input + // In a future enhancement, you could pass the testInputConfig here await executeWorkflow(); } catch (error) { console.error("Execution failed:", error); @@ -278,6 +291,13 @@ export const ExecutionPanel: React.FC = () => { > + + {/* Test Input Configuration Button */} + + + + + {/* Content */} +
+ {dataInputNodes.length === 0 ? ( +
+ +
+

+ No Input Nodes +

+

+ Add a Data Input node to your workflow to configure test + inputs +

+
+
+ ) : ( + <> + {/* Mode Selection */} +
+ +
+ {["single", "multiple", "auto"].map((m) => ( + + ))} +
+

+ {mode === "single" && "Configure one primary input node"} + {mode === "multiple" && + "Map test data to each input node individually"} + {mode === "auto" && + "Same test data applied to all input nodes"} +

+
+ + {/* Input Configuration */} + {mode === "auto" && ( +
+ +