From 0243a902b2c36c7bf0af7d8ad71065654ec0b1c0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 6 Jul 2020 18:11:47 +0100 Subject: [PATCH] Fix up subflow port wiring --- .../@node-red/editor-client/src/js/ui/view.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 999c98587..10d47027d 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -2414,11 +2414,16 @@ RED.view = (function() { // This is not a virtualLink - which means it started // on a regular node port. Need to ensure the this isn't // connecting to a link node virual port. + // + // PORT_TYPE_OUTPUT=0 + // PORT_TYPE_INPUT=1 if (!( (d.type === "link out" && portType === PORT_TYPE_OUTPUT) || (d.type === "link in" && portType === PORT_TYPE_INPUT) || - (portType === PORT_TYPE_OUTPUT && mouseup_node.outputs === 0) || - (portType === PORT_TYPE_INPUT && mouseup_node.inputs === 0) + (portType === PORT_TYPE_OUTPUT && mouseup_node.type !== "subflow" && mouseup_node.outputs === 0) || + (portType === PORT_TYPE_INPUT && mouseup_node.type !== "subflow" && mouseup_node.inputs === 0) || + (drag_line.portType === PORT_TYPE_INPUT && mouseup_node.type === "subflow" && (mouseup_node.direction === "status" || mouseup_node.direction === "out")) || + (drag_line.portType === PORT_TYPE_OUTPUT && mouseup_node.type === "subflow" && mouseup_node.direction === "in") )) { var existingLink = RED.nodes.filterLinks({source:src,target:dst,sourcePort: src_port}).length !== 0; if (!existingLink) {