From 3ec5b2850c47057032e61c2acdbdfc1dcdd931f7 Mon Sep 17 00:00:00 2001 From: Charlie Kolb Date: Mon, 13 Jan 2025 09:05:35 +0100 Subject: [PATCH] fix(editor): Don't show toolsUnused notice if run had errors (#12529) --- .../editor-ui/src/components/OutputPanel.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/editor-ui/src/components/OutputPanel.vue b/packages/editor-ui/src/components/OutputPanel.vue index aff304a3cf..ac13a67c95 100644 --- a/packages/editor-ui/src/components/OutputPanel.vue +++ b/packages/editor-ui/src/components/OutputPanel.vue @@ -4,7 +4,6 @@ import { NodeConnectionType, type IRunData, type IRunExecutionData, - type NodeError, type Workflow, } from 'n8n-workflow'; import RunData from './RunData.vue'; @@ -120,14 +119,17 @@ const hasAiMetadata = computed(() => { return false; }); +const hasError = computed(() => + Boolean( + workflowRunData.value && + node.value && + workflowRunData.value[node.value.name]?.[props.runIndex]?.error, + ), +); + // Determine the initial output mode to logs if the node has an error and the logs are available const defaultOutputMode = computed(() => { - const hasError = - workflowRunData.value && - node.value && - (workflowRunData.value[node.value.name]?.[props.runIndex]?.error as NodeError); - - return Boolean(hasError) && hasAiMetadata.value ? OUTPUT_TYPE.LOGS : OUTPUT_TYPE.REGULAR; + return hasError.value && hasAiMetadata.value ? OUTPUT_TYPE.LOGS : OUTPUT_TYPE.REGULAR; }); const isNodeRunning = computed(() => { @@ -216,7 +218,7 @@ const canPinData = computed(() => { }); const allToolsWereUnusedNotice = computed(() => { - if (!node.value || runsCount.value === 0) return undefined; + if (!node.value || runsCount.value === 0 || hasError.value) return undefined; // With pinned data there's no clear correct answer for whether // we should use historic or current parents, so we don't show the notice,