mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-24 12:19:44 +08:00
refactor(editor): Migrate NDV stores and views to workflowDocumentStore (no-changelog) (#27281)
This commit is contained in:
@@ -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,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user