-
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
[Security Solution] fix issue related to local storage on expandable flyout non-alert document #180391
[Security Solution] fix issue related to local storage on expandable flyout non-alert document #180391
Conversation
Pinging @elastic/security-threat-hunting-investigations (Team:Threat Hunting:Investigations) |
@@ -58,7 +58,17 @@ export const RightPanel: FC<Partial<RightPanelProps>> = memo(({ path }) => { | |||
const defaultTab = tabsDisplayed[0].id; | |||
const tabSavedInlocalStorage = storage.get(FLYOUT_STORAGE_KEYS.RIGHT_PANEL_SELECTED_TABS); | |||
|
|||
if (!path) return tabSavedInlocalStorage || defaultTab; | |||
if (!path) { |
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'm considering wrapping this whole useMemo
(and the previous one calculating the tabDisplayed
) into a hook to make this unit testable.
What do you think @christineweng
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.
@christineweng I implemented the hook and its unit test in this last commit
…flyout non-alert document
92edb72
to
e9d7f1b
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 tested and LGTM! thanks for the fix and unit tests!
Summary
This PR fixes a small issue introduced in this previous PR, where if the user clicks on the
Overview
tab, that selection is saved in local storage. When the user opens a non-alert document that does not have theOverview
tab (see details in this PR), the view does not default back to theTable
tab.Previous (broken) behavior:
Screen.Recording.2024-04-09.at.10.21.40.AM.mov
Fixed behavior:
Screen.Recording.2024-04-09.at.10.17.32.AM.mov
Checklist