-
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
Expandable flyout context #165662
Expandable flyout context #165662
Conversation
7769755
to
81627ab
Compare
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.
@PhilippeOberti great work! Code looks more clean and consistent across all the panels and tabs 👍 I left some nit comments (mostly just questions)
With regards to combining vs separating the context, I do feel that sharing commonly used contexts like scopeId, index etc. could benefit all the panels. Another route instead of all or nothing, is to consider using the shared
folder. There are already some duplicates with the mock_context folder (it is present in left, right and shared folders).
With that being said, no actions for this particular PR, just throwing some thoughts while we are refactoring 😃
x-pack/plugins/security_solution/public/flyout/left/components/investigation_guide.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/flyout/left/components/prevalence_details.tsx
Outdated
Show resolved
Hide resolved
...k/plugins/security_solution/public/flyout/left/hooks/use_threat_intelligence_details.test.ts
Outdated
Show resolved
Hide resolved
...ck/plugins/security_solution/public/flyout/right/components/threat_intelligence_overview.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.tsx
Show resolved
Hide resolved
0e25510
to
fd20076
Compare
…'t be null or undefined
extract event details into hook
fd20076
to
99efc61
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: |
Thanks for the thorough review @christineweng! I fixed all the things you noticed. Regarding the context separation topic, I think for now I'd like to keep them as is. The code duplication is small (thanks to the new components and hook). I'm not sure there are items that I would consider as common: |
Summary
This PR performs a small cleanup on the multiple contexts we've developed for the SecuritySolution expandable flyout:
This change ensures that all components within the flyout will always receive non null/undefined data. This allows to remove a lot of null checks and to remove a bunch of unnecessary unit tests.
The decision was made to NOT combine all the providers into one, as the SecuritySolution flyout is intended to see more panels added, some of them not related to an alert document. Therefore, sharing the current information will not make sense at all. We're keeping a little bit of code duplication, but the extraction of the error and loading components, as well as the event details hook reduces that to a very small amount.
Loading and showing data
Screen.Recording.2023-09-11.at.11.22.33.AM.mov
Showing error for one or multiple panels at the same time
Screen.Recording.2023-09-11.at.11.23.36.AM.mov
Screen.Recording.2023-09-11.at.11.25.20.AM.mov
https://github.com/elastic/security-team/issues/7465
https://github.com/elastic/security-team/issues/6793
Checklist