mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge branch 'master' into sync-dev
This commit is contained in:
commit
3a91fc17fd
@ -2406,6 +2406,13 @@ RED.nodes = (function() {
|
|||||||
} else {
|
} else {
|
||||||
delete n.g
|
delete n.g
|
||||||
}
|
}
|
||||||
|
// If importing into a subflow, ensure an outbound-link doesn't get added
|
||||||
|
if (activeSubflow && /^link /.test(n.type) && n.links) {
|
||||||
|
n.links = n.links.filter(function(id) {
|
||||||
|
const otherNode = node_map[id] || RED.nodes.node(id);
|
||||||
|
return (otherNode && otherNode.z === activeWorkspace);
|
||||||
|
});
|
||||||
|
}
|
||||||
for (var d3 in n._def.defaults) {
|
for (var d3 in n._def.defaults) {
|
||||||
if (n._def.defaults.hasOwnProperty(d3)) {
|
if (n._def.defaults.hasOwnProperty(d3)) {
|
||||||
if (n._def.defaults[d3].type) {
|
if (n._def.defaults[d3].type) {
|
||||||
@ -2429,14 +2436,6 @@ RED.nodes = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If importing into a subflow, ensure an outbound-link doesn't
|
|
||||||
// get added
|
|
||||||
if (activeSubflow && /^link /.test(n.type) && n.links) {
|
|
||||||
n.links = n.links.filter(function(id) {
|
|
||||||
const otherNode = node_map[id] || RED.nodes.node(id);
|
|
||||||
return (otherNode && otherNode.z === activeWorkspace)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (i=0;i<new_subflows.length;i++) {
|
for (i=0;i<new_subflows.length;i++) {
|
||||||
n = new_subflows[i];
|
n = new_subflows[i];
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
const flowUtil = require("./util");
|
const flowUtil = require("./util");
|
||||||
const credentials = require("../nodes/credentials");
|
const credentials = require("../nodes/credentials");
|
||||||
|
const clone = require("clone");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a group within the runtime.
|
* This class represents a group within the runtime.
|
||||||
|
@ -462,9 +462,8 @@ function stop(type,diff,muteLog,isDeploy) {
|
|||||||
if (type === 'nodes') {
|
if (type === 'nodes') {
|
||||||
stopList = diff.changed.concat(diff.removed);
|
stopList = diff.changed.concat(diff.removed);
|
||||||
} else if (type === 'flows') {
|
} else if (type === 'flows') {
|
||||||
stopList = diff.changed.concat(diff.removed).concat(diff.linked);
|
stopList = diff.changed.concat(diff.removed).concat(diff.linked).concat(diff.rewired);
|
||||||
}
|
}
|
||||||
|
|
||||||
events.emit("flows:stopping",{config: activeConfig, type: type, diff: diff})
|
events.emit("flows:stopping",{config: activeConfig, type: type, diff: diff})
|
||||||
|
|
||||||
// Stop the global flow object last
|
// Stop the global flow object last
|
||||||
|
@ -16,6 +16,31 @@ describe('Group', function () {
|
|||||||
group.getSetting("NR_GROUP_NAME").should.equal("g1")
|
group.getSetting("NR_GROUP_NAME").should.equal("g1")
|
||||||
group.getSetting("NR_GROUP_ID").should.equal("group1")
|
group.getSetting("NR_GROUP_ID").should.equal("group1")
|
||||||
})
|
})
|
||||||
|
it("returns cloned env var property", async function () {
|
||||||
|
const group = new Group({
|
||||||
|
getSetting: v => v+v
|
||||||
|
}, {
|
||||||
|
name: "g1",
|
||||||
|
id: "group1",
|
||||||
|
env: [
|
||||||
|
{
|
||||||
|
name: 'jsonEnvVar',
|
||||||
|
type: 'json',
|
||||||
|
value: '{"a":1}'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
await group.start()
|
||||||
|
const result = group.getSetting('jsonEnvVar')
|
||||||
|
result.should.have.property('a', 1)
|
||||||
|
result.a = 2
|
||||||
|
result.b = 'hello'
|
||||||
|
|
||||||
|
const result2 = group.getSetting('jsonEnvVar')
|
||||||
|
result2.should.have.property('a', 1)
|
||||||
|
result2.should.not.have.property('b')
|
||||||
|
|
||||||
|
})
|
||||||
it("delegates to parent if not found", async function () {
|
it("delegates to parent if not found", async function () {
|
||||||
const group = new Group({
|
const group = new Group({
|
||||||
getSetting: v => v+v
|
getSetting: v => v+v
|
||||||
|
Loading…
x
Reference in New Issue
Block a user