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

@@ -25,16 +25,22 @@ import type { IBinaryData, IRunData } from 'n8n-workflow';
import BinaryDataDisplayEmbed from '@/components/BinaryDataDisplayEmbed.vue';
import { nodeHelpers } from '@/mixins/nodeHelpers';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { useNodeHelpers } from '@/composables/useNodeHelpers';
export default defineComponent({
name: 'BinaryDataDisplay',
mixins: [nodeHelpers],
components: {
BinaryDataDisplayEmbed,
},
setup() {
const nodeHelpers = useNodeHelpers();
return {
nodeHelpers,
};
},
props: [
'displayData', // IBinaryData
'windowVisible', // boolean
@@ -42,7 +48,7 @@ export default defineComponent({
computed: {
...mapStores(useWorkflowsStore),
binaryData(): IBinaryData | null {
const binaryData = this.getBinaryData(
const binaryData = this.nodeHelpers.getBinaryData(
this.workflowRunData,
this.displayData.node,
this.displayData.runIndex,