refactor(editor): Refactor nodeHelpers mixin to composable (#7810)

- Convert `nodeHelpers` mixin into composable and fix types
- Replace usage of the mixin with the new composable
- Add missing store imports in components that were dependent on opaque
imports from nodeHelpers mixin
- Refactor the `CollectionParameter` component to the modern script
setup syntax
Github issue / Community forum post (link here to close automatically):

---------

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
oleg
2023-12-08 16:59:03 +01:00
committed by GitHub
parent e8a493f718
commit 35fbc37c8e
20 changed files with 1017 additions and 977 deletions

View File

@@ -11,6 +11,7 @@ import {
} from 'n8n-workflow';
import { useToast } from '@/composables/useToast';
import { useNodeHelpers } from '@/composables/useNodeHelpers';
import { workflowHelpers } from '@/mixins/workflowHelpers';
import { useTitleChange } from '@/composables/useTitleChange';
@@ -24,9 +25,12 @@ import { useExternalHooks } from '@/composables/useExternalHooks';
export const workflowRun = defineComponent({
mixins: [workflowHelpers],
setup() {
const nodeHelpers = useNodeHelpers();
return {
...useTitleChange(),
...useToast(),
nodeHelpers,
};
},
computed: {
@@ -83,7 +87,7 @@ export const workflowRun = defineComponent({
try {
// Check first if the workflow has any issues before execute it
this.refreshNodeIssues();
this.nodeHelpers.refreshNodeIssues();
const issuesExist = this.workflowsStore.nodesIssuesExist;
if (issuesExist) {
// If issues exist get all of the issues of all nodes
@@ -265,7 +269,7 @@ export const workflowRun = defineComponent({
},
};
this.workflowsStore.setWorkflowExecutionData(executionData);
this.updateNodesExecutionIssues();
this.nodeHelpers.updateNodesExecutionIssues();
const runWorkflowApiResponse = await this.runWorkflowApi(startRunData);