1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

[groups] Include group counts in copy/paste notifications

This commit is contained in:
Nick O'Leary 2020-03-26 15:22:59 +00:00
parent 7c91c4ae5a
commit 3e7f58dedd
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 14 additions and 1 deletions

View File

@ -178,6 +178,8 @@
"node_plural": "__count__ nodes",
"configNode": "__count__ configuration node",
"configNode_plural": "__count__ configuration nodes",
"group": "__count__ group",
"group_plural": "__count__ groups",
"flow": "__count__ flow",
"flow_plural": "__count__ flows",
"subflow": "__count__ subflow",
@ -193,6 +195,9 @@
"nodesImported": "Imported:",
"nodeCopied": "__count__ node copied",
"nodeCopied_plural": "__count__ nodes copied",
"groupCopied": "__count__ group copied",
"groupCopied_plural": "__count__ groups copied",
"groupStyleCopied": "Group style copied",
"invalidFlow": "Invalid flow: __message__",
"export": {
"selected":"selected nodes",

View File

@ -2073,7 +2073,11 @@ if (DEBUG_EVENTS) { console.warn("clearSelection", mouse_mode); }
}
}
clipboard = JSON.stringify(nns);
RED.notify(RED._("clipboard.nodeCopied",{count:nns.length}),{id:"clipboard"});
if (nodeCount > 0) {
RED.notify(RED._("clipboard.nodeCopied",{count:nodeCount}),{id:"clipboard"});
} else if (groupCount > 0) {
RED.notify(RED._("clipboard.groupCopied",{count:groupCount}),{id:"clipboard"});
}
}
}
@ -4307,12 +4311,16 @@ if (DEBUG_EVENTS) { console.warn("nodeMouseDown", mouse_mode,d); }
newConfigNodeCount++;
}
})
var newGroupCount = new_groups.length;
if (new_workspaces.length > 0) {
counts.push(RED._("clipboard.flow",{count:new_workspaces.length}));
}
if (newNodeCount > 0) {
counts.push(RED._("clipboard.node",{count:newNodeCount}));
}
if (newGroupCount > 0) {
counts.push(RED._("clipboard.group",{count:newGroupCount}));
}
if (newConfigNodeCount > 0) {
counts.push(RED._("clipboard.configNode",{count:newNodeCount}));
}