diff --git a/packages/editor-ui/src/components/RunDataSchema.vue b/packages/editor-ui/src/components/RunDataSchema.vue index 620ac28a09..43c3b9632a 100644 --- a/packages/editor-ui/src/components/RunDataSchema.vue +++ b/packages/editor-ui/src/components/RunDataSchema.vue @@ -53,7 +53,7 @@ const ndvStore = useNDVStore(); const nodeTypesStore = useNodeTypesStore(); const workflowsStore = useWorkflowsStore(); const { getSchemaForExecutionData, filterSchema } = useDataSchema(); -const { closedNodes, flattSchema, flattMultipleSchema, toggleNode } = useFlattenSchema(); +const { closedNodes, flattenSchema, flattenMultipleSchemas, toggleNode } = useFlattenSchema(); const { getNodeInputData } = useNodeHelpers(); const emit = defineEmits<{ @@ -134,10 +134,12 @@ const nodeAdditionalInfo = (node: INodeUi) => { return returnData.length ? `(${returnData.join(' | ')})` : ''; }; -const flattenedNodes = computed(() => flattMultipleSchema(nodesSchemas.value, nodeAdditionalInfo)); +const flattenedNodes = computed(() => + flattenMultipleSchemas(nodesSchemas.value, nodeAdditionalInfo), +); const flattenNodeSchema = computed(() => - nodeSchema.value ? flattSchema({ schema: nodeSchema.value, depth: 0, level: -1 }) : [], + nodeSchema.value ? flattenSchema({ schema: nodeSchema.value, depth: 0, level: -1 }) : [], ); const items = computed(() => diff --git a/packages/editor-ui/src/composables/useDataSchema.ts b/packages/editor-ui/src/composables/useDataSchema.ts index 96b40a6666..0aec35f02b 100644 --- a/packages/editor-ui/src/composables/useDataSchema.ts +++ b/packages/editor-ui/src/composables/useDataSchema.ts @@ -251,7 +251,7 @@ export const useFlattenSchema = () => { } }; - const flattSchema = ({ + const flattenSchema = ({ schema, node = { name: '', type: '' }, depth = 0, @@ -296,7 +296,13 @@ export const useFlattenSchema = () => { schema.value .map((item) => { const itemPrefix = schema.type === 'array' ? schema.key : ''; - return flattSchema({ schema: item, node, depth, prefix: itemPrefix, level: level + 1 }); + return flattenSchema({ + schema: item, + node, + depth, + prefix: itemPrefix, + level: level + 1, + }); }) .flat(), ); @@ -321,7 +327,7 @@ export const useFlattenSchema = () => { } }; - const flattMultipleSchema = (nodes: SchemaNode[], additionalInfo: (node: INodeUi) => string) => + const flattenMultipleSchemas = (nodes: SchemaNode[], additionalInfo: (node: INodeUi) => string) => nodes.reduce((acc, item, index) => { acc.push({ title: item.node.name, @@ -346,9 +352,9 @@ export const useFlattenSchema = () => { return acc; } - acc.push(...flattSchema(item)); + acc.push(...flattenSchema(item)); return acc; }, []); - return { closedNodes, toggleNode, flattSchema, flattMultipleSchema }; + return { closedNodes, toggleNode, flattenSchema, flattenMultipleSchemas }; };