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

[State Management] Inconsistent behavior with saved queries #59303

Closed
sulemanof opened this issue Mar 4, 2020 · 6 comments
Closed

[State Management] Inconsistent behavior with saved queries #59303

sulemanof opened this issue Mar 4, 2020 · 6 comments
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Query Bar Querying and query bar features

Comments

@sulemanof
Copy link
Contributor

sulemanof commented Mar 4, 2020

Kibana version: latest

Elasticsearch version: latest

Describe the bug:
The behavior in the legacy apps like Discover, Visualize and Dashboard using the savedQuery doesn't look obvious.
To understand, what is going on, you have two create couple of saved queries:

  • Create two different saved queries with at least one filter in each, e.x.:

    image

General steps:

a) Create a new instance of Visalization/Dashboard/Discover

b) Add any of created savedQuery to the search:

choose_saved_query

c) Add additional filter to the search, e.x.:

image

There are several possible cases described below 👇

Reloading the page

Make all of the general steps. Reload the browser window.
Custom app filter will gone, the saved query filters take precedence over app filters.

Addressed in #59805

Changing the savedQuery id in the url

Make all of the general steps.
Change the savedQuery id in the url, e.x. savedQuery:spalger -> savedQuery:member, press enter.
Saved query is changed, custom app filter will gone, the saved query filters take precedence over app filters.

Addressed in #59805

Save the Visalization/Dashboard/Discover

Make all of the general steps. Save your created instance with the Save button.
All of the filter will become appFilters, the savedQuery is not selected anymore.

Opened separate issue #59808
Also, visualize and discover should switch to use use-default-behaviors for consistency.
#59811
#59812

Proposal

My proposal is to the behave in one way.
The saved query filters should be merged with the app filters, but not be removed at all.
The saved query will still take a precedence (means overlapping filters will go to saved query),
but the app filters will be not lost.

@flash1293
Copy link
Contributor

@timroes Do you know of any previous discussions about the behavior of saved queries that could be referenced here?

@timroes
Copy link
Contributor

timroes commented Mar 4, 2020

I wouldn't know what to link to for this right now. Since filters and the saved queries are now maintained by app arch I'd ping @alexh97 here for awareness, and also @AlonaNadler since she might know about prior discussions around how the behavior should be.

@kertal
Copy link
Member

kertal commented Mar 5, 2020

added @lizozom because of #56160 (Stateful search bar default behaviors), it currently only used in discover but that will change

@flash1293 flash1293 added Feature:Query Bar Querying and query bar features Team:AppArch labels Mar 10, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@lizozom
Copy link
Contributor

lizozom commented Mar 10, 2020

Like @kertal had mentioned, the inconsistency is a result of the fact that discover uses use-default-behaviors while visualize and dashboard still implement their own version.

I will work on fixing those issues when using use-default-behaviors, and once visualize and dashboard start using it, we should be good

@lizozom
Copy link
Contributor

lizozom commented Mar 10, 2020

Broke down this issue into individual tasks

@lizozom lizozom closed this as completed Mar 10, 2020
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 Feature:Query Bar Querying and query bar features
Projects
None yet
Development

No branches or pull requests

7 participants