mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
🐛 Fix workflow activation confirmation modal (#2005)
* Show the activation message if the workflow is not saved * Apply review changes
This commit is contained in:
parent
98ec23544b
commit
10acbecfaa
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue