From fa5a0db4c87d52c0452371279f4965c54670d60a Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 25 Apr 2022 18:33:44 +0200 Subject: [PATCH 1/9] :sparkles: Introduce simple node versioning --- packages/cli/src/CredentialsHelper.ts | 6 +++- packages/core/src/NodeExecuteFunctions.ts | 1 + .../src/components/CollectionParameter.vue | 6 +++- .../CredentialEdit/CredentialEdit.vue | 2 ++ .../src/components/NodeCredentials.vue | 2 +- .../editor-ui/src/components/NodeSettings.vue | 4 +-- .../src/components/ParameterInput.vue | 2 +- .../src/components/ParameterInputList.vue | 11 ++++--- .../src/components/mixins/nodeHelpers.ts | 6 ++-- .../src/components/mixins/workflowHelpers.ts | 4 +-- packages/editor-ui/src/store.ts | 8 +++-- packages/editor-ui/src/views/NodeView.vue | 13 +++++--- packages/nodes-base/nodes/Set/Set.node.ts | 30 ++++++++++++++++++- packages/workflow/src/Interfaces.ts | 2 +- packages/workflow/src/NodeHelpers.ts | 28 +++++++++++++---- packages/workflow/src/RoutingNode.ts | 9 +++++- packages/workflow/src/Workflow.ts | 1 + packages/workflow/test/NodeHelpers.test.ts | 4 +++ 18 files changed, 109 insertions(+), 30 deletions(-) diff --git a/packages/cli/src/CredentialsHelper.ts b/packages/cli/src/CredentialsHelper.ts index c4278aaa6aa92..d65b59dbcb3f2 100644 --- a/packages/cli/src/CredentialsHelper.ts +++ b/packages/cli/src/CredentialsHelper.ts @@ -342,6 +342,7 @@ export class CredentialsHelper extends ICredentialsHelper { decryptedDataOriginal as INodeParameters, true, false, + null, ) as ICredentialDataDecryptedObject; if (decryptedDataOriginal.oauthTokenData !== undefined) { @@ -562,7 +563,10 @@ export class CredentialsHelper extends ICredentialsHelper { parameters: {}, name: 'Temp-Node', type: nodeType.description.name, - typeVersion: nodeType.description.version, + // TODO: What it should really do is to get the version from UI + typeVersion: Array.isArray(nodeType.description.version) + ? nodeType.description.version.slice(-1)[0] + : nodeType.description.version, position: [0, 0], }; diff --git a/packages/core/src/NodeExecuteFunctions.ts b/packages/core/src/NodeExecuteFunctions.ts index 6dc23ed38e057..e8038b757255c 100644 --- a/packages/core/src/NodeExecuteFunctions.ts +++ b/packages/core/src/NodeExecuteFunctions.ts @@ -1298,6 +1298,7 @@ export async function getCredentials( !NodeHelpers.displayParameter( additionalData.currentNodeParameters || node.parameters, nodeCredentialDescription, + node, node.parameters, ) ) { diff --git a/packages/editor-ui/src/components/CollectionParameter.vue b/packages/editor-ui/src/components/CollectionParameter.vue index ae2dcbd2baf6d..b93e15987c41d 100644 --- a/packages/editor-ui/src/components/CollectionParameter.vue +++ b/packages/editor-ui/src/components/CollectionParameter.vue @@ -32,6 +32,7 @@