🐛 Fix workflow activation confirmation modal (#2005)

* Show the activation message if the workflow is not saved

* Apply review changes
This commit is contained in:
MedAliMarz 2021-07-23 09:32:56 +02:00 committed by GitHub
parent 98ec23544b
commit 10acbecfaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,6 +32,7 @@ import {
} from '../Interface'; } from '../Interface';
import mixins from 'vue-typed-mixins'; import mixins from 'vue-typed-mixins';
import { mapGetters } from "vuex";
export default mixins( export default mixins(
externalHooks, externalHooks,
@ -54,6 +55,9 @@ export default mixins(
}; };
}, },
computed: { computed: {
...mapGetters({
dirtyState: "getStateIsDirty",
}),
nodesIssuesExist (): boolean { nodesIssuesExist (): boolean {
return this.$store.getters.nodesIssuesExist; return this.$store.getters.nodesIssuesExist;
}, },
@ -100,9 +104,11 @@ export default mixins(
// workflow. If that would not happen then it could be quite confusing // workflow. If that would not happen then it could be quite confusing
// for people because it would activate a different version of the workflow // for people because it would activate a different version of the workflow
// than the one they can currently see. // 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 (this.dirtyState) {
if (importConfirm === false) { 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!');
return; if (importConfirm === false) {
return;
}
} }
// Get the current workflow data that it gets saved together with the activation // Get the current workflow data that it gets saved together with the activation