mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
2 Commits
subflow-ne
...
quick-add-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37524e05bb | ||
|
|
3fbfd47089 |
@@ -1455,9 +1455,6 @@ RED.view = (function() {
|
||||
// auto select dropped node - so info shows (if visible)
|
||||
clearSelection();
|
||||
nn.selected = true;
|
||||
if (targetGroup) {
|
||||
selectGroup(targetGroup,false);
|
||||
}
|
||||
movingSet.add(nn);
|
||||
updateActiveNodes();
|
||||
updateSelection();
|
||||
@@ -1905,6 +1902,7 @@ RED.view = (function() {
|
||||
}
|
||||
showQuickAddDialog({ position: point, group: clickedGroup });
|
||||
}
|
||||
|
||||
hideDragLines();
|
||||
}
|
||||
if (lasso) {
|
||||
|
||||
@@ -474,7 +474,7 @@ class Subflow extends Flow {
|
||||
*/
|
||||
function createNodeInSubflow(subflowInstanceId, def) {
|
||||
let node = clone(def);
|
||||
let nid = `${subflowInstanceId}-${node.id}` //redUtil.generateId();
|
||||
let nid = redUtil.generateId();
|
||||
// console.log("Create Node In subflow",node._alias, "--->",nid, "(",node.type,")")
|
||||
// node_map[node.id] = node;
|
||||
node._alias = node.id;
|
||||
|
||||
@@ -589,28 +589,17 @@ function deleteContext(id,flowId) {
|
||||
* If flowConfig is undefined, all flow/node contexts will be removed
|
||||
**/
|
||||
function clean(flowConfig) {
|
||||
flowConfig = flowConfig || { allNodes: {}, subflows: {} };
|
||||
const knownNodes = new Set(Object.keys(flowConfig.allNodes))
|
||||
|
||||
// We need to alias all of the subflow instance contents
|
||||
for (const subflow of Object.values(flowConfig.subflows || {})) {
|
||||
subflow.instances.forEach(instance => {
|
||||
for (const nodeId of Object.keys(subflow.nodes || {})) {
|
||||
knownNodes.add(`${instance.id}-${nodeId}`)
|
||||
}
|
||||
for (const nodeId of Object.keys(subflow.configs || {})) {
|
||||
knownNodes.add(`${instance.id}-${nodeId}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
flowConfig = flowConfig || { allNodes: {} };
|
||||
var promises = [];
|
||||
for (const store of Object.values(stores)){
|
||||
promises.push(store.clean(Array.from(knownNodes)));
|
||||
for(var plugin in stores){
|
||||
if(stores.hasOwnProperty(plugin)){
|
||||
promises.push(stores[plugin].clean(Object.keys(flowConfig.allNodes)));
|
||||
}
|
||||
}
|
||||
for (const id of Object.keys(contexts)) {
|
||||
if (id !== "global") {
|
||||
for (var id in contexts) {
|
||||
if (contexts.hasOwnProperty(id) && id !== "global") {
|
||||
var idParts = id.split(":");
|
||||
if (!knownNodes.has(idParts[0])) {
|
||||
if (!flowConfig.allNodes.hasOwnProperty(idParts[0])) {
|
||||
delete contexts[id];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user