mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(editor): Open NDV from logs view with correct run index (#14779)
This commit is contained in:
@@ -115,9 +115,15 @@ describe('LogsOverviewPanel', () => {
|
||||
const rendered = render({ isOpen: true });
|
||||
const aiAgentRow = rendered.getAllByRole('treeitem')[0];
|
||||
|
||||
expect(ndvStore.activeNodeName).toBe(null);
|
||||
expect(ndvStore.output.run).toBe(undefined);
|
||||
|
||||
await fireEvent.click(within(aiAgentRow).getAllByLabelText('Open...')[0]);
|
||||
|
||||
await waitFor(() => expect(ndvStore.activeNodeName).toBe('AI Agent'));
|
||||
await waitFor(() => {
|
||||
expect(ndvStore.activeNodeName).toBe('AI Agent');
|
||||
expect(ndvStore.output.run).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
it('should trigger partial execution if the button is clicked', async () => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useI18n } from '@/composables/useI18n';
|
||||
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { N8nButton, N8nRadioButtons, N8nText, N8nTooltip } from '@n8n/design-system';
|
||||
import { computed } from 'vue';
|
||||
import { computed, nextTick } from 'vue';
|
||||
import { ElTree, type TreeNode as ElTreeNode } from 'element-plus';
|
||||
import {
|
||||
getSubtreeTotalConsumedTokens,
|
||||
@@ -80,6 +80,8 @@ function handleToggleExpanded(treeNode: ElTreeNode) {
|
||||
|
||||
async function handleOpenNdv(treeNode: TreeNode) {
|
||||
ndvStore.setActiveNodeName(treeNode.node);
|
||||
|
||||
await nextTick(() => ndvStore.setOutputRunIndex(treeNode.runIndex));
|
||||
}
|
||||
|
||||
async function handleTriggerPartialExecution(treeNode: TreeNode) {
|
||||
|
||||
@@ -79,7 +79,7 @@ const { APP_Z_INDEXES } = useStyles();
|
||||
const settingsEventBus = createEventBus();
|
||||
const redrawRequired = ref(false);
|
||||
const runInputIndex = ref(-1);
|
||||
const runOutputIndex = ref(-1);
|
||||
const runOutputIndex = computed(() => ndvStore.output.run ?? -1);
|
||||
const isLinkingEnabled = ref(true);
|
||||
const selectedInput = ref<string | undefined>();
|
||||
const triggerWaitingWarningEnabled = ref(false);
|
||||
@@ -476,7 +476,7 @@ const trackLinking = (pane: string) => {
|
||||
};
|
||||
|
||||
const onLinkRunToInput = () => {
|
||||
runOutputIndex.value = runInputIndex.value;
|
||||
ndvStore.setOutputRunIndex(runInputIndex.value);
|
||||
isLinkingEnabled.value = true;
|
||||
trackLinking('input');
|
||||
};
|
||||
@@ -553,14 +553,14 @@ const trackRunChange = (run: number, pane: string) => {
|
||||
};
|
||||
|
||||
const onRunOutputIndexChange = (run: number) => {
|
||||
runOutputIndex.value = run;
|
||||
ndvStore.setOutputRunIndex(run);
|
||||
trackRunChange(run, 'output');
|
||||
};
|
||||
|
||||
const onRunInputIndexChange = (run: number) => {
|
||||
runInputIndex.value = run;
|
||||
if (linked.value) {
|
||||
runOutputIndex.value = run;
|
||||
ndvStore.setOutputRunIndex(run);
|
||||
}
|
||||
trackRunChange(run, 'input');
|
||||
};
|
||||
@@ -622,7 +622,7 @@ watch(
|
||||
|
||||
if (node && node.name !== oldNode?.name && !isActiveStickyNode.value) {
|
||||
runInputIndex.value = -1;
|
||||
runOutputIndex.value = -1;
|
||||
ndvStore.setOutputRunIndex(-1);
|
||||
isLinkingEnabled.value = true;
|
||||
selectedInput.value = undefined;
|
||||
triggerWaitingWarningEnabled.value = false;
|
||||
@@ -675,7 +675,7 @@ watch(
|
||||
);
|
||||
|
||||
watch(maxOutputRun, () => {
|
||||
runOutputIndex.value = -1;
|
||||
ndvStore.setOutputRunIndex(-1);
|
||||
});
|
||||
|
||||
watch(maxInputRun, () => {
|
||||
|
||||
Reference in New Issue
Block a user