opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.7k stars 898 forks source link

[VisBuilder] [BUG] Filter does not persist in Dashboard view #3146

Open ashwin-pc opened 1 year ago

ashwin-pc commented 1 year ago

Describe the bug

When creating a visualization, we can add filters and search parameters to the visualization. These parameters should persist when the visualization is added to the dashboard.

To Reproduce Steps to reproduce the behavior:

  1. Go to Visbuilder and create a visulaization and add some filters
  2. Add the visualization to the dashboard
  3. See that the filter is no longer applied

Expected behavior If no other filter is present to override the default filter, apply the filter used while creating the visualization.

OpenSearch Version 3.0

Dashboards Version 3.0

Plugins

Please list all plugins currently enabled.

Screenshots

If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

Additional context

Add any other context about the problem here.

ashwin-pc commented 1 year ago

While I have called this out as a bug based on current behavior, I think we need to define what the behavior here needs to be since its quite weird that today (current behavior for other visualizations) when a filter is applied in the visualization view:

  1. That persists when added to the dashboard, even though it is only a part of the search context
  2. It is not augmented, but rather overriden when a new filter is added in the dashboard view.

@ahopp, @kgcreative @KrooshalUX what are your thoughts on this?

kgcreative commented 1 year ago

I'd love to hear from the community regarding expectations of this behavior. My hypothesis is that the following should be the behavior we want to target.

  1. there should be a "persist filters when adding to dashboard" setting
  2. If the above is checked, then there should be a "append dashboards filter / ignore dashboards filters" check.
  3. In the dashboard itself, there should be a way to see which filters apply to a specific visualization, if different from the global context.
  4. The same should apply to time range.

This would give dashboard authors additional control over how they can create specialized views, for example, showing a dashboard with daily, weekly and monthly trends by category, where they don't necessarily have to create custom buckets to show different categories, since they could achieve the same with custom filters

abbyhu2000 commented 1 year ago

@ashwin-pc @kgcreative If i am understanding it correctly, this issue should already be resolved after we implement the global persistence functionality for vis builder? If we add a filter, it is a default app filter which will only persist on that specific visualization. So when we go to dashboard view, it is expected that the filter is not there anymore. However, if we want that filter also on the dashboard view, we can make this filter a global filter by selecting pinned across the whole app, so that it will be persisted all throughout the app. Thus solve the bug you are describing.

Screen Shot 2023-01-04 at 10 45 04 AM

ashwin-pc commented 1 year ago

As @abbyhu2000 and I discussed offline, the issue here is different from what Abby is calling out in her comment here.

kgcreative commented 1 year ago

@ashwin-pc to me this reads as more related to "Custom filters" and "Custom timerange" per visualization, so that I may persist filters and time ranges in a visualization that may be different from the "golbal" filters/timerange in the dashboard itself.

ashwin-pc commented 1 year ago

@kgcreative while that is what I thought, how do we then explain overriding those values when we set a new filter in the Dashboard view. Even for filters that arent related to the existing "custom" filter, the custom filter is completely replaced by the dashboard filter if one is set. If i didnt know what i was looking for, I would have totally missed this and no where is it displayed whats happening.

I like your suggestion of somehow displaying the filters being applied to a visualization. @KrooshalUX I know that you had mentioned that you were working on restructuring the save visualization workflow so that it makes more sense. do you think it makes sense to combine @kgcreative's suggestion with that? and @kgcreative can 3 & 4 happen without 1 & 2? So that we solve this issue for now and mimic the existing behavior in VisBuilder while we solve 1 and 2 along with the save workflow issue?

ayushjain92 commented 10 months ago

Hi, this bug still exists.