Skip to content

Commit

Permalink
Merge pull request #5272 from invincibleJai/fix-dnd-sources-dep
Browse files Browse the repository at this point in the history
Bug 1830878: event source connector drop target should only be knative service
  • Loading branch information
openshift-merge-robot committed May 4, 2020
2 parents 0ece646 + 6c91ede commit c999610
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
EdgeComponentProps,
EditableDragOperationType,
} from '@console/dev-console/src/components/topology';
import { TYPE_EVENT_SOURCE_LINK } from '../const';
import { TYPE_EVENT_SOURCE_LINK, TYPE_KNATIVE_SERVICE } from '../const';
import { createSinkConnection } from '../knative-topology-utils';

export const MOVE_EV_SRC_CONNECTOR_OPERATION = 'moveeventsourceconnector';
Expand All @@ -30,6 +30,7 @@ export const nodesEdgeIsDragging = (monitor, props) =>

export const canDropEventSourceSinkOnNode = (operation: string, edge: Edge, node: Node): boolean =>
edge.getSource() !== node &&
node.getType() === TYPE_KNATIVE_SERVICE &&
operation === MOVE_EV_SRC_CONNECTOR_OPERATION &&
!node.getTargetEdges().find((e) => e.getSource() === edge.getSource());

Expand Down

0 comments on commit c999610

Please sign in to comment.