Skip to content

Commit 7d9ad58

Browse files
umbopepatoJordanSh
authored andcommitted
[ResponseOps][Alerts] Fix Security alerts table not switching view mode columns correctly (elastic#245253)
## 📄 Summary Forces the Security AlertsTable to rerender entirely when switching view mode (`Grid view/Event rendered view` dropdown in the table toolbar) to make sure the columns are updated correctly. <details> <summary> ## 🧪 Verification steps </summary> 1. Create Security rules that fire alerts 2. Navigate to Security Solution > Alerts 3. Try switching view mode `Grid view` <> `Event rendered view` one or more times, with page reloads in between too 4. After switching mode, try adding/removing columns to the table from the `Fields` toolbar menu 5. After editing the columns, try to reset to the default ones (`Fields` > `Reset fields`) </details> ## ⏪ Backport rationale Backporting to all branches where the issue occurs ## 🔗 References Fixes elastic#245257 ## Release Notes Fixes an issue that caused the Security alerts table to not update columns correctly when switching view mode ## ☑️ Checklist - [ ] ~~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~~ - [ ] ~~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~~ - [ ] [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 - [ ] ~~If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~~ - [ ] ~~This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations.~~ - [ ] ~~[Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed~~ - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
1 parent e336052 commit 7d9ad58

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table

x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ const AlertsTableComponent: FC<Omit<AlertTableProps, 'services'>> = ({
461461
<EuiDataGridContainer hideLastPage={false}>
462462
<AlertTableCellContextProvider tableId={tableType} sourcererScope={pageScope}>
463463
<ResponseOpsAlertsTable<SecurityAlertsTableContext>
464+
key={isEventRenderedView ? 'eventRenderedView' : 'defaultView'}
464465
ref={alertsTableRef}
465466
// Stores separate configuration based on the view of the table
466467
id={id ?? `detection-engine-alert-table-${tableType}-${tableView}`}

0 commit comments

Comments
 (0)