Skip to content

Commit 24c27ee

Browse files
author
oatkiller
committed
revert me, too ambitious
1 parent 4a1be8d commit 24c27ee

File tree

6 files changed

+28
-39
lines changed

6 files changed

+28
-39
lines changed

x-pack/plugins/security_solution/public/resolver/store/actions.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,10 @@ interface UserFocusedOnResolverNode {
8585
*/
8686
interface UserSelectedResolverNode {
8787
readonly type: 'userSelectedResolverNode';
88-
readonly payload: {
89-
/**
90-
* The HTML ID used to identify the process node's element that the user selected
91-
*/
92-
readonly nodeId: string;
93-
/**
94-
* The process entity_id for the process the node represents
95-
*/
96-
readonly selectedProcessId: string;
97-
};
88+
/**
89+
* entity ID of node
90+
*/
91+
readonly payload: string;
9892
}
9993

10094
/**

x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ export function databaseDocumentIDToFetch(state: DataState): string | null {
281281
}
282282
}
283283

284+
// TODO, don't export
284285
export const layout = createSelector(
285286
indexedProcessTree,
286287
function processNodePositionsAndEdgeLineSegments(

x-pack/plugins/security_solution/public/resolver/store/reducer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const uiReducer: Reducer<ResolverUIState, ResolverAction> = (
3535
} else if (action.type === 'userSelectedResolverNode') {
3636
return {
3737
...uiState,
38+
// TODO
3839
selectedDescendantId: action.payload.nodeId,
3940
processEntityIdOfSelectedDescendant: action.payload.selectedProcessId,
4041
};

x-pack/plugins/security_solution/public/resolver/store/selectors.ts

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,30 +113,6 @@ export const relatedEventInfoByEntityId = composeSelectors(
113113
dataSelectors.relatedEventInfoByEntityId
114114
);
115115

116-
/**
117-
* Returns the id of the "current" tree node (fake-focused)
118-
*/
119-
export const uiActiveDescendantId = composeSelectors(
120-
uiStateSelector,
121-
uiSelectors.activeDescendantId
122-
);
123-
124-
/**
125-
* Returns the id of the "selected" tree node (the node that is currently "pressed" and possibly controlling other popups / components)
126-
*/
127-
export const uiSelectedDescendantId = composeSelectors(
128-
uiStateSelector,
129-
uiSelectors.selectedDescendantId
130-
);
131-
132-
/**
133-
* Returns the entity_id of the "selected" tree node's process
134-
*/
135-
export const uiSelectedDescendantProcessId = composeSelectors(
136-
uiStateSelector,
137-
uiSelectors.selectedDescendantProcessId
138-
);
139-
140116
/**
141117
* Returns the camera state from within ResolverState
142118
*/
@@ -243,3 +219,16 @@ export const ariaFlowtoNodeID: (
243219
dataSelectors.ariaFlowtoNodeID
244220
);
245221

222+
/**
223+
* Takes a nodeID and returns true if it is the current node.
224+
*/
225+
export const isAriaCurrent: (
226+
state: ResolverState
227+
) => (nodeID: string) => boolean = composeSelectors(uiStateSelector, uiSelectors.isAriaCurrent);
228+
229+
/**
230+
* Takes a nodeID and returns true if it is the selected node.
231+
*/
232+
export const isAriaSelected: (
233+
state: ResolverState
234+
) => (nodeID: string) => boolean = composeSelectors(uiStateSelector, uiSelectors.isAriaSelected);

x-pack/plugins/security_solution/public/resolver/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export interface ResolverUIState {
4444
/**
4545
* The entity_id of the process for the resolver's currently selected descendant.
4646
*/
47+
// TODO
4748
readonly processEntityIdOfSelectedDescendant: string | null;
4849
}
4950

@@ -429,6 +430,8 @@ export interface IsometricTaxiLayout {
429430
/**
430431
* A map of events to position. each event represents its own node.
431432
*/
433+
// TODO, rename
434+
// TODO, use string (nodeID/entity_id) instead of ResolverEvent
432435
processNodePositions: Map<ResolverEvent, Vector2>;
433436
/**
434437
* A map of edgline segments, which graphically connect nodes.

x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,7 @@ const UnstyledProcessEventDot = React.memo(
282282

283283
const [xScale] = projectionMatrix;
284284

285-
// Node (html id=) IDs
286-
const activeDescendantId = useSelector(selectors.uiActiveDescendantId);
287-
const selectedDescendantId = useSelector(selectors.uiSelectedDescendantId);
285+
// unique ID for the node
288286
const nodeID = processEventModel.uniquePidForProcess(event);
289287

290288
// define a standard way of giving HTML IDs to nodes based on their entity_id/nodeID.
@@ -296,6 +294,8 @@ const UnstyledProcessEventDot = React.memo(
296294
// the node ID to 'flowto'
297295
const ariaFlowtoNodeID: string | null = useSelector(selectors.ariaFlowtoNodeID)(nodeID);
298296

297+
const isAriaCurrent: boolean = useSelector(selectors.isAriaCurrent)(nodeID);
298+
const isAriaSelected: boolean = useSelector(selectors.isAriaSelected)(nodeID);
299299

300300
const isShowingEventActions = xScale > 0.8;
301301
const isShowingDescriptionText = xScale >= 0.55;
@@ -378,8 +378,9 @@ const UnstyledProcessEventDot = React.memo(
378378

379379
const labelHTMLID = htmlIdGenerator('resolver')(`${nodeID}:label`);
380380

381-
const isActiveDescendant = nodeId === activeDescendantId;
382-
const isSelectedDescendant = nodeId === selectedDescendantId;
381+
// TODO, can this be correct?
382+
// const isActiveDescendant = nodeHTMLID === activeDescendantId;
383+
// const isSelectedDescendant = nodeHTMLID === selectedDescendantId;
383384

384385
const dispatch = useResolverDispatch();
385386

0 commit comments

Comments
 (0)