From e2daa523d492eb11bc29519989e61168a46981c0 Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> Date: Wed, 6 Oct 2021 19:13:39 +0200 Subject: [PATCH] :bug: Apply default save manual executions (#2286) * revert savemanualexecution changes * update toasts behavior to handle default case --- packages/editor-ui/src/Interface.ts | 1 + .../editor-ui/src/components/mixins/pushConnection.ts | 6 ++++-- packages/editor-ui/src/store.ts | 8 ++++++-- packages/editor-ui/src/views/NodeView.vue | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 10ecafc912..8181647da4 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -578,6 +578,7 @@ export interface IRootState { pushConnectionActive: boolean; saveDataErrorExecution: string; saveDataSuccessExecution: string; + saveManualExecutions: boolean; timezone: string; stateIsDirty: boolean; executionTimeout: number; diff --git a/packages/editor-ui/src/components/mixins/pushConnection.ts b/packages/editor-ui/src/components/mixins/pushConnection.ts index a67ce0e144..2643bdb90c 100644 --- a/packages/editor-ui/src/components/mixins/pushConnection.ts +++ b/packages/editor-ui/src/components/mixins/pushConnection.ts @@ -219,13 +219,15 @@ export const pushConnection = mixins( const workflow = this.getWorkflow(); if (runDataExecuted.waitTill !== undefined) { const { - isNewWorkflow, activeExecutionId, + workflowSettings, saveManualExecutions, } = this.$store.getters; + const isSavingExecutions= workflowSettings.saveManualExecutions === undefined ? saveManualExecutions : workflowSettings.saveManualExecutions; + let action; - if (isNewWorkflow || !saveManualExecutions) { + if (!isSavingExecutions) { action = 'Turn on saving manual executions and run again to see what happened after this node.'; } else { diff --git a/packages/editor-ui/src/store.ts b/packages/editor-ui/src/store.ts index d337d9dc12..93e67903ef 100644 --- a/packages/editor-ui/src/store.ts +++ b/packages/editor-ui/src/store.ts @@ -56,6 +56,7 @@ const state: IRootState = { pushConnectionActive: true, saveDataErrorExecution: 'all', saveDataSuccessExecution: 'all', + saveManualExecutions: false, timezone: 'America/New_York', stateIsDirty: false, executionTimeout: -1, @@ -496,6 +497,9 @@ export const store = new Vuex.Store({ setSaveDataSuccessExecution (state, newValue: string) { Vue.set(state, 'saveDataSuccessExecution', newValue); }, + setSaveManualExecutions (state, saveManualExecutions: boolean) { + Vue.set(state, 'saveManualExecutions', saveManualExecutions); + }, setTimezone (state, timezone: string) { Vue.set(state, 'timezone', timezone); }, @@ -654,8 +658,8 @@ export const store = new Vuex.Store({ saveDataSuccessExecution: (state): string => { return state.saveDataSuccessExecution; }, - saveManualExecutions: (state, getters): boolean => { - return !!getters.workflowSettings.saveManualExecutions; + saveManualExecutions: (state): boolean => { + return state.saveManualExecutions; }, timezone: (state): string => { return state.timezone; diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 23e200fe90..05d32cce2d 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -2197,6 +2197,7 @@ export default mixins( this.$store.commit('setEndpointWebhookTest', settings.endpointWebhookTest); this.$store.commit('setSaveDataErrorExecution', settings.saveDataErrorExecution); this.$store.commit('setSaveDataSuccessExecution', settings.saveDataSuccessExecution); + this.$store.commit('setSaveManualExecutions', settings.saveManualExecutions); this.$store.commit('setTimezone', settings.timezone); this.$store.commit('setExecutionTimeout', settings.executionTimeout); this.$store.commit('setMaxExecutionTimeout', settings.maxExecutionTimeout);