mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Introduce FE external hooks (#1332)
* ⚡ Introduce FE external hooks * ⚡ update hooks * ⚡ add data from frontend settings to hooks * re-organize and update * cleanup * 👌 * ⚡ cleanup workflowSave mixin, add events * avoid alert on new workflow save as * ⚡ update workflow active events * rename externalhooks method * ⚡ Rename frontend hooks Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
||||
XYPositon,
|
||||
} from '../../Interface';
|
||||
|
||||
import { externalHooks } from '@/components/mixins/externalHooks';
|
||||
import { restApi } from '@/components/mixins/restApi';
|
||||
import { nodeHelpers } from '@/components/mixins/nodeHelpers';
|
||||
import { showMessage } from '@/components/mixins/showMessage';
|
||||
@@ -36,6 +37,7 @@ import { isEqual } from 'lodash';
|
||||
import mixins from 'vue-typed-mixins';
|
||||
|
||||
export const workflowHelpers = mixins(
|
||||
externalHooks,
|
||||
nodeHelpers,
|
||||
restApi,
|
||||
showMessage,
|
||||
@@ -422,6 +424,7 @@ export const workflowHelpers = mixins(
|
||||
this.$store.commit('setWorkflowId', workflowData.id);
|
||||
this.$store.commit('setWorkflowName', {newName: workflowData.name, setStateDirty: false});
|
||||
this.$store.commit('setWorkflowSettings', workflowData.settings || {});
|
||||
this.$store.commit('setStateDirty', false);
|
||||
} else {
|
||||
// Workflow exists already so update it
|
||||
await this.restApi().updateWorkflow(currentWorkflow, workflowData);
|
||||
@@ -441,6 +444,7 @@ export const workflowHelpers = mixins(
|
||||
message: `The workflow "${workflowData.name}" got saved!`,
|
||||
type: 'success',
|
||||
});
|
||||
this.$externalHooks().run('workflow.afterUpdate', { workflowData });
|
||||
} catch (e) {
|
||||
this.$store.commit('removeActiveAction', 'workflowSaving');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user