Ver código fonte

Merge branch 'configurator-standalone'

fszontagh 1 mês atrás
pai
commit
83b99b35cc

+ 18 - 0
tests/nodes/configurator-standalone.json

@@ -0,0 +1,18 @@
+{
+  "name": "diag-configurator-standalone",
+  "nodes": [
+    {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
+    {"id": "cfg", "name": "Standalone", "type": "configurator", "position": {"x": -250, "y": 150},
+     "config": {"settings": [{"name": "message", "value": "from a standalone configurator"}, {"name": "mode", "value": "stop"}]}},
+    {"id": "target", "name": "Target", "type": "stop-and-error", "position": {"x": 0, "y": 200},
+     "config": {"message": "own value", "mode": "error"}}
+  ],
+  "connections": [
+    {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "target", "targetInput": "data"},
+    {"sourceNodeId": "cfg", "sourceOutput": "main", "targetNodeId": "target", "targetInput": "config"}
+  ],
+  "expectStatus": "completed",
+  "expect": {
+    "target": {"status": "completed", "output": {"stopped": true, "reason": "from a standalone configurator"}}
+  }
+}

+ 7 - 5
webui/src/components/workflow/WorkflowNode.tsx

@@ -62,10 +62,12 @@ export function WorkflowNode({ data, selected }: NodeProps) {
 
 
   // Get loop info for loop nodes
   // Get loop info for loop nodes
   const isLoopNode = data.type === 'loop'
   const isLoopNode = data.type === 'loop'
-  // A Configurator supplies settings; it does not receive them, so it gets no
-  // config input of its own. Its output goes out the right-hand side to meet
-  // the config input on the left of the node it feeds, rather than dropping out
-  // of the bottom into the data flow it is not part of.
+  // A Configurator stands on its own. It has no inputs at all: not a config
+  // input, because it supplies settings rather than receiving them, and not a
+  // data input, because it is not part of the flow - the node it feeds reads
+  // from it when that node runs. Its output leaves from the right-hand side to
+  // meet the config input on the left of its target, rather than dropping out
+  // of the bottom into a data flow it has nothing to do with.
   const isConfigurator = data.type === 'configurator'
   const isConfigurator = data.type === 'configurator'
   const loopInfo = isLoopNode && execState?.output ? {
   const loopInfo = isLoopNode && execState?.output ? {
     currentIndex: execState.output.currentIndex,
     currentIndex: execState.output.currentIndex,
@@ -125,7 +127,7 @@ export function WorkflowNode({ data, selected }: NodeProps) {
     >
     >
       {/* Input handles at top (not for triggers). A node that names more than
       {/* Input handles at top (not for triggers). A node that names more than
           one input gets a handle each, spread the way outputs are. */}
           one input gets a handle each, spread the way outputs are. */}
-      {!isTrigger && inputs.map((input, idx) => (
+      {!isTrigger && !isConfigurator && inputs.map((input, idx) => (
         <Handle
         <Handle
           key={input.name}
           key={input.name}
           type="target"
           type="target"