From 44aa1f4a5e4181a2a3eb4380fbb6462ff5f19907 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 13 Oct 2021 14:23:43 +0100 Subject: [PATCH] Filter out Link Out Return nodes in Link In edit dialog Fixes #3187 --- .../@node-red/nodes/core/common/60-link.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/nodes/core/common/60-link.html b/packages/node_modules/@node-red/nodes/core/common/60-link.html index 05fa8b429..9408b5561 100644 --- a/packages/node_modules/@node-red/nodes/core/common/60-link.html +++ b/packages/node_modules/@node-red/nodes/core/common/60-link.html @@ -68,6 +68,8 @@ } }); var candidateNodes = RED.nodes.filterNodes({type:targetType}); + var candidateNodesCount = 0; + var search = $("#node-input-link-target-filter").searchBox({ style: "compact", delay: 300, @@ -80,7 +82,7 @@ var count = treeList.treeList("filter", function(item) { return item.label.toLowerCase().indexOf(val) > -1 || (item.node && item.node.type.toLowerCase().indexOf(val) > -1) }); - search.searchBox("count",count+" / "+candidateNodes.length); + search.searchBox("count",count+" / "+candidateNodesCount); } } }); @@ -113,6 +115,11 @@ candidateNodes.forEach(function(n) { if (flowMap[n.z]) { + if (targetType === "link out" && n.mode === 'return') { + // Link In nodes looking for Link Out nodes should not + // include return-mode nodes. + return + } var isChecked = false; isChecked = (node.links.indexOf(n.id) !== -1) || (n.links||[]).indexOf(node.id) !== -1; if (isChecked) { @@ -126,6 +133,7 @@ checkbox: node.type !== "link call", radio: node.type === "link call" }) + candidateNodesCount++; } }); flows = flows.filter(function(f) { return f.children.length > 0 })