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
[Investigations] - Add unified components to eql tab #180972
[Investigations] - Add unified components to eql tab #180972
Conversation
@@ -106,15 +131,26 @@ export const EqlTabContentComponent: React.FC<Props> = ({ | |||
!isEmpty(end) && | |||
!isBlankTimeline; | |||
|
|||
const defaultColumns = useMemo( |
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.
A lot of this logic is going to end up being shared between all the tabs so should probably be abstracted...but may not be necessary when the old table is removed
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.
true, is there a value on lifting this ( till line 145 ) up in Tabs
component as mentioned above?
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.
Yea, I want to do that for almost all of the tabs. The only real difference at this point between them is the query being run..
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.
Did a lot of deduping and cleaning up here: e37faca - Let me know if there's anything else you see
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.
This looks great. Will check it.
688ec93
to
5f4cf36
Compare
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
@michaelolo24 I noticed that removing a field from the table feels slow: Screen.Recording.2024-04-17.at.19.41.06.movIn comparison, this is how it feels like in Discover: Screen.Recording.2024-04-17.at.19.56.56.mov |
Thanks! Yea, I noticed that as well. I think it has something to do with the row rendering, but maybe I'm just making that up. I noticed the same with the |
/ci |
x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.tsx
Outdated
Show resolved
Hide resolved
...elines/components/timeline/unified_components/data_table/use_get_event_type_row_classname.ts
Outdated
Show resolved
Hide resolved
When clicking on the expand button on a row, the flyout isn't opening (works fine without the Screen.Recording.2024-04-17.at.3.04.29.PM.mov |
I found a behavior that's most likely rarely going to happen but still annoying. I'm not sure we really have control over this though...:
Expected behavior: we would stay in the same spot we were on Actual behavior: the view goes back to the Screen.Recording.2024-04-17.at.3.09.56.PM.mov |
Changing the value in the custom Screen.Recording.2024-04-17.at.3.15.53.PM.movCould be related, but @logeekal it seems that the behavior is similar in the |
Is the sorting supposed to work? I'm clicking in a bunch of places and nothing seems to be happening... Screen.Recording.2024-04-17.at.3.45.51.PM.mov |
@janmonschke : As @michaelolo24 also pointed out, it is because of combination of Will soon raise a PR. |
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 making these changes. Seeing your PR, i remebered, I forgot about building block styling. thanks for getting these done.
Additionally, I see that flyout is not opening in Correlation tab only.
eql_code_review.mp4
import { UnifiedTimelineBody } from '../../body/unified_timeline_body'; | ||
import { getColumnHeaders } from '../../body/column_headers/helpers'; | ||
|
||
const memoizedGetColumnHeaders: ( |
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.
Since, all tabs are rendered together. Do you think it makes sense to lift this up in tabs
component?
All tabs such as query, EQL anyway take columns as one of the prop.
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.
Yep, done
@@ -106,15 +131,26 @@ export const EqlTabContentComponent: React.FC<Props> = ({ | |||
!isEmpty(end) && | |||
!isBlankTimeline; | |||
|
|||
const defaultColumns = useMemo( |
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.
true, is there a value on lifting this ( till line 145 ) up in Tabs
component as mentioned above?
...melines/components/timeline/unified_components/data_table/custom_timeline_data_grid_body.tsx
Show resolved
Hide resolved
3dadc05
to
e37faca
Compare
The
No, sorting is not supposed to work for the EQL tab as it would mess up the sequence listing for an EQL query. I forgot to check whether the For:
I added them to our clean up tasks here |
@logeekal see my response to @PhilippeOberti about the same 😄 |
...k/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/index.tsx
Show resolved
Hide resolved
header={header} | ||
columns={augumentedColumnHeaders} | ||
header={ | ||
<QueryTabHeader |
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.
Couldn't decide whether I wanted this behind a memoized const and just pass those two values instead of duplicating them. I can go either way...
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.
+1 for having it in useMemo
. Lot of things going on in timeline and that might recreate header everytime.
Which values are you talking about?
@michaelolo24 only item that I see missing right now is the fact that despite the fact that have the |
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.
left a few small comments about clean up and adding some unit tests maybe? Biggest thing left I think is my comment related to the expandable flyout not showing up even with the expandableTimelineFlyoutEnabled
enabled
...k/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/index.tsx
Outdated
Show resolved
Hide resolved
...s/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.ts
Show resolved
Hide resolved
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.
wouldn't we want to unit test this new component?
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.
yep, adding! 👍🏾
0aa5bb5
to
8fb5199
Compare
Yea, the logic for that wasn't here anymore, I added it in this PR: 8fb5199 Going to work on adding tests, but just wanted to get this there so you can take a look! |
verified! Thanks for adding this. Soon we'll have the onClose logic working |
@PhilippeOberti , this behaviour seems to be related to renderCustomBody. I will take this one up. |
...s/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.ts
Show resolved
Hide resolved
Thank @michaelolo24 for adding changes for new expandable flyout. Actually after my discussion with @PhilippeOberti , I did the related changes but I kept it aside as a patch as my original PR was already big. Now that you have already added the code for It resolves the problem when user closed the flyout, the expand-event icon does not change back. Here is the Patch for Expandable flyout Note: I am happy to add it as well in case you are busy. |
@logeekal and @PhilippeOberti let's make the introduction of the new expandable flyout it's own PR, potentially after Kevin merges his PR for the row actions. I think we should use the default detail expand action the unified data table provides over the one that is in our |
Agreed. 💯
Will do. |
aded1b5
to
5e306c7
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
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.
Desk Testing went great 🚀 . Only one small issue as mentioned below. Looking through code now.
.udtTimeline .euiDataGridRow:has(.nonRawEvent) { | ||
.euiDataGridRowCell--firstColumn, | ||
.euiDataGridRowCell--lastColumn { | ||
${({ theme }) => `border-left: 4px solid ${theme.eui.euiColorWarning};`} |
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.
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.
Nope, just alerts, not regular events. Regular events have the gray border (that's also how it currently is if you check on main)
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.
Code looks clean ✨ ✨ . Approving but I have small comments/questions below.
defaultColumns, | ||
getTimelineQueryFieldsFromColumns, | ||
leadingControlColumns, | ||
localColumns, |
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 am curious what is local columns 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.
Columns that are passed in to the hook, which are in turn passed to the consuming components. If I remember correctly, it's primarily to allow for external customization of the columns
@@ -149,27 +151,27 @@ export const TimelineDataTableComponent: React.FC<DataTableProps> = memo( | |||
dispatch( | |||
timelineActions.toggleDetailPanel({ | |||
...updatedExpandedDetail, | |||
tabType: TimelineTabs.query, | |||
tabType: activeTab, |
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.
Sorry for this screw up 😅 🙏
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.
Lol, all good. 😄
? isEvenEqlSequence(ecsData) | ||
? 'eqlSequence' | ||
: 'eqlNonSequence' | ||
: 'nonRawEvent', |
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.
For my knowledge, what is diff between nonRawEvent
and rawEvent
.
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.
rawEvent is a generic event, whereas nonRawEvent is a catch all for a modified event, which the only one I know of right now is an alert
/signal
@michaelolo24 This is still broken for me. If you don't want to fix it in this PR let's add it to the list in your list of cleanup tasks (link to my original comment for reference) |
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.
LGTM! It seems that we're tracking everything that still need to be fixed and we'll do follow up PRs.
Summary
This PR introduces the unified table and field list to the correlations tab as seen in the snapshots below.
As of this PR, items that are not working
Changes in this PR:
Sequence Highlighting:
Building block highlighting:
To test:
xpack.securitySolution.enableExperimental: [unifiedComponentsInTimelineEnabled]
to yourkibana.dev.yml
any where true
You can also do something like