mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor(editor): Turn titleChange mixin to composable (#6059)
This commit is contained in:
@@ -14,19 +14,18 @@ import { workflowHelpers } from '@/mixins/workflowHelpers';
|
||||
import { showMessage } from '@/mixins/showMessage';
|
||||
|
||||
import mixins from 'vue-typed-mixins';
|
||||
import { titleChange } from './titleChange';
|
||||
import { useTitleChange } from '@/composables/useTitleChange';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useUIStore } from '@/stores/ui';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useRootStore } from '@/stores/n8nRootStore';
|
||||
|
||||
export const workflowRun = mixins(
|
||||
externalHooks,
|
||||
restApi,
|
||||
workflowHelpers,
|
||||
showMessage,
|
||||
titleChange,
|
||||
).extend({
|
||||
export const workflowRun = mixins(externalHooks, restApi, workflowHelpers, showMessage).extend({
|
||||
setup() {
|
||||
return {
|
||||
...useTitleChange(),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapStores(useRootStore, useUIStore, useWorkflowsStore),
|
||||
},
|
||||
@@ -72,7 +71,7 @@ export const workflowRun = mixins(
|
||||
return;
|
||||
}
|
||||
|
||||
this.$titleSet(workflow.name as string, 'EXECUTING');
|
||||
this.titleSet(workflow.name as string, 'EXECUTING');
|
||||
|
||||
this.clearAllStickyNotifications();
|
||||
|
||||
@@ -119,7 +118,7 @@ export const workflowRun = mixins(
|
||||
type: 'error',
|
||||
duration: 0,
|
||||
});
|
||||
this.$titleSet(workflow.name as string, 'ERROR');
|
||||
this.titleSet(workflow.name as string, 'ERROR');
|
||||
this.$externalHooks().run('workflowRun.runError', { errorMessages, nodeName });
|
||||
|
||||
this.getWorkflowDataToSave().then((workflowData) => {
|
||||
@@ -245,7 +244,7 @@ export const workflowRun = mixins(
|
||||
|
||||
return runWorkflowApiResponse;
|
||||
} catch (error) {
|
||||
this.$titleSet(workflow.name as string, 'ERROR');
|
||||
this.titleSet(workflow.name as string, 'ERROR');
|
||||
this.$showError(error, this.$locale.baseText('workflowRun.showError.title'));
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user