refactor(editor): create ndv store (#4409)

* refactor ndv module out

* update active node in root state

* simplify

* fix conflict

* fix dragging
This commit is contained in:
Mutasem Aldmour
2022-10-24 11:35:03 +02:00
committed by GitHub
parent f6733cff9d
commit 127f988400
38 changed files with 331 additions and 308 deletions

View File

@@ -327,7 +327,7 @@ export default mixins(
},
...mapGetters(['nativelyNumberSuffixedDefaults']),
activeNode(): INodeUi | null {
return this.$store.getters.activeNode;
return this.$store.getters['ndv/activeNode'];
},
executionWaitingForWebhook(): boolean {
return this.$store.getters.executionWaitingForWebhook;
@@ -817,7 +817,7 @@ export default mixins(
this.createNodeActive = false;
if (this.activeNode) {
this.$externalHooks().run('dataDisplay.nodeEditingFinished');
this.$store.commit('setActiveNode', null);
this.$store.commit('ndv/setActiveNodeName', null);
}
return;
@@ -904,7 +904,7 @@ export default mixins(
if (lastSelectedNode.type === STICKY_NODE_TYPE && this.isReadOnly) {
return;
}
this.$store.commit('setActiveNode', lastSelectedNode.name);
this.$store.commit('ndv/setActiveNodeName', lastSelectedNode.name);
}
} else if (e.key === 'ArrowRight' && e.shiftKey === true) {
// Select all downstream nodes
@@ -1510,7 +1510,7 @@ export default mixins(
this.newNodeInsertPosition = null;
if (setActive === true) {
this.$store.commit('setActiveNode', node.name);
this.$store.commit('ndv/setActiveNodeName', node.name);
}
},
showMaxNodeTypeError(nodeTypeData: INodeTypeDescription) {
@@ -2694,7 +2694,7 @@ export default mixins(
this.nodeSelectedByName(newName);
if (isActive) {
this.$store.commit('setActiveNode', newName);
this.$store.commit('ndv/setActiveNodeName', newName);
this.renamingActive = false;
}
},