mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
feat(editor): Add Info Note to NDV Output Panel if no existing Tools were used during Execution (#11672)
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, watch } from 'vue';
|
||||
import type { IRunData, IRunExecutionData, NodeError, Workflow } from 'n8n-workflow';
|
||||
import {
|
||||
NodeConnectionType,
|
||||
type IRunData,
|
||||
type IRunExecutionData,
|
||||
type NodeError,
|
||||
type Workflow,
|
||||
} from 'n8n-workflow';
|
||||
import RunData from './RunData.vue';
|
||||
import RunInfo from './RunInfo.vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
@@ -209,6 +215,29 @@ const canPinData = computed(() => {
|
||||
return pinnedData.isValidNodeType.value && !props.isReadOnly;
|
||||
});
|
||||
|
||||
const allToolsWereUnusedNotice = computed(() => {
|
||||
if (!node.value || runsCount.value === 0) 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,
|
||||
// as it likely ends up unactionable noise to the user
|
||||
if (pinnedData.hasData.value) return undefined;
|
||||
|
||||
const toolsAvailable = props.workflow.getParentNodes(
|
||||
node.value.name,
|
||||
NodeConnectionType.AiTool,
|
||||
1,
|
||||
);
|
||||
const toolsUsedInLatestRun = toolsAvailable.filter(
|
||||
(tool) => !!workflowRunData.value?.[tool]?.[props.runIndex],
|
||||
);
|
||||
if (toolsAvailable.length > 0 && toolsUsedInLatestRun.length === 0) {
|
||||
return i18n.baseText('ndv.output.noToolUsedInfo');
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
|
||||
// Methods
|
||||
|
||||
const insertTestData = () => {
|
||||
@@ -298,6 +327,7 @@ const activatePane = () => {
|
||||
:hide-pagination="outputMode === 'logs'"
|
||||
pane-type="output"
|
||||
:data-output-type="outputMode"
|
||||
:callout-message="allToolsWereUnusedNotice"
|
||||
@activate-pane="activatePane"
|
||||
@run-change="onRunIndexChange"
|
||||
@link-run="onLinkRun"
|
||||
|
||||
Reference in New Issue
Block a user