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] Add support for saved searches by value #148995

Closed
davismcphee opened this issue Jan 16, 2023 · 1 comment · Fixed by #146849
Closed

[Discover] Add support for saved searches by value #148995

davismcphee opened this issue Jan 16, 2023 · 1 comment · Fixed by #146849
Assignees
Labels
enhancement New value added to drive a business result Feature:Discover Discover Application impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)

Comments

@davismcphee
Copy link
Contributor

A PoC implementation for saved searches by value was created in #146849. The work done in this issue will be a followup to the PoC including a full implementation.

The current PoC includes support for the following:

  • A 'by value' type for for the embeddable input.
  • Support for the ReferenceOrValueEmbeddable interface in the saved search embeddable.
  • Support for loading a saved search embeddable by value.
  • Support for deferEmbeddableLoad and calling setInitializationFinished in the saved search embeddable.
  • An AttributeService implementation for saved searches.

The known work currently missing in the PoC includes the following:

  • Some issues around handling references when dealing with saved searches by value.
  • Any work related to special handling of migrations involving saved searches by value.
  • Tests for the 'by value' functionality.

Additionally, there are a couple of important features related to saved searches by value that will not be included in the initial implementation and will require followup issues:

  • 'Save and return' / state transfer service functionality for saved searches in Discover.
  • Updating the save modal in Discover to allow saving searches directly to a dashboard.
@davismcphee davismcphee added Feature:Discover Discover Application enhancement New value added to drive a business result loe:medium Medium Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) labels Jan 16, 2023
@elasticmachine
Copy link
Contributor

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

@kertal kertal added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. and removed impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Jun 6, 2023
davismcphee added a commit that referenced this issue Aug 2, 2023
## Summary

This PR adds support for saved searches by value. Functionality-wise
this means that similar to other Dashboard panels, saved search panels
now allow unlinking from the library as well as cloning by value instead
of by reference.

Testing guide:
- Test saved searches using both persisted and temporary data views.
- Ensure your saved searches include a query, filters, time range,
columns, sorting, breakdown field, etc.
- Test both the "Unlink from library" and "Save to library"
functionality.
- Test "Clone panel" functionality using both by reference and by value
saved searches (both should clone to a by value saved search).
- Test the "Edit search" button functionality in Dashboard edit mode:
- All saved search configurations should be included when navigating
(search params + persisted & temporary data views).
- Test navigation within the same tab (which will use in-app navigation
to pass state) and opening the link in a new tab (which will use query
params to pass state).
- By reference saved searches should use the
`/app/discover#/view/{savedSearchId}` route.
- By value saved searches using persisted data views should pass all
saved search configurations through the app state (`_a`) query param.
- By value saved searches using temporary data views should use a
locator redirect URL (`/app/r?l=DISCOVER_APP_LOCATOR...`) in order to
support encoding their temporary data view in the URL state.
- Test the "Open in Discover" button functionality in Dashboard view
mode:
- By reference saved searches should open the actual saved search in
Discover.
- By value saved searches should pass all saved search configurations to
Discover.

The following features are not included in this PR and comprise the
remaining work for implementing Time to Visualize for saved searches (to
be done at a later date; issue here: #141629):
- Save and return / state transfer service.
- Save modal with the ability to save directly to a dashboard.

Resolves #148995.
Unblocks #158632.

### Checklist

- [ ] ~Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~
- [ ]
~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] ~Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
- [ ] ~Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
- [ ] ~If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [ ] ~This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
- [ ] ~This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Discover Discover Application impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants