fix(editor): Fix unique names for node duplication (#6134)

* 🐛 Fix unique names for node duplication

* 🐛 Fix i18n references
This commit is contained in:
Iván Ovejero
2023-04-28 15:53:59 +02:00
committed by GitHub
parent 20a72bb28b
commit 71ae6c66ef
9 changed files with 227 additions and 102 deletions

View File

@@ -204,6 +204,12 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
allNodes(): INodeUi[] {
return this.workflow.nodes;
},
/**
* Names of all nodes currently on canvas.
*/
canvasNames(): Set<string> {
return new Set(this.allNodes.map((n) => n.name));
},
nodesByName(): { [name: string]: INodeUi } {
return this.workflow.nodes.reduce((accu: { [name: string]: INodeUi }, node) => {
accu[node.name] = node;