Skip to content

Commit

Permalink
Revert "feat(bendpoints): do not reconnect if source and target not c…
Browse files Browse the repository at this point in the history
…hanged"

This reverts commit 0ad1066.

Related to camunda/camunda-modeler#1601
  • Loading branch information
philippfromme authored and barmac committed Nov 25, 2019
1 parent 5ace276 commit fd6f76f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
5 changes: 0 additions & 5 deletions lib/features/bendpoints/BendpointMove.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,6 @@ export default function BendpointMove(injector, eventBus, canvas, dragging, rule
}
}

// do NOT reconnect if both source and target haven't changed
if (source === connection.source && target === connection.target) {
return;
}

modeling.reconnect(connection, source, target, docking, hints);
}
}, this);
Expand Down
31 changes: 2 additions & 29 deletions test/spec/features/bendpoints/BendpointsMoveSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ describe('features/bendpoints - move', function() {

// given
bendpointMove.start(canvasEvent({ x: 500, y: 500 }), connection, 2);
dragging.hover({ element: shape5, gfx: canvas.getGraphics(shape5) });
dragging.hover({ element: shape2, gfx: canvas.getGraphics(shape2) });
dragging.move(canvasEvent({ x: 530, y: 120 }));

// when
Expand All @@ -449,7 +449,7 @@ describe('features/bendpoints - move', function() {

// given
bendpointMove.start(canvasEvent({ x: 500, y: 500 }), connection, 0);
dragging.hover({ element: shape4, gfx: canvas.getGraphics(shape4) });
dragging.hover({ element: shape1, gfx: canvas.getGraphics(shape1) });
dragging.move(canvasEvent({ x: 230, y: 120 }));

// when
Expand Down Expand Up @@ -477,33 +477,6 @@ describe('features/bendpoints - move', function() {
]);
}));


it('should NOT reconnect if source and target have not changed', inject(
function(bendpointMove, canvas, dragging, modeling) {

// given
var firstBendpointIndex = 0,
firstBendpoint = connection.waypoints[ firstBendpointIndex ],
source = connection.source;

var reconnectSpy = spy(modeling, 'reconnect');

// when
bendpointMove.start(canvasEvent(firstBendpoint), connection, firstBendpointIndex);

dragging.hover({ element: source, gfx: canvas.getGraphics(source) });

dragging.move(canvasEvent({ x: 0, y: 0 }));

dragging.move(canvasEvent(getMid(source)));

dragging.end();

// then
expect(reconnectSpy).not.to.have.been.called;
}
));

});


Expand Down

0 comments on commit fd6f76f

Please sign in to comment.