-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Resolver] aria-level and aria-flowto support enhancements #71777
Conversation
}; | ||
} | ||
); | ||
export const nodesAndEdgelines: ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed
/* eslint-enable no-shadow */ | ||
) { | ||
return (time: number) => indexedProcessNodesAndEdgeLineSegments(boundingBox(time)); | ||
export const visibleNodesAndEdgeLines = createSelector(nodesAndEdgelines, boundingBox, function ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed
relatedEventsStatsForProcess={ | ||
relatedEventsStats ? relatedEventsStats.get(entityId(processEvent)) : undefined | ||
} | ||
isProcessTerminated={terminatedProcesses.has(processEntityId)} | ||
isProcessOrigin={false} | ||
timeAtRender={timeAtRender} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
}) => { | ||
// This should be unique to each instance of Resolver | ||
const htmlIDPrefix = 'resolver'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kqualters-elastic we need use the documentLocationID here. that way we can have unique IDs.
const activeDescendantId = useSelector(selectors.uiActiveDescendantId); | ||
const selectedDescendantId = useSelector(selectors.uiSelectedDescendantId); | ||
const nodeID = processEventModel.uniquePidForProcess(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
(animationTarget.current as any).beginElement(); | ||
} | ||
dispatch({ | ||
type: 'userSelectedResolverNode', | ||
payload: { | ||
nodeId, | ||
selectedProcessId: selfId, | ||
nodeId: nodeHTMLID(nodeID), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should be able to pass just the nodeID. the HTML id can be calculated from that.
fill={isLabelFilled} | ||
id={labelId} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why would these ever be NaN or is this a "should never happen" scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -32,9 +32,9 @@ export function eventName(event: ResolverEvent): string { | |||
} | |||
} | |||
|
|||
export function eventId(event: ResolverEvent): string { | |||
export function eventId(event: ResolverEvent): number | undefined | string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkimmel or @kqualters-elastic may have thoughts here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine I left some comments about checking for undefined
and not displaying the string 'undefined'
.
@@ -32,10 +32,13 @@ export function isTerminatedProcess(passedEvent: ResolverEvent) { | |||
* ms since unix epoc, based on timestamp. | |||
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathan-buttner this now does a tie breaker with an arbitrary comparison of event ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks!
@@ -214,9 +214,9 @@ export const ProcessEventListNarrowedByType = memo(function ProcessEventListNarr | |||
eventCategory: `${eventType}`, | |||
eventType: `${event.ecsEventType(resolverEvent)}`, | |||
name: event.descriptiveName(resolverEvent), | |||
entityId, | |||
entityId: String(entityId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the behavior here is changed. Before, if the event was a legacy event and the id was undefined
or 0
this 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went to track down what its used for. its not used. removing it.
@@ -61,7 +61,7 @@ export class PaginationBuilder { | |||
const lastResult = results[results.length - 1]; | |||
const cursor = { | |||
timestamp: lastResult['@timestamp'], | |||
eventID: eventId(lastResult), | |||
eventID: String(eventId(lastResult)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the behavior here is changed. Before, if the event was a legacy event and the id was undefined
or 0
this 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
IndexedProcessTree
now owns the concern of defining the order of siblingsIsometricTaxiLayout
now owns the concept ofariaLevels
datetime
method toprocess_event
model which returns a time in ms since unix epoch for the eventariaLevel
followingSibling
(used for aria-flowto)ariaFlowtoNodeID
which takes a nodeID, and returns its following sibling's node id (if that sibling is visible.) By only returning visible siblings, we ensure thataria-flowto
will point to an html ID that is in the dom.Checklist
For maintainers