### What problem does this PR solve? feat: limit there to be only one line between two nodes #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -3,13 +3,9 @@ import { removeUselessFieldsFromValues } from '@/utils/form';
|
||||
import dagre from 'dagre';
|
||||
import { curry, isEmpty } from 'lodash';
|
||||
import pipe from 'lodash/fp/pipe';
|
||||
import { Connection, Edge, MarkerType, Node, Position } from 'reactflow';
|
||||
import { Edge, MarkerType, Node, Position } from 'reactflow';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import {
|
||||
Operator,
|
||||
RestrictedUpstreamMap,
|
||||
initialFormValuesMap,
|
||||
} from './constant';
|
||||
import { Operator, initialFormValuesMap } from './constant';
|
||||
import { NodeData } from './interface';
|
||||
|
||||
const buildEdges = (
|
||||
@@ -170,11 +166,3 @@ export const buildDslComponentsByGraph = (
|
||||
export const getOperatorTypeFromId = (id: string | null) => {
|
||||
return id?.split(':')[0] as Operator | undefined;
|
||||
};
|
||||
|
||||
// restricted lines cannot be connected successfully.
|
||||
export const isValidConnection = (connection: Connection) => {
|
||||
const ret = RestrictedUpstreamMap[
|
||||
getOperatorTypeFromId(connection.source) as Operator
|
||||
]?.every((x) => x !== getOperatorTypeFromId(connection.target));
|
||||
return ret;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user