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] Enable Explore in Discover
for adhoc data views in Lens
#140726
[Discover] Enable Explore in Discover
for adhoc data views in Lens
#140726
Conversation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
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.
Pulled and tested locally, both test cases worked for me, and code LGTM too 👍
…explore-in-discover-for-adhoc-dw # Conflicts: # src/plugins/discover/public/application/main/discover_main_route.tsx
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.
LGTM
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.
Works fine AFAICT, just not sure about that one change
// Do not clear initial data view instance from cache | ||
// if adhoc data view id has been provided by the context. | ||
if (contextDataViewSpec && contextDataViewSpec.id !== dataView.id) { | ||
dataViews.clearInstanceCache(dataView.id); |
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.
Why do we need to keep the old data view in cache here? When navigating back to discover the spec is passed over so it should be able to re-create from that.
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.
spec
isn't really passed over, since Discover -> Lens navigation uses ui-actions
. Going back will route to URL state with data view id.
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.
You mean going back via browser back button?
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.
Yes
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.
Hmm, alright, let's keep it in like this. It's not 100% reliable as the user could reload the page while in Lens, then navigate back which would break Discover. Seems like an edge case though. cc @kertal maybe we can find a more stable way to handle this longterm.
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.
yes, if we find a better way here to prevent user running into ad-hoc data views that for various reasons no longer exist, it would be awesome, also with increased adaptations by our userbase I'm pretty sure this will be requested
…explore-in-discover-for-adhoc-dw # Conflicts: # x-pack/plugins/lens/public/indexpattern_datasource/utils.tsx
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.
LGTM, works as expected 👍
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: cc @dimaanj |
Summary
This PR is a one of the follow up tasks of #138283 which:
Explore in Discover
button for adhoc data views in Lens.Steps to reproduce the second case
Checklist