mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(editor): Migrate workflowRun mixin to useRunWorkflow composable (no-changelog) (#8711)
This commit is contained in:
@@ -34,7 +34,6 @@ import {
|
||||
} from '@/constants';
|
||||
import type { INodeUi } from '@/Interface';
|
||||
import type { INodeTypeDescription } from 'n8n-workflow';
|
||||
import { workflowRun } from '@/mixins/workflowRun';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
@@ -43,9 +42,11 @@ import { useToast } from '@/composables/useToast';
|
||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||
import { nodeViewEventBus } from '@/event-bus';
|
||||
import { usePinnedData } from '@/composables/usePinnedData';
|
||||
import { useRunWorkflow } from '@/composables/useRunWorkflow';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
export default defineComponent({
|
||||
mixins: [workflowRun],
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
nodeName: {
|
||||
@@ -76,23 +77,24 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
setup(props) {
|
||||
const router = useRouter();
|
||||
const workflowsStore = useWorkflowsStore();
|
||||
const node = workflowsStore.getNodeByName(props.nodeName);
|
||||
const pinnedData = usePinnedData(node);
|
||||
const externalHooks = useExternalHooks();
|
||||
const { runWorkflow } = useRunWorkflow({ router });
|
||||
|
||||
return {
|
||||
externalHooks,
|
||||
pinnedData,
|
||||
runWorkflow,
|
||||
...useToast(),
|
||||
...useMessage(),
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||
...workflowRun.setup?.(props, ctx),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapStores(useNodeTypesStore, useNDVStore, useWorkflowsStore),
|
||||
...mapStores(useNodeTypesStore, useNDVStore, useWorkflowsStore, useUIStore),
|
||||
node(): INodeUi | null {
|
||||
return this.workflowsStore.getNodeByName(this.nodeName);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user