mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat(editor): Supress validation errors for freshly added nodes (#5149)
* feat(editor): Supress validation errors when node is added from node creator * Supress initial errors also for resource locator inputs * Use nodeMetadata prop to store node's `pristine` state * Revert `setNodeParameters` check for `nodeMetadata` * Rename getIsNodePristine to isNodePristine
This commit is contained in:
@@ -227,6 +227,10 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
this.nodeMetadata[nodeName] && this.nodeMetadata[nodeName].parametersLastUpdatedAt;
|
||||
},
|
||||
|
||||
isNodePristine(): (name: string) => boolean {
|
||||
return (nodeName: string) =>
|
||||
this.nodeMetadata[nodeName] === undefined || this.nodeMetadata[nodeName].pristine === true;
|
||||
},
|
||||
// Executions getters
|
||||
getExecutionDataById(): (id: string) => IExecutionsSummary | undefined {
|
||||
return (id: string): IExecutionsSummary | undefined =>
|
||||
@@ -731,7 +735,12 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
// TODO: Check if there is an error or whatever that is supposed to be returned
|
||||
return;
|
||||
}
|
||||
|
||||
this.workflow.nodes.push(nodeData);
|
||||
// Init node metadata
|
||||
if (!this.nodeMetadata[nodeData.name]) {
|
||||
Vue.set(this.nodeMetadata, nodeData.name, {});
|
||||
}
|
||||
},
|
||||
|
||||
removeNode(node: INodeUi): void {
|
||||
@@ -821,6 +830,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
if (!this.nodeMetadata[node.name]) {
|
||||
Vue.set(this.nodeMetadata, node.name, {});
|
||||
}
|
||||
|
||||
Vue.set(this.nodeMetadata[node.name], 'parametersLastUpdatedAt', Date.now());
|
||||
},
|
||||
|
||||
@@ -960,5 +970,8 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
}
|
||||
});
|
||||
},
|
||||
setNodePristine(nodeName: string, isPristine: boolean): void {
|
||||
Vue.set(this.nodeMetadata[nodeName], 'pristine', isPristine);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user