mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge pull request #5054 from GogoVega/deployment-ignore-disabled
Ignore state of disabled nodes/flows during deployment
This commit is contained in:
commit
4723378f2f
@ -425,11 +425,15 @@ RED.deploy = (function() {
|
|||||||
const unknownNodes = [];
|
const unknownNodes = [];
|
||||||
const invalidNodes = [];
|
const invalidNodes = [];
|
||||||
|
|
||||||
|
const isDisabled = function (node) {
|
||||||
|
return (node.d || RED.nodes.workspace(node.z)?.disabled);
|
||||||
|
};
|
||||||
|
|
||||||
RED.nodes.eachConfig(function (node) {
|
RED.nodes.eachConfig(function (node) {
|
||||||
if (node.valid === undefined) {
|
if (node.valid === undefined) {
|
||||||
RED.editor.validateNode(node);
|
RED.editor.validateNode(node);
|
||||||
}
|
}
|
||||||
if (!node.valid && !node.d) {
|
if (!node.valid && !isDisabled(node)) {
|
||||||
invalidNodes.push(getNodeInfo(node));
|
invalidNodes.push(getNodeInfo(node));
|
||||||
}
|
}
|
||||||
if (node.type === "unknown") {
|
if (node.type === "unknown") {
|
||||||
@ -439,7 +443,7 @@ RED.deploy = (function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
RED.nodes.eachNode(function (node) {
|
RED.nodes.eachNode(function (node) {
|
||||||
if (!node.valid && !node.d) {
|
if (!node.valid && !isDisabled(node)) {
|
||||||
invalidNodes.push(getNodeInfo(node));
|
invalidNodes.push(getNodeInfo(node));
|
||||||
}
|
}
|
||||||
if (node.type === "unknown") {
|
if (node.type === "unknown") {
|
||||||
@ -453,7 +457,7 @@ RED.deploy = (function() {
|
|||||||
|
|
||||||
const unusedConfigNodes = [];
|
const unusedConfigNodes = [];
|
||||||
RED.nodes.eachConfig(function (node) {
|
RED.nodes.eachConfig(function (node) {
|
||||||
if ((node._def.hasUsers !== false) && (node.users.length === 0)) {
|
if ((node._def.hasUsers !== false) && (node.users.length === 0) && !isDisabled(node)) {
|
||||||
unusedConfigNodes.push(getNodeInfo(node));
|
unusedConfigNodes.push(getNodeInfo(node));
|
||||||
hasUnusedConfig = true;
|
hasUnusedConfig = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user