[Resolver] aria-level and aria-flowto support enhancements#71777
[Resolver] aria-level and aria-flowto support enhancements#71777oatkiller wants to merge 12 commits intoelastic:masterfrom
Conversation
| }; | ||
| } | ||
| ); | ||
| export const nodesAndEdgelines: ( |
| /* eslint-enable no-shadow */ | ||
| ) { | ||
| return (time: number) => indexedProcessNodesAndEdgeLineSegments(boundingBox(time)); | ||
| export const visibleNodesAndEdgeLines = createSelector(nodesAndEdgelines, boundingBox, function ( |
| } | ||
| isProcessTerminated={terminatedProcesses.has(processEntityId)} | ||
| isProcessOrigin={false} | ||
| timeAtRender={timeAtRender} |
There was a problem hiding this comment.
when timestamp is used to get the state of things during a (possible) animation, we should use the same value for all calls in the frame (regardless of how much time has passed.) this is a hacky way to get around the issue. we should file a ticket for it.
| timeAtRender: number; | ||
| }) => { | ||
| // This should be unique to each instance of Resolver | ||
| const htmlIDPrefix = 'resolver'; |
There was a problem hiding this comment.
@kqualters-elastic we need use the documentLocationID here. that way we can have unique IDs.
| const selfId = adjacentNodeMap.self; | ||
| const activeDescendantId = useSelector(selectors.uiActiveDescendantId); | ||
| const selectedDescendantId = useSelector(selectors.uiSelectedDescendantId); | ||
| const nodeID = processEventModel.uniquePidForProcess(event); |
There was a problem hiding this comment.
slowly changing things over to use a string, which i'm calling nodeID, to define nodes.
process events aren't good because several process events could define a node (start event, terminate event, already running event, different events from other vendors.) also, strings are interned and primitives which is nice
| payload: { | ||
| nodeId, | ||
| selectedProcessId: selfId, | ||
| nodeId: nodeHTMLID(nodeID), |
There was a problem hiding this comment.
we should be able to pass just the nodeID. the HTML id can be calculated from that.
| color={labelButtonFill} | ||
| data-test-subject="nodeLabel" | ||
| fill={isLabelFilled} | ||
| id={labelId} |
There was a problem hiding this comment.
same id and data-test-subj were being used for this button and its parent. the data-test-subj wasn't being used anyway.
💚 Build SucceededBuild metrics
To update your PR or re-run it, just comment with: |
x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts
Outdated
Show resolved
Hide resolved
| for (const treeRoot of roots) { | ||
| traverseLevels(idToAdjacent.get(uniquePidForProcess(treeRoot))!); | ||
| // if either value is NaN, compare them differently | ||
| if (isNaN(first)) { |
There was a problem hiding this comment.
Out of curiosity, why would these ever be NaN or is this a "should never happen" scenario?
There was a problem hiding this comment.
datetime tries to parse a Date from @timestamp (or somewhere else for legacy events.)
It then returns the getTime from that Date. If a date is 'Invalid Date', then getTime will return NaN.
maybe i should check for NaN in the body of datetime and return null instead.
| } | ||
|
|
||
| export function eventId(event: ResolverEvent): string { | ||
| export function eventId(event: ResolverEvent): number | undefined | string { |
There was a problem hiding this comment.
@jonathan-buttner this function was converting the serial event id to a string. if it was undefined or 0 it was being converted to ''. i don't know the reasoning, but i undid it. some BE code was effected. let me know if this is OK
There was a problem hiding this comment.
@bkimmel or @kqualters-elastic may have thoughts here.
There was a problem hiding this comment.
I think this is fine I left some comments about checking for undefined and not displaying the string 'undefined'.
| * may return NaN if the timestamp wasn't present or was invalid. | ||
| */ | ||
| export function datetime(passedEvent: ResolverEvent): number { | ||
| export function datetime(passedEvent: ResolverEvent): number | null { |
There was a problem hiding this comment.
@michaelolo24 when the value isn't defined or can't be parsed this now returns null.
| /** | ||
| * used to sort events | ||
| */ | ||
| export function orderByTime(first: ResolverEvent, second: ResolverEvent): number { |
There was a problem hiding this comment.
@jonathan-buttner this now does a tie breaker with an arbitrary comparison of event ID.
| eventType: `${event.ecsEventType(resolverEvent)}`, | ||
| name: event.descriptiveName(resolverEvent), | ||
| entityId, | ||
| entityId: String(entityId), |
There was a problem hiding this comment.
the behavior here is changed. Before, if the event was a legacy event and the id was undefined or 0this would be ''. Now it will be '0' or 'undefined'. I'm not sure that either behavior is correct.
There was a problem hiding this comment.
If it's undefined I wonder if we should mark it as an empty string here. I would think '0' would be fine if that is what was sent by the sensor.
There was a problem hiding this comment.
Hmm also the field name here is a bit misleading, we're setting entityId with eventId. Is that intentional?
There was a problem hiding this comment.
Went to track down what its used for. its not used. removing it.
| const cursor = { | ||
| timestamp: lastResult['@timestamp'], | ||
| eventID: eventId(lastResult), | ||
| eventID: String(eventId(lastResult)), |
There was a problem hiding this comment.
the behavior here is changed. Before, if the event was a legacy event and the id was undefined or 0this would be ''. Now it will be '0' or 'undefined'. I'm not sure that either behavior is correct.
There was a problem hiding this comment.
Thanks for point this out. I think we'll want to check if it is undefined and set it to an empty string here. If 0 is returned we'll likely want to keep it as 0 because I think that's a valid value for the legacy events.
|
github isn't recognizing my pushes unless i close and open? |
|
closing in favor of this: #71887 |
Summary
IndexedProcessTreenow owns the concern of defining the order of siblingsIsometricTaxiLayoutnow owns the concept ofariaLevelsdatetimemethod toprocess_eventmodel which returns a time in ms since unix epoch for the eventariaLevelfollowingSibling(used for aria-flowto)ariaFlowtoNodeIDwhich takes a nodeID, and returns its following sibling's node id (if that sibling is visible.) By only returning visible siblings, we ensure thataria-flowtowill point to an html ID that is in the dom.Checklist
For maintainers