fix(editor): Change label for unexecuted nodes (#14260)

This commit is contained in:
Dana
2025-04-01 16:15:42 +02:00
committed by GitHub
parent 837131fc96
commit 08450b20af
6 changed files with 95 additions and 48 deletions

View File

@@ -49,6 +49,7 @@ import { asyncComputed } from '@vueuse/core';
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css';
import { pick } from 'lodash-es';
import { DateTime } from 'luxon';
import NodeExecuteButton from './NodeExecuteButton.vue';
type Props = {
nodes?: IConnectedNode[];
@@ -89,7 +90,7 @@ const { getSchemaForExecutionData, getSchemaForJsonSchema, getSchema, filterSche
useDataSchema();
const { closedNodes, flattenSchema, flattenMultipleSchemas, toggleLeaf, toggleNode } =
useFlattenSchema();
const { getNodeInputData } = useNodeHelpers();
const { getNodeInputData, getNodeTaskData } = useNodeHelpers();
const emit = defineEmits<{
'clear:search': [];
@@ -104,6 +105,8 @@ const toggleNodeAndScrollTop = (id: string) => {
const getNodeSchema = async (fullNode: INodeUi, connectedNode: IConnectedNode) => {
const pinData = workflowsStore.pinDataByNodeName(connectedNode.name);
const hasPinnedData = pinData ? pinData.length > 0 : false;
const isNodeExecuted = getNodeTaskData(fullNode, props.runIndex) !== null || hasPinnedData;
const connectedOutputIndexes = connectedNode.indicies.length > 0 ? connectedNode.indicies : [0];
const nodeData = connectedOutputIndexes.map((outputIndex) =>
getNodeInputData(fullNode, props.runIndex, outputIndex, props.paneType, props.connectionType),
@@ -128,6 +131,7 @@ const getNodeSchema = async (fullNode: INodeUi, connectedNode: IConnectedNode) =
itemsCount: data.length,
preview,
hasBinary,
isNodeExecuted,
};
};
@@ -242,10 +246,8 @@ const nodesSchemas = asyncComputed<SchemaNode[]>(async () => {
const nodeType = nodeTypesStore.getNodeType(fullNode.type, fullNode.typeVersion);
if (!nodeType) continue;
const { schema, connectedOutputIndexes, itemsCount, preview, hasBinary } = await getNodeSchema(
fullNode,
node,
);
const { schema, connectedOutputIndexes, itemsCount, preview, hasBinary, isNodeExecuted } =
await getNodeSchema(fullNode, node);
const filteredSchema = filterSchema(schema, search);
@@ -260,6 +262,7 @@ const nodesSchemas = asyncComputed<SchemaNode[]>(async () => {
schema: filteredSchema,
preview,
hasBinary,
isNodeExecuted,
});
}
@@ -431,6 +434,34 @@ const onDragEnd = (el: HTMLElement) => {
class="notice"
:style="{ marginLeft: `calc(var(--spacing-l) + var(--spacing-l) * ${item.level})` }"
/>
<div
v-else-if="item.type === 'empty'"
:style="{
paddingBottom: `var(--spacing-xs)`,
marginLeft: `var(--spacing-xl)`,
}"
>
<N8nText tag="div" size="small">
<i18n-t
v-if="item.key === 'executeSchema'"
tag="span"
keypath="dataMapping.schemaView.executeSchema"
>
<template #link>
<NodeExecuteButton
:node-name="item.nodeName"
text
telemetry-source="inputs"
hide-icon
:label="i18n.baseText('ndv.input.noOutputData.executePrevious')"
size="small"
:style="{ padding: 0 }"
/>
</template>
</i18n-t>
<i18n-t v-else tag="span" :keypath="`dataMapping.schemaView.${item.key}`" />
</N8nText>
</div>
</DynamicScrollerItem>
</template>
</DynamicScroller>