mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #3816 from node-red/import-junction-fix
Include junctions/groups when exporting subflows plus related fixes
This commit is contained in:
commit
d53cd209f7
@ -868,14 +868,7 @@ RED.nodes = (function() {
|
||||
var node;
|
||||
|
||||
if (allNodes.hasTab(id)) {
|
||||
removedNodes = allNodes.getNodes(id).filter(n => {
|
||||
if (n.type === 'junction') {
|
||||
removedJunctions.push(n)
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
})
|
||||
removedNodes = allNodes.getNodes(id).slice()
|
||||
}
|
||||
for (i in configNodes) {
|
||||
if (configNodes.hasOwnProperty(i)) {
|
||||
@ -885,6 +878,7 @@ RED.nodes = (function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
removedJunctions = RED.nodes.junctions(id)
|
||||
|
||||
for (i=0;i<removedNodes.length;i++) {
|
||||
var result = removeNode(removedNodes[i].id);
|
||||
@ -1331,7 +1325,6 @@ RED.nodes = (function() {
|
||||
} else {
|
||||
nodeSet = [sf];
|
||||
}
|
||||
console.log(nodeSet);
|
||||
return createExportableNodeSet(nodeSet);
|
||||
}
|
||||
/**
|
||||
@ -1367,6 +1360,10 @@ RED.nodes = (function() {
|
||||
exportedConfigNodes[n.id] = true;
|
||||
}
|
||||
});
|
||||
|
||||
subflowSet = subflowSet.concat(RED.nodes.junctions(subflowId))
|
||||
subflowSet = subflowSet.concat(RED.nodes.groups(subflowId))
|
||||
|
||||
var exportableSubflow = createExportableNodeSet(subflowSet, exportedIds, exportedSubflows, exportedConfigNodes);
|
||||
nns = exportableSubflow.concat(nns);
|
||||
}
|
||||
|
@ -506,6 +506,13 @@ RED.subflow = (function() {
|
||||
RED.nodes.groups(id).forEach(function(n) {
|
||||
removedGroups.push(n);
|
||||
})
|
||||
|
||||
var removedJunctions = RED.nodes.junctions(id)
|
||||
for (var i=0;i<removedJunctions.length;i++) {
|
||||
var removedEntities = RED.nodes.removeJunction(removedJunctions[i])
|
||||
removedLinks = removedLinks.concat(removedEntities.links)
|
||||
}
|
||||
|
||||
var removedConfigNodes = [];
|
||||
for (var i=0;i<removedNodes.length;i++) {
|
||||
var removedEntities = RED.nodes.remove(removedNodes[i].id);
|
||||
@ -536,6 +543,7 @@ RED.subflow = (function() {
|
||||
nodes:removedNodes,
|
||||
links:removedLinks,
|
||||
groups: removedGroups,
|
||||
junctions: removedJunctions,
|
||||
subflows: [activeSubflow]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user