Commit dd4f27e3 by Torkel Ödegaard

Fixed issue where a metric request error would set panel error flag, which would…

Fixed issue where a metric request error would set panel error flag, which would cause unsaved changes service to detect change, and prompt the unsaved changes warning. The panel error state is now moved to the panelMeta object that is not part of the dashboard / panel model, Closes #745
parent 455e8051
...@@ -18,8 +18,8 @@ function (angular, $) { ...@@ -18,8 +18,8 @@ function (angular, $) {
'<div class="row-fluid panel-extra">' + '<div class="row-fluid panel-extra">' +
'<div class="panel-extra-container">' + '<div class="panel-extra-container">' +
'<span class="alert-error panel-error small pointer"' + '<span class="alert-error panel-error small pointer"' +
'config-modal="app/partials/inspector.html" ng-if="panel.error">' + 'config-modal="app/partials/inspector.html" ng-if="panelMeta.error">' +
'<span data-placement="right" bs-tooltip="panel.error">' + '<span data-placement="right" bs-tooltip="panelMeta.error">' +
'<i class="icon-exclamation-sign"></i><span class="panel-error-arrow"></span>' + '<i class="icon-exclamation-sign"></i><span class="panel-error-arrow"></span>' +
'</span>' + '</span>' +
'</span>' + '</span>' +
......
...@@ -209,7 +209,7 @@ function (angular, app, $, _, kbn, moment, TimeSeries) { ...@@ -209,7 +209,7 @@ function (angular, app, $, _, kbn, moment, TimeSeries) {
.then($scope.dataHandler) .then($scope.dataHandler)
.then(null, function(err) { .then(null, function(err) {
$scope.panelMeta.loading = false; $scope.panelMeta.loading = false;
$scope.panel.error = err.message || "Timeseries data request error"; $scope.panelMeta.error = err.message || "Timeseries data request error";
$scope.inspector.error = err; $scope.inspector.error = err;
$scope.render([]); $scope.render([]);
}); });
......
...@@ -95,7 +95,7 @@ function (angular, _) { ...@@ -95,7 +95,7 @@ function (angular, _) {
$scope.datasource = datasourceSrv.get(datasource); $scope.datasource = datasourceSrv.get(datasource);
if (!$scope.datasource) { if (!$scope.datasource) {
$scope.panel.error = "Cannot find datasource " + datasource; $scope.panelMeta.error = "Cannot find datasource " + datasource;
return; return;
} }
}; };
...@@ -129,7 +129,7 @@ function (angular, _) { ...@@ -129,7 +129,7 @@ function (angular, _) {
$scope.get_data = function() { $scope.get_data = function() {
if ($scope.otherPanelInFullscreenMode()) { return; } if ($scope.otherPanelInFullscreenMode()) { return; }
delete $scope.panel.error; delete $scope.panelMeta.error;
$scope.panelMeta.loading = true; $scope.panelMeta.loading = true;
panel_get_data(); panel_get_data();
......
...@@ -81,7 +81,6 @@ function(angular, _, config) { ...@@ -81,7 +81,6 @@ function(angular, _, config) {
// ignore timespan changes // ignore timespan changes
current.time = original.time = {}; current.time = original.time = {};
current.refresh = original.refresh; current.refresh = original.refresh;
var currentTimepicker = _.findWhere(current.nav, { type: 'timepicker' }); var currentTimepicker = _.findWhere(current.nav, { type: 'timepicker' });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment