feat(core): Introduce simplified node versioning (#3205)

*  Introduce simple node versioning

*  Add example how to read version in node-code for custom logic

* 🐛 Fix setting of parameters

* 🐛 Fix another instance where it sets the wrong parameter

*  Remove unnecessary TOODs

*  Revert Set Node example changes

* ;rotating_light: Add test
This commit is contained in:
Jan Oberhauser
2022-04-28 19:04:09 +02:00
committed by GitHub
parent 5e2589e626
commit d5b9b0cb95
19 changed files with 277 additions and 31 deletions

View File

@@ -48,8 +48,8 @@ export const nodeHelpers = mixins(
},
// Returns if the given parameter should be displayed or not
displayParameter (nodeValues: INodeParameters, parameter: INodeProperties | INodeCredentialDescription, path: string) {
return NodeHelpers.displayParameterPath(nodeValues, parameter, path);
displayParameter (nodeValues: INodeParameters, parameter: INodeProperties | INodeCredentialDescription, path: string, node: INodeUi | null) {
return NodeHelpers.displayParameterPath(nodeValues, parameter, path, node);
},
// Returns all the issues of the node
@@ -200,7 +200,7 @@ export const nodeHelpers = mixins(
let selectedCredentials: INodeCredentialsDetails;
for (const credentialTypeDescription of nodeType!.credentials!) {
// Check if credentials should be displayed else ignore
if (this.displayParameter(node.parameters, credentialTypeDescription, '') !== true) {
if (this.displayParameter(node.parameters, credentialTypeDescription, '', node) !== true) {
continue;
}

View File

@@ -323,7 +323,7 @@ export const workflowHelpers = mixins(
if (nodeType !== null) {
// Node-Type is known so we can save the parameters correctly
const nodeParameters = NodeHelpers.getNodeParameters(nodeType.properties, node.parameters, false, false);
const nodeParameters = NodeHelpers.getNodeParameters(nodeType.properties, node.parameters, false, false, node);
nodeData.parameters = nodeParameters !== null ? nodeParameters : {};
// Add the node credentials if there are some set and if they should be displayed
@@ -338,7 +338,7 @@ export const workflowHelpers = mixins(
continue;
}
if (this.displayParameter(node.parameters, credentialTypeDescription, '') === false) {
if (this.displayParameter(node.parameters, credentialTypeDescription, '', node) === false) {
// Credential should not be displayed so do also not save
continue;
}