mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
feat(editor): Replace root events with event bus events (no-changelog) (#6454)
* feat: replace root events with event bus events * fix: prevent cypress from replacing global with globalThis in import path * feat: remove emitter mixin * fix: replace component events with event bus * fix: fix linting issue * fix: fix breaking expression switch * chore: prettify ndv e2e suite code
This commit is contained in:
@@ -672,9 +672,12 @@ export default defineComponent({
|
||||
? this.$locale.baseText('nodeView.addOrEnableTriggerNode')
|
||||
: this.$locale.baseText('nodeView.addATriggerNodeFirst');
|
||||
|
||||
this.registerCustomAction('showNodeCreator', () =>
|
||||
this.showTriggerCreator(NODE_CREATOR_OPEN_SOURCES.NO_TRIGGER_EXECUTION_TOOLTIP),
|
||||
);
|
||||
this.registerCustomAction({
|
||||
key: 'showNodeCreator',
|
||||
action: () =>
|
||||
this.showTriggerCreator(NODE_CREATOR_OPEN_SOURCES.NO_TRIGGER_EXECUTION_TOOLTIP),
|
||||
});
|
||||
|
||||
const notice = this.showMessage({
|
||||
type: 'info',
|
||||
title: this.$locale.baseText('nodeView.cantExecuteNoTrigger'),
|
||||
@@ -1050,7 +1053,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
if (this.$router.currentRoute.name === VIEWS.NEW_WORKFLOW) {
|
||||
this.$root.$emit('newWorkflow');
|
||||
nodeViewEventBus.emit('newWorkflow');
|
||||
} else {
|
||||
void this.$router.push({ name: VIEWS.NEW_WORKFLOW });
|
||||
}
|
||||
@@ -3913,9 +3916,9 @@ export default defineComponent({
|
||||
window.addEventListener('message', this.onPostMessageReceived);
|
||||
window.addEventListener('pageshow', this.onPageShow);
|
||||
|
||||
this.$root.$on('newWorkflow', this.newWorkflow);
|
||||
this.$root.$on('importWorkflowData', this.onImportWorkflowDataEvent);
|
||||
this.$root.$on('importWorkflowUrl', this.onImportWorkflowUrlEvent);
|
||||
nodeViewEventBus.on('newWorkflow', this.newWorkflow);
|
||||
nodeViewEventBus.on('importWorkflowData', this.onImportWorkflowDataEvent);
|
||||
nodeViewEventBus.on('importWorkflowUrl', this.onImportWorkflowUrlEvent);
|
||||
historyBus.on('nodeMove', this.onMoveNode);
|
||||
historyBus.on('revertAddNode', this.onRevertAddNode);
|
||||
historyBus.on('revertRemoveNode', this.onRevertRemoveNode);
|
||||
@@ -3938,9 +3941,9 @@ export default defineComponent({
|
||||
window.removeEventListener('beforeunload', this.onBeforeUnload);
|
||||
window.removeEventListener('pageshow', this.onPageShow);
|
||||
|
||||
this.$root.$off('newWorkflow', this.newWorkflow);
|
||||
this.$root.$off('importWorkflowData', this.onImportWorkflowDataEvent);
|
||||
this.$root.$off('importWorkflowUrl', this.onImportWorkflowUrlEvent);
|
||||
nodeViewEventBus.off('newWorkflow', this.newWorkflow);
|
||||
nodeViewEventBus.off('importWorkflowData', this.onImportWorkflowDataEvent);
|
||||
nodeViewEventBus.off('importWorkflowUrl', this.onImportWorkflowUrlEvent);
|
||||
historyBus.off('nodeMove', this.onMoveNode);
|
||||
historyBus.off('revertAddNode', this.onRevertAddNode);
|
||||
historyBus.off('revertRemoveNode', this.onRevertRemoveNode);
|
||||
@@ -3959,9 +3962,9 @@ export default defineComponent({
|
||||
this.instance.destroy();
|
||||
this.uiStore.stateIsDirty = false;
|
||||
window.removeEventListener('message', this.onPostMessageReceived);
|
||||
this.$root.$off('newWorkflow', this.newWorkflow);
|
||||
this.$root.$off('importWorkflowData', this.onImportWorkflowDataEvent);
|
||||
this.$root.$off('importWorkflowUrl', this.onImportWorkflowUrlEvent);
|
||||
nodeViewEventBus.off('newWorkflow', this.newWorkflow);
|
||||
nodeViewEventBus.off('importWorkflowData', this.onImportWorkflowDataEvent);
|
||||
nodeViewEventBus.off('importWorkflowUrl', this.onImportWorkflowUrlEvent);
|
||||
this.workflowsStore.setWorkflowId(PLACEHOLDER_EMPTY_WORKFLOW_ID);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user