mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Fix for inaccurate bidrectional edges on edge hover
This commit is contained in:
committed by
jpellizzari
parent
3e2144544b
commit
93e76a94c1
@@ -540,4 +540,15 @@ describe('RootReducer', () => {
|
||||
expect(nextState.get('selectedNodeId')).toBeFalsy();
|
||||
expect(nextState.getIn(['nodeDetails', 'n1'])).toBeFalsy();
|
||||
});
|
||||
it('highlights bidirectional edges', () => {
|
||||
const action = {
|
||||
type: ActionTypes.ENTER_EDGE,
|
||||
edgeId: 'abc123-def456'
|
||||
};
|
||||
const nextState = reducer(initialState, action);
|
||||
expect(nextState.get('highlightedEdgeIds').toJS()).toEqual([
|
||||
'abc123-def456',
|
||||
'def456-abc123'
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -421,7 +421,10 @@ export function rootReducer(state = initialState, action) {
|
||||
// highlight edge
|
||||
state = state.update('highlightedEdgeIds', (highlightedEdgeIds) => {
|
||||
highlightedEdgeIds = highlightedEdgeIds.clear();
|
||||
return highlightedEdgeIds.add(action.edgeId);
|
||||
highlightedEdgeIds = highlightedEdgeIds.add(action.edgeId);
|
||||
const opposite = action.edgeId.split(EDGE_ID_SEPARATOR).reverse().join(EDGE_ID_SEPARATOR);
|
||||
highlightedEdgeIds = highlightedEdgeIds.add(opposite);
|
||||
return highlightedEdgeIds;
|
||||
});
|
||||
|
||||
return state;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fromJS } from 'immutable';
|
||||
|
||||
import {
|
||||
initEdgesFromNodes,
|
||||
initEdgesFromNodes
|
||||
} from '../layouter-utils';
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user