From 87c9a1c06c215c7936fc5fc42e3282fae620306a Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 1 Jul 2021 21:40:57 +0100 Subject: [PATCH] Include hasUser=false config nodes when exporting whole flow (#3048) --- .../@node-red/editor-client/src/js/ui/clipboard.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js index de2c8d721..485b43d98 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js @@ -701,6 +701,13 @@ RED.clipboard = (function() { var activeWorkspace = RED.workspaces.active(); nodes = RED.nodes.groups(activeWorkspace); nodes = nodes.concat(RED.nodes.filterNodes({z:activeWorkspace})); + RED.nodes.eachConfig(function(n) { + if (n.z === RED.workspaces.active() && n._def.hasUsers === false) { + // Grab any config nodes scoped to this flow that don't + // require any flow-nodes to use them + nodes.push(n); + } + }); var parentNode = RED.nodes.workspace(activeWorkspace)||RED.nodes.subflow(activeWorkspace); nodes.unshift(parentNode); nodes = RED.nodes.createExportableNodeSet(nodes);