Skip to content
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][Timeline] Fix breadcrumbs path reopens timeline when timeline modal is open #101568

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

machadoum
Copy link
Member

@machadoum machadoum commented Jun 8, 2021

issue #100322

Summary

Breadcrumbs links are in sync with the URL query string to preserve the APP state (filters and timeline bar) when the user navigates between different security pages. But because timeline.isOpen is a query string, it is also preserved. To fix this issue, we have to explicitly set timeline.isOpen to false.

P.S.: This area of the code seems outdated. It would be nice to take some time and improve it.

Checklist

@machadoum machadoum requested a review from a team as a code owner June 8, 2021 09:56
@machadoum machadoum self-assigned this Jun 8, 2021
@machadoum machadoum added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team v7.14.0 v8.0.0 labels Jun 8, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@machadoum
Copy link
Member Author

@elasticmachine merge upstream

@machadoum machadoum requested a review from cnasikas June 15, 2021 16:56
@machadoum machadoum changed the title Fix breadcrumbs path reopens timeline when timeline modal is open [Security Solution][Timeline] Fix breadcrumbs path reopens timeline when timeline modal is open Jun 15, 2021
@machadoum
Copy link
Member Author

@elasticmachine merge upstream

1 similar comment
@machadoum
Copy link
Member Author

@elasticmachine merge upstream

@machadoum machadoum enabled auto-merge (squash) June 23, 2021 15:51
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 6.5MB 6.5MB +79.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @machadoum

machadoum added a commit to machadoum/kibana that referenced this pull request Sep 15, 2021
machadoum added a commit to machadoum/kibana that referenced this pull request Sep 15, 2021
machadoum added a commit to machadoum/kibana that referenced this pull request Sep 16, 2021
machadoum added a commit to machadoum/kibana that referenced this pull request Sep 16, 2021
machadoum added a commit to machadoum/kibana that referenced this pull request Sep 16, 2021
machadoum added a commit to machadoum/kibana that referenced this pull request Sep 16, 2021
machadoum added a commit to machadoum/kibana that referenced this pull request Sep 20, 2021
machadoum added a commit that referenced this pull request Sep 20, 2021
… applied (#111369)

* Fix useUrlStateHooks endless redirect loop

Whenever the redux store changes, useUrlStateHooks updates the URL to sync with the store content.
But when we navigate to a different page, it is also called to build the new page query string.
If we update the store and navigate to a URL in a small time window, it could create an endless
loop of useUrlStateHooks calls because the current URL doesn't get passed down to the router props.
So when calling history.replace to update the query string, it would redirect to the previous page.

* Revert "Fix Kibana page crash on redirect navigation when timeline is open (#104288)"

This reverts commit 1ae7afd.

* Revert "Fix breadcrumbs path reopens timeline when timeline modal is open (#101568)"

This reverts commit 5b0d325.

* Fix properly "breadcrumbs path reopens timeline when timeline modal is open"

Since the redirect loop is fixed we can easily dispatch an action to close the timeline.

* Fix eslint issue
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 20, 2021
… applied (elastic#111369)

* Fix useUrlStateHooks endless redirect loop

Whenever the redux store changes, useUrlStateHooks updates the URL to sync with the store content.
But when we navigate to a different page, it is also called to build the new page query string.
If we update the store and navigate to a URL in a small time window, it could create an endless
loop of useUrlStateHooks calls because the current URL doesn't get passed down to the router props.
So when calling history.replace to update the query string, it would redirect to the previous page.

* Revert "Fix Kibana page crash on redirect navigation when timeline is open (elastic#104288)"

This reverts commit 1ae7afd.

* Revert "Fix breadcrumbs path reopens timeline when timeline modal is open (elastic#101568)"

This reverts commit 5b0d325.

* Fix properly "breadcrumbs path reopens timeline when timeline modal is open"

Since the redirect loop is fixed we can easily dispatch an action to close the timeline.

* Fix eslint issue
kibanamachine added a commit that referenced this pull request Sep 20, 2021
… applied (#111369) (#112546)

* Fix useUrlStateHooks endless redirect loop

Whenever the redux store changes, useUrlStateHooks updates the URL to sync with the store content.
But when we navigate to a different page, it is also called to build the new page query string.
If we update the store and navigate to a URL in a small time window, it could create an endless
loop of useUrlStateHooks calls because the current URL doesn't get passed down to the router props.
So when calling history.replace to update the query string, it would redirect to the previous page.

* Revert "Fix Kibana page crash on redirect navigation when timeline is open (#104288)"

This reverts commit 1ae7afd.

* Revert "Fix breadcrumbs path reopens timeline when timeline modal is open (#101568)"

This reverts commit 5b0d325.

* Fix properly "breadcrumbs path reopens timeline when timeline modal is open"

Since the redirect loop is fixed we can easily dispatch an action to close the timeline.

* Fix eslint issue

Co-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>
machadoum added a commit to machadoum/kibana that referenced this pull request Sep 21, 2021
… applied (elastic#111369)

* Fix useUrlStateHooks endless redirect loop

Whenever the redux store changes, useUrlStateHooks updates the URL to sync with the store content.
But when we navigate to a different page, it is also called to build the new page query string.
If we update the store and navigate to a URL in a small time window, it could create an endless
loop of useUrlStateHooks calls because the current URL doesn't get passed down to the router props.
So when calling history.replace to update the query string, it would redirect to the previous page.

* Revert "Fix Kibana page crash on redirect navigation when timeline is open (elastic#104288)"

This reverts commit 1ae7afd.

* Revert "Fix breadcrumbs path reopens timeline when timeline modal is open (elastic#101568)"

This reverts commit 5b0d325.

* Fix properly "breadcrumbs path reopens timeline when timeline modal is open"

Since the redirect loop is fixed we can easily dispatch an action to close the timeline.

* Fix eslint issue
# Conflicts:
#	x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.test.ts
machadoum added a commit that referenced this pull request Sep 21, 2021
… applied (#111369) (#112637)

* Fix useUrlStateHooks endless redirect loop

Whenever the redux store changes, useUrlStateHooks updates the URL to sync with the store content.
But when we navigate to a different page, it is also called to build the new page query string.
If we update the store and navigate to a URL in a small time window, it could create an endless
loop of useUrlStateHooks calls because the current URL doesn't get passed down to the router props.
So when calling history.replace to update the query string, it would redirect to the previous page.

* Revert "Fix Kibana page crash on redirect navigation when timeline is open (#104288)"

This reverts commit 1ae7afd.

* Revert "Fix breadcrumbs path reopens timeline when timeline modal is open (#101568)"

This reverts commit 5b0d325.

* Fix properly "breadcrumbs path reopens timeline when timeline modal is open"

Since the redirect loop is fixed we can easily dispatch an action to close the timeline.

* Fix eslint issue
# Conflicts:
#	x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience QA:Needs Validation Issue needs to be validated by QA release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants