-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Add Url state parameter for external alerts checkbox #142344
Conversation
a3598b5
to
4de1647
Compare
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
4de1647
to
bcbebc1
Compare
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @machadoum |
const getInitialUrlParamValue = useGetInitialUrlParamValue<boolean>(EXTERNAL_ALERTS_URL_PARAM); | ||
|
||
const { decodedParam: showExternalAlertsInitialUrlState } = useMemo( | ||
() => getInitialUrlParamValue(), |
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.
Made me curious, and not important, but do you know if destructuring allocates memory for the intermediary object the value gets pulled out of?
Would:
const showExternalAlertsInitialUrlState = useMemo(() => getInitialUrlParamState().decodedParam, [•••])
Cause an improvement to memory or memorization? Not that it would make much of a difference here?
* Refactor global_query_string to move reusabel code to helper * Add Url state parameter for external alerts checkbox Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Refactor global_query_string to move reusabel code to helper * Add Url state parameter for external alerts checkbox Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
issue #137436
Summary
Add Url state parameter for external alerts checkbox only when the user is on the page, when the user navigates to another page the URL param is removed from the query string.
*** The implementation doesn't use
global_query_string
because external alerts URL param isn't global.Extra:
global_query_string
by extracting reusable code to a helper fileChecklist
Delete any items that are not applicable to this PR.