mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
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:
@@ -606,7 +606,6 @@ import BinaryDataDisplay from '@/components/BinaryDataDisplay.vue';
|
||||
import NodeErrorView from '@/components/Error/NodeErrorView.vue';
|
||||
|
||||
import { genericHelpers } from '@/mixins/genericHelpers';
|
||||
import { nodeHelpers } from '@/mixins/nodeHelpers';
|
||||
import { pinData } from '@/mixins/pinData';
|
||||
import type { PinDataSource } from '@/mixins/pinData';
|
||||
import CodeNodeEditor from '@/components/CodeNodeEditor/CodeNodeEditor.vue';
|
||||
@@ -617,6 +616,7 @@ import { searchInObject } from '@/utils/objectUtils';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useNDVStore } from '@/stores/ndv.store';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import { isObject } from 'lodash-es';
|
||||
import { useExternalHooks } from '@/composables/useExternalHooks';
|
||||
@@ -633,7 +633,7 @@ export type EnterEditModeArgs = {
|
||||
|
||||
export default defineComponent({
|
||||
name: 'RunData',
|
||||
mixins: [genericHelpers, nodeHelpers, pinData],
|
||||
mixins: [genericHelpers, pinData],
|
||||
components: {
|
||||
BinaryDataDisplay,
|
||||
NodeErrorView,
|
||||
@@ -699,11 +699,13 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
const nodeHelpers = useNodeHelpers();
|
||||
const externalHooks = useExternalHooks();
|
||||
|
||||
return {
|
||||
externalHooks,
|
||||
...useToast(),
|
||||
externalHooks,
|
||||
nodeHelpers,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
@@ -931,7 +933,7 @@ export default defineComponent({
|
||||
return [];
|
||||
}
|
||||
|
||||
const binaryData = this.getBinaryData(
|
||||
const binaryData = this.nodeHelpers.getBinaryData(
|
||||
this.workflowRunData,
|
||||
this.node.name,
|
||||
this.runIndex,
|
||||
@@ -1141,7 +1143,7 @@ export default defineComponent({
|
||||
this.$telemetry.track('User clicked pin data icon', telemetryPayload);
|
||||
}
|
||||
|
||||
this.updateNodeParameterIssues(this.node);
|
||||
this.nodeHelpers.updateNodeParameterIssues(this.node);
|
||||
|
||||
if (this.hasPinData) {
|
||||
this.unsetPinData(this.node, source);
|
||||
@@ -1282,7 +1284,7 @@ export default defineComponent({
|
||||
let inputData: INodeExecutionData[] = [];
|
||||
|
||||
if (this.node) {
|
||||
inputData = this.getNodeInputData(
|
||||
inputData = this.nodeHelpers.getNodeInputData(
|
||||
this.node,
|
||||
runIndex,
|
||||
outputIndex,
|
||||
@@ -1365,7 +1367,7 @@ export default defineComponent({
|
||||
},
|
||||
clearExecutionData() {
|
||||
this.workflowsStore.setWorkflowExecutionData(null);
|
||||
this.updateNodesExecutionIssues();
|
||||
this.nodeHelpers.updateNodesExecutionIssues();
|
||||
},
|
||||
isViewable(index: number, key: string): boolean {
|
||||
const { fileType } = this.binaryData[index][key];
|
||||
|
||||
Reference in New Issue
Block a user