From 10acbecfaa8925320e135d0e4ea28eff58cb5cdb Mon Sep 17 00:00:00 2001 From: MedAliMarz Date: Fri, 23 Jul 2021 09:32:56 +0200 Subject: [PATCH] :bug: Fix workflow activation confirmation modal (#2005) * Show the activation message if the workflow is not saved * Apply review changes --- .../editor-ui/src/components/WorkflowActivator.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/editor-ui/src/components/WorkflowActivator.vue b/packages/editor-ui/src/components/WorkflowActivator.vue index a3df33c04..b1517d59d 100644 --- a/packages/editor-ui/src/components/WorkflowActivator.vue +++ b/packages/editor-ui/src/components/WorkflowActivator.vue @@ -32,6 +32,7 @@ import { } from '../Interface'; import mixins from 'vue-typed-mixins'; +import { mapGetters } from "vuex"; export default mixins( externalHooks, @@ -54,6 +55,9 @@ export default mixins( }; }, computed: { + ...mapGetters({ + dirtyState: "getStateIsDirty", + }), nodesIssuesExist (): boolean { return this.$store.getters.nodesIssuesExist; }, @@ -100,9 +104,11 @@ export default mixins( // workflow. If that would not happen then it could be quite confusing // for people because it would activate a different version of the workflow // than the one they can currently see. - const importConfirm = await this.confirmMessage(`When you activate the workflow all currently unsaved changes of the workflow will be saved.`, 'Activate and save?', 'warning', 'Yes, activate and save!'); - if (importConfirm === false) { - return; + if (this.dirtyState) { + const importConfirm = await this.confirmMessage(`When you activate the workflow all currently unsaved changes of the workflow will be saved.`, 'Activate and save?', 'warning', 'Yes, activate and save!'); + if (importConfirm === false) { + return; + } } // Get the current workflow data that it gets saved together with the activation