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

[Discover] Fix reselecting another surrounding document #117567

Merged

Conversation

kertal
Copy link
Member

@kertal kertal commented Nov 4, 2021

Summary

When clicking on View surrounding documents from a context view, the link didn't behave like it should. New documents were loaded, but the anchor was is no longer highlighted.

This PR fixes this, so you should be able to

  • Go to Discover
  • Expand a document and click on View surrounding documents
  • Once the documents have loaded, click on View surrounding documents on any document
  • Now new documents including a highlighted anchor doc are loaded

Fixes #116644

Checklist

@kertal kertal added Feature:Discover Discover Application Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Nov 4, 2021
@kertal kertal self-assigned this Nov 4, 2021
@kertal kertal added v7.16.0 v8.0.0 v8.1.0 release_note:skip Skip the PR/issue when compiling release notes labels Nov 5, 2021
*/
useEffect(() => {
if (prevAppState.current) {
prevAppState.current = undefined;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the anchor changes in the url, resetting the prevAppState automatically triggers a reload of all documents

@kertal kertal added the auto-backport Deprecated - use backport:version if exact versions are needed label Nov 5, 2021
@kertal kertal marked this pull request as ready for review November 5, 2021 14:51
@kertal kertal requested a review from a team as a code owner November 5, 2021 14:51
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@kertal
Copy link
Member Author

kertal commented Nov 5, 2021

@elasticmachine merge upstream

@kertal
Copy link
Member Author

kertal commented Nov 8, 2021

@elasticmachine merge upstream

Copy link
Contributor

@majagrubic majagrubic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Chrome on Mac OS X, works as expected!

@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
discover 311.9KB 312.0KB +156.0B

History

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

cc @kertal

@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
8.0
7.16

The backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Nov 9, 2021
…) (#117996)

Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
kibanamachine added a commit that referenced this pull request Nov 9, 2021
…) (#117997)

Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Discover Discover Application release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v7.16.0 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Discover] View surrounding documents link is broken
4 participants