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

Dashboard filters disappear after changing dashboard parameter values #4204

Closed
gabrieldutra opened this issue Oct 1, 2019 · 2 comments · Fixed by #4228
Closed

Dashboard filters disappear after changing dashboard parameter values #4204

gabrieldutra opened this issue Oct 1, 2019 · 2 comments · Fixed by #4228

Comments

@gabrieldutra
Copy link
Member

gabrieldutra commented Oct 1, 2019

Issue Summary

My guess is that this was introduced with #3804

Steps to Reproduce

  1. Create a dashboard with a widget containing a filter and another widget containing a parameter (or use an existing one);
  2. Map the Widget Parameter to be a Dashboard Parameter and enable Dashboard level filters;
  3. Change the Parameter value and verify the filter options disappear

dashboard-filters-parameter

Technical details:

  • Redash Version: Latest
  • Browser/OS: --
  • How did you install Redash: --
@gabrieldutra
Copy link
Member Author

Code related to the issue:

const queryResultPromises = _.compact(affectedWidgets.map(widget => this.loadWidget(widget, forceRefresh)));
return $q.all(queryResultPromises).then((queryResults) => {
this.filters = collectDashboardFilters(dashboard, queryResults, $location.search());
this.filtersOnChange = (allFilters) => {
this.filters = allFilters;
$scope.$applyAsync();
};
});

This seems to be easily solved by using the code below for the queryResults instead of the Promise results:

const queryResults = compact(map(dashboard.widgets, widget => widget.getQueryResult()));

Though, I'm also considering to refactor that part of the code along with Dashboard & Public Dashboard migration, e.g: it makes sense for the Refreshing Code to be separated from the Collect Filters Part.

Depending on when this needs to be fixed, we can go with the quick solution.

@ranbena
Copy link
Contributor

ranbena commented Oct 2, 2019

it makes sense for the Refreshing Code to be separated from the Collect Filters Part.

I favor this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants