Skip to content

[8.x] [Security Solution] - remove styled-components and cleanup for event viewer and data table components (#206523)#206807

Merged
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-206523
Jan 15, 2025
Merged

[8.x] [Security Solution] - remove styled-components and cleanup for event viewer and data table components (#206523)#206807
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-206523

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…viewer and data table components (elastic#206523)

## Summary

This PR originally aimed at replacing the usages `styled-components`
with `@emotion/react` in the
`security_solution/public/common/components/events_viewer` folder. I
quickly realized removing some of these would require a small refactor.
This lead to making a few more changes, as many properties were actually
unused so a cleanup was welcome.

Only 2 small UI changes are introduced in this PR:
- the inspect icon on the top right corner of the tables are now always
visible instead of only visible on hover. I'm aware that this is a
different behavior from the alerts table in the alerts page, but we also
have other tables (like the one on threat intelligence page) where the
icon is always shown. Waiting on @codearos for confirmation here
- the `Grid view` and `Additional filters` button are reversed due to
the simplification of the code

No other UI changes are introduced. No behavior logic has been changed
either.

The biggest code cleanup are:
- removal of a bunch of unused properties and logic
- deletion of the RightTopMenu component: it was used in both
`StatefulEventsViewerComponent` and `getPersistentControlsHook` but none
of the internal logic was overlapping. I don't know how we got there but
its current implementation was overly complex and completely
unnecessary...

#### Alerts page

![Screenshot 2025-01-13 at 4 33
36 PM](https://github.com/user-attachments/assets/c6c588c1-16f1-49f8-bcc0-246fb05f7e10)

#### Rule creation page

![Screenshot 2025-01-13 at 4 34
14 PM](https://github.com/user-attachments/assets/ea2332c3-425a-4960-8bd6-f2d7395cdf34)

#### Host/User/Network events tab

![Screenshot 2025-01-13 at 4 34
27 PM](https://github.com/user-attachments/assets/4194e406-6bff-4a46-bc99-aadd1aea88d7)

#### Host session view tab

![Screenshot 2025-01-13 at 4 34
42 PM](https://github.com/user-attachments/assets/045b3bb2-2681-4089-a303-a77f797f9b90)

### 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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 7087891)
@kibanamachine kibanamachine merged commit 45d0507 into elastic:8.x Jan 15, 2025
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 6536 6534 -2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 19.1MB 19.1MB -9.3KB
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 574 573 -1

Total ESLint disabled count

id before after diff
securitySolution 658 657 -1

cc @PhilippeOberti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants