From 2d41823acdba609617bf307b8832279ac95cccd6 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 1 Sep 2022 16:24:54 +0200 Subject: [PATCH] Namespace workflowstate store --- client/src/components/Workflow/Editor/Index.vue | 6 +++--- client/src/components/Workflow/Editor/WorkflowGraph.vue | 6 +++--- client/src/store/index.js | 2 -- client/src/store/workflowEditorStateStore.js | 1 + 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client/src/components/Workflow/Editor/Index.vue b/client/src/components/Workflow/Editor/Index.vue index e846306be00..62d09986a8b 100644 --- a/client/src/components/Workflow/Editor/Index.vue +++ b/client/src/components/Workflow/Editor/Index.vue @@ -287,7 +287,7 @@ export default { return this.nodes[this.activeNodeId]; }, activeNodeId() { - return this.$store.getters.getActiveNode(); + return this.$store.getters["workflowState/getActiveNode"](); }, activeNodeName() { return this.activeNode?.name; @@ -463,7 +463,7 @@ export default { tool_state: JSON.parse(JSON.stringify(node.tool_state)), post_job_actions: JSON.parse(JSON.stringify(node.postJobActions)), }); - this.$store.commit("setActiveNode", newId); + this.$store.commit("workflowState/setActiveNode", newId); }, onInsertTool(tool_id, tool_name) { this._insertStep(tool_id, tool_name, "tool"); @@ -640,7 +640,7 @@ export default { content_id: contentId, type: type, }); - this.$store.commit("setActiveNode", this.nodeIndex); + this.$store.commit("workflowState/setActiveNode", this.nodeIndex); }, async _loadEditorData(data) { const report = data.report || {}; diff --git a/client/src/components/Workflow/Editor/WorkflowGraph.vue b/client/src/components/Workflow/Editor/WorkflowGraph.vue index f663fad5997..2396b68b3eb 100644 --- a/client/src/components/Workflow/Editor/WorkflowGraph.vue +++ b/client/src/components/Workflow/Editor/WorkflowGraph.vue @@ -120,12 +120,12 @@ export default { onActivate(nodeId) { console.log("onNodeId", nodeId); if (this.activeNodeId != nodeId) { - this.$store.commit("setActiveNode", nodeId); - this.canvasManager.drawOverview(); + this.$store.commit("workflowState/setActiveNode", nodeId); + // this.canvasManager.drawOverview(); } }, onDeactivate() { - this.$store.commit("setActiveNode", null); + this.$store.commit("workflowState/setActiveNode", null); }, onRemove(nodeId) { this.$emit("onRemove", nodeId); diff --git a/client/src/store/index.js b/client/src/store/index.js index 696a2f68dc5..6fa2a8b8727 100644 --- a/client/src/store/index.js +++ b/client/src/store/index.js @@ -19,7 +19,6 @@ import { collectionElementsStore, datasetStore, historyStore } from "./historySt import { userStore, userFlagsStore } from "./userStore"; import { configStore } from "./configStore"; import { workflowStateStore } from "./workflowEditorStateStore"; -import { workflowStore } from "./workflowStore"; import { toolStore } from "./toolStore"; import { datasetPathDestinationStore } from "./datasetPathDestinationStore"; import { datasetExtFilesStore } from "./datasetExtFilesStore"; @@ -73,7 +72,6 @@ export function createStore() { tools: toolStore, user: userStore, userFlags: userFlagsStore, - workflows: workflowStore, workflowState: workflowStateStore, }, }; diff --git a/client/src/store/workflowEditorStateStore.js b/client/src/store/workflowEditorStateStore.js index ff9c95aa972..ec72f503f7a 100644 --- a/client/src/store/workflowEditorStateStore.js +++ b/client/src/store/workflowEditorStateStore.js @@ -40,6 +40,7 @@ const mutations = { }; export const workflowStateStore = { + namespaced: true, state, getters, actions,