[AI4DSOC] Add cell renderer for datetime fields to the alert summary table#219126
Conversation
d407f79 to
2547f36
Compare
|
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
| export const DatetimeSchemaCellRenderer = memo( | ||
| ({ alert, field }: DatetimeSchemaCellRendererProps) => { | ||
| const displayValue: number | string | null = useMemo( | ||
| () => getAlertFieldValueAsStringOrNumberOrNull(alert, field), |
There was a problem hiding this comment.
what a function name 😅
There was a problem hiding this comment.
Haha, yeah... at least it's clear? 😆
In a follow up PR (after RSA) I will move all the renderers into a folder and clean up these names a bit...
| </TestProviders> | ||
| ); | ||
|
|
||
| expect(getByText('[object Object]')).toBeInTheDocument(); |
There was a problem hiding this comment.
Still don't know how to feel about this 😓
There was a problem hiding this comment.
I know...Problem for future me I think 🤣 The FormattedDate component I'm leveraging in this PR is actually a bit weird. It displays a date if it's valid, and if not it fallback to the original value. I would have expected it to display a date if valid, and if not, just display -...
But this PR shouldn't be changing this logic as it's used in other places...
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
|
…table (elastic#219126) ## Summary This PR improves the AI4DSOC alert summary table cell renderers by rendering datetime type fields correctly. That way we have datetime fields rendered the same way the alerts page alerts table does. The code uses the `schema` field to know when a field needs to be rendered accordingly. This field is provided by the EuiDataGrid. Previous behavior  New behavior  ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios relates to elastic/security-team#11973
…table (elastic#219126) ## Summary This PR improves the AI4DSOC alert summary table cell renderers by rendering datetime type fields correctly. That way we have datetime fields rendered the same way the alerts page alerts table does. The code uses the `schema` field to know when a field needs to be rendered accordingly. This field is provided by the EuiDataGrid. Previous behavior  New behavior  ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios relates to elastic/security-team#11973 (cherry picked from commit e014955)
…table (elastic#219126) ## Summary This PR improves the AI4DSOC alert summary table cell renderers by rendering datetime type fields correctly. That way we have datetime fields rendered the same way the alerts page alerts table does. The code uses the `schema` field to know when a field needs to be rendered accordingly. This field is provided by the EuiDataGrid. Previous behavior  New behavior  ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios relates to elastic/security-team#11973 (cherry picked from commit e014955)
…table (elastic#219126) ## Summary This PR improves the AI4DSOC alert summary table cell renderers by rendering datetime type fields correctly. That way we have datetime fields rendered the same way the alerts page alerts table does. The code uses the `schema` field to know when a field needs to be rendered accordingly. This field is provided by the EuiDataGrid. Previous behavior  New behavior  ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios relates to elastic/security-team#11973 (cherry picked from commit e014955)
…) (#222074) # Backport This will backport the following commits from `main` to `8.19`: - [[AI4DSOC] Alert summary page routing and initialization (#214889)](#214889) - [[AI4DSOC] Alert summary landing page (#215246)](#215246) - [[AI4DSOC] Alert summary dataview (#215265)](#215265) - [[AI4DSOC] Alert summary KQL bar [#215586]](#215586) - [[AI4DSOC] Alert summary KPI charts [#215585]](#215585) - [[AI4DSOR] Alert summary integrations section [#215266]](#215266) - [[AI4DSOC] Fix issue with filtering by integrations [#216574]](#216574) - [[AI4DSOC] Alert summary table setup [#216744]](#216744) - [Alerty summary table flyout setup [#217421]](#217421) - [[AI4DSOC] Alert summary alert actions in table and flyout [#217696]](#217696) - [[AI4DSOC] Alert summary table custom cell renderers [#217124]](#217124) - [[AI4DSOC] Alert summary table and flyout ai assistant [#217744]](#217744) - [[AI4DSOC] Alert summary page performance improvements [#218632]](#218632) - [[AI4DSOC] Change the Attack Discovery page to use the AI for SOC alerts table [#218736]](#218736) - [[AI4DSOC] Change the Cases page to use the AI for SOC alerts table [#218742]](#218742) - [[AI4DSOC] Fix spacing issue on alert summary landing page integration card [#218868]](#218868) - [[AI4DSOC][ResponseOps] Fix alerts table not handling undefined maintenanceWindow capability [#218999]](#218999) - [[AI4DSOC] Fix link to the new integrations page [#219030]](#219030) - [[AI4DSOC] Disable CellActions and PreviewLinks on the Attack discovery page [#219033]](#219033) - [[AI4DSOC] Add cell renderer for datetime fields to the alert summary table [#219126]](#219126) - [[AI4DSOC] Remove Assistant icon from row action in alert summary table [#219141]](#219141) - [[AI4DSOC] Add checkboxes to the alert summary table [#219169]](#219169) - [[Security Solution][AI4DSOC] Fix table not applying alert tags for Attack discovery and Cases pages in AI4DSOC [#219410]](#219410) - [[AI4DSOC] Fix logic that renders the group title when grouping by integrations [#219430]](#219430) - [[AI4DSOC] Alert summary table truncates long values and display the field/value pair in tooltip [#219438]](#219438) - [[Security Solution] Fix alerts table potentially not applying alert assignees [#219460]](#219460) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This PR improves the AI4DSOC alert summary table cell renderers by rendering datetime type fields correctly. That way we have datetime fields rendered the same way the alerts page alerts table does.
The code uses the
schemafield to know when a field needs to be rendered accordingly. This field is provided by the EuiDataGrid.Previous behavior
New behavior
Checklist
relates to https://github.com/elastic/security-team/issues/11973