Fix node-versioning issues in editor-UI

This commit is contained in:
Jan Oberhauser
2022-02-05 12:57:48 +01:00
parent c7e73d757a
commit ff74feefe4
10 changed files with 15 additions and 15 deletions

View File

@@ -79,7 +79,7 @@ export default Vue.extend({
const trigger = foundTriggers[0];
const triggerNodeType = this.$store.getters.nodeType(trigger.type);
const triggerNodeType = this.$store.getters.nodeType(trigger.type, trigger.typeVersion);
if (triggerNodeType.activationMessage) {
return triggerNodeType.activationMessage;
}

View File

@@ -85,7 +85,7 @@ export default mixins(externalHooks, nodeHelpers, workflowHelpers).extend({
},
nodeType (): INodeTypeDescription | null {
if (this.node) {
return this.$store.getters.nodeType(this.node.type);
return this.$store.getters.nodeType(this.node.type, this.node.typeVersion);
}
return null;
},

View File

@@ -145,7 +145,7 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, workflowHelpers).ext
},
isSingleActiveTriggerNode (): boolean {
const nodes = this.$store.getters.workflowTriggerNodes.filter((node: INodeUi) => {
const nodeType = this.$store.getters.nodeType(node.type) as INodeTypeDescription | null;
const nodeType = this.$store.getters.nodeType(node.type, node.typeVersion) as INodeTypeDescription | null;
return nodeType && nodeType.eventTriggerDescription !== '' && !node.disabled;
});
@@ -161,7 +161,7 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, workflowHelpers).ext
return this.node && this.node.disabled;
},
nodeType (): INodeTypeDescription | null {
return this.data && this.$store.getters.nodeType(this.data.type);
return this.data && this.$store.getters.nodeType(this.data.type, this.data.typeVersion);
},
node (): INodeUi | undefined { // same as this.data but reactive..
return this.$store.getters.nodesByName[this.name] as INodeUi | undefined;

View File

@@ -106,7 +106,7 @@ export default mixins(
credentialTypesNodeDescription (): INodeCredentialDescription[] {
const node = this.node as INodeUi;
const activeNodeType = this.$store.getters.nodeType(node.type) as INodeTypeDescription | null;
const activeNodeType = this.$store.getters.nodeType(node.type, node.typeVersion) as INodeTypeDescription | null;
if (activeNodeType && activeNodeType.credentials) {
return activeNodeType.credentials;
}

View File

@@ -364,7 +364,7 @@ export default mixins(
} else if (parameterData.name.startsWith('parameters.')) {
// A node parameter changed
const nodeType = this.$store.getters.nodeType(node.type) as INodeTypeDescription | null;
const nodeType = this.$store.getters.nodeType(node.type, node.typeVersion) as INodeTypeDescription | null;
if (!nodeType) {
return;
}

View File

@@ -540,7 +540,7 @@ export default mixins(
return outputIndex + 1;
}
const nodeType = this.$store.getters.nodeType(this.node.type) as INodeTypeDescription | null;
const nodeType = this.$store.getters.nodeType(this.node.type, this.node.typeVersion) as INodeTypeDescription | null;
if (!nodeType || !nodeType.outputNames || nodeType.outputNames.length <= outputIndex) {
return outputIndex + 1;
}

View File

@@ -279,7 +279,7 @@ export const nodeBase = mixins(
});
},
__addNode (node: INodeUi) {
let nodeTypeData = this.$store.getters.nodeType(node.type) as INodeTypeDescription | null;
let nodeTypeData = this.$store.getters.nodeType(node.type, node.typeVersion) as INodeTypeDescription | null;
if (!nodeTypeData) {
// If node type is not know use by default the base.noOp data to display it
nodeTypeData = this.$store.getters.nodeType(NO_OP_NODE_TYPE) as INodeTypeDescription;

View File

@@ -148,7 +148,7 @@ export const nodeHelpers = mixins(
// Updates the parameter-issues of the node
updateNodeParameterIssues(node: INodeUi, nodeType?: INodeTypeDescription): void {
if (nodeType === undefined) {
nodeType = this.$store.getters.nodeType(node.type);
nodeType = this.$store.getters.nodeType(node.type, node.typeVersion);
}
if (nodeType === null) {
@@ -179,7 +179,7 @@ export const nodeHelpers = mixins(
}
if (nodeType === undefined) {
nodeType = this.$store.getters.nodeType(node.type);
nodeType = this.$store.getters.nodeType(node.type, node.typeVersion);
}
if (nodeType === null || nodeType!.credentials === undefined) {