mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Fix adding users to history if multiple props modified
This commit is contained in:
parent
53e092e484
commit
ed4b98b598
@ -1534,6 +1534,7 @@ RED.editor = (function() {
|
|||||||
if (scope) {
|
if (scope) {
|
||||||
const newUsers = editing_config_node.users.filter(function (node) {
|
const newUsers = editing_config_node.users.filter(function (node) {
|
||||||
let keepNode = false;
|
let keepNode = false;
|
||||||
|
let nodeModified = null;
|
||||||
|
|
||||||
for (const d in node._def.defaults) {
|
for (const d in node._def.defaults) {
|
||||||
if (node._def.defaults.hasOwnProperty(d)) {
|
if (node._def.defaults.hasOwnProperty(d)) {
|
||||||
@ -1544,15 +1545,19 @@ RED.editor = (function() {
|
|||||||
// this config node in the correct scope.
|
// this config node in the correct scope.
|
||||||
keepNode = true;
|
keepNode = true;
|
||||||
} else {
|
} else {
|
||||||
historyEvents.push({
|
if (!nodeModified) {
|
||||||
|
nodeModified = {
|
||||||
t: "edit",
|
t: "edit",
|
||||||
node: node,
|
node: node,
|
||||||
changes: { [d]: node[d] },
|
changes: { [d]: node[d] },
|
||||||
changed: node.changed,
|
changed: node.changed,
|
||||||
dirty: node.dirty
|
dirty: node.dirty
|
||||||
});
|
};
|
||||||
|
} else {
|
||||||
|
nodeModified.changes[d] = node[d];
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the reference to the config
|
// Remove the reference to the config node
|
||||||
node[d] = "";
|
node[d] = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1560,6 +1565,11 @@ RED.editor = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add the node modified to the history
|
||||||
|
if (nodeModified) {
|
||||||
|
historyEvents.push(nodeModified);
|
||||||
|
}
|
||||||
|
|
||||||
// Mark as changed and revalidate this node
|
// Mark as changed and revalidate this node
|
||||||
if (!keepNode) {
|
if (!keepNode) {
|
||||||
node.changed = true;
|
node.changed = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user