diff --git a/client/app/pages/dashboards/public-dashboard-page.js b/client/app/pages/dashboards/public-dashboard-page.js index f1418193c3..706b058b67 100644 --- a/client/app/pages/dashboards/public-dashboard-page.js +++ b/client/app/pages/dashboards/public-dashboard-page.js @@ -37,7 +37,14 @@ const PublicDashboardPage = { loadDashboard($http, $route).then((data) => { this.dashboard = new Dashboard(data); this.dashboard.widgets = Dashboard.prepareDashboardWidgets(this.dashboard.widgets); - this.dashboard.widgets.forEach(widget => widget.load(!!refreshRate)); + this.dashboard.widgets.forEach((widget) => { + widget.load(!!refreshRate).catch((error) => { + const isSafe = widget.getQuery() ? widget.getQuery().is_safe : true; + if (!isSafe) { + error.errorMessage = 'This query contains potentially unsafe parameters and cannot be executed on a publicly shared dashboard.'; + } + }); + }); this.filters = []; // TODO: implement (@/services/dashboard.js:collectDashboardFilters) this.filtersOnChange = (allFilters) => { this.filters = allFilters;