refactor(editor): Migrate NDV stores and views to workflowDocumentStore (no-changelog) (#27281)

This commit is contained in:
Raúl Gómez Morales
2026-03-23 10:03:14 +00:00
committed by GitHub
parent 34c4f00a63
commit e6071004b5
4 changed files with 4 additions and 6 deletions
@@ -2,7 +2,6 @@
import { useI18n } from '@n8n/i18n';
import { useNDVStore } from '@/features/ndv/shared/ndv.store';
import { useNodeTypesStore } from '@/app/stores/nodeTypes.store';
import { useWorkflowsStore } from '@/app/stores/workflows.store';
import { injectWorkflowDocumentStore } from '@/app/stores/workflowDocument.store';
import { isPresent } from '@/app/utils/typesUtils';
import type { IConnectedNode, Workflow } from 'n8n-workflow';
@@ -24,7 +23,6 @@ const emit = defineEmits<{
}>();
const i18n = useI18n();
const workflowsStore = useWorkflowsStore();
const workflowDocumentStore = injectWorkflowDocumentStore();
const nodeTypesStore = useNodeTypesStore();
const ndvStore = useNDVStore();
@@ -89,7 +87,7 @@ function getMultipleNodesText(nodeName: string): string {
return '';
const activeNodeConnections =
workflowsStore.connectionsByDestinationNode[activeNode.value.name].main || [];
workflowDocumentStore?.value?.connectionsByDestinationNode[activeNode.value.name]?.main ?? [];
// Collect indexes of connected nodes
const connectedInputIndexes = activeNodeConnections.reduce((acc: number[], node, index) => {
if (node?.[0] && node[0].node === nodeName) return [...acc, index];
@@ -157,7 +157,7 @@ export const useNDVStore = defineStore(STORES.NDV, () => {
const ndvNodeInputNumber = computed(() => {
const returnData: { [nodeName: string]: number[] } = {};
const activeNodeConections = (
workflowsStore.connectionsByDestinationNode[activeNode.value?.name || ''] ?? {}
workflowDocumentStore.value?.connectionsByDestinationNode[activeNode.value?.name || ''] ?? {}
).main;
if (!activeNodeConections || activeNodeConections.length < 2) return returnData;
@@ -614,7 +614,7 @@ watch(
setTimeout(() => {
if (activeNode.value) {
const outgoingConnections = workflowsStore.outgoingConnectionsByNodeName(
const outgoingConnections = workflowDocumentStore?.value?.outgoingConnectionsByNodeName(
activeNode.value?.name,
);
@@ -606,7 +606,7 @@ watch(
setTimeout(() => {
if (activeNode.value) {
const outgoingConnections = workflowsStore.outgoingConnectionsByNodeName(
const outgoingConnections = workflowDocumentStore?.value?.outgoingConnectionsByNodeName(
activeNode.value?.name,
);