Skip to content

Commit

Permalink
Merge pull request getredash#2487 from getredash/fix-dashboard-filters
Browse files Browse the repository at this point in the history
Fix: dashboard filters setting wasn't persisting.
  • Loading branch information
arikfr committed Apr 25, 2018
2 parents b12f3fb + 10bc940 commit b2decc8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
22 changes: 21 additions & 1 deletion client/app/pages/dashboards/dashboard.js
Expand Up @@ -282,8 +282,28 @@ function DashboardCtrl(
};

this.updateDashboardFiltersState = () => {
// / do something for humanity.
collectFilters(this.dashboard, false);
Dashboard.save(
{
slug: this.dashboard.id,
version: this.dashboard.version,
dashboard_filters_enabled: this.dashboard.dashboard_filters_enabled,
},
(dashboard) => {
this.dashboard = dashboard;
},
(error) => {
if (error.status === 403) {
toastr.error('Name update failed: Permission denied.');
} else if (error.status === 409) {
toastr.error(
'It seems like the dashboard has been modified by another user. ' +
'Please copy/backup your changes and reload this page.',
{ autoDismiss: false },
);
}
},
);
};

this.addWidget = () => {
Expand Down
7 changes: 6 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b2decc8

Please sign in to comment.