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

This commit is contained in:
Torkel Ödegaard 2014-09-04 09:44:42 +02:00
parent 455e80513b
commit dd4f27e3fa
4 changed files with 5 additions and 6 deletions

View File

@ -18,8 +18,8 @@ function (angular, $) {
'<div class="row-fluid panel-extra">' +
'<div class="panel-extra-container">' +
'<span class="alert-error panel-error small pointer"' +
'config-modal="app/partials/inspector.html" ng-if="panel.error">' +
'<span data-placement="right" bs-tooltip="panel.error">' +
'config-modal="app/partials/inspector.html" ng-if="panelMeta.error">' +
'<span data-placement="right" bs-tooltip="panelMeta.error">' +
'<i class="icon-exclamation-sign"></i><span class="panel-error-arrow"></span>' +
'</span>' +
'</span>' +

View File

@ -209,7 +209,7 @@ function (angular, app, $, _, kbn, moment, TimeSeries) {
.then($scope.dataHandler)
.then(null, function(err) {
$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.render([]);
});

View File

@ -95,7 +95,7 @@ function (angular, _) {
$scope.datasource = datasourceSrv.get(datasource);
if (!$scope.datasource) {
$scope.panel.error = "Cannot find datasource " + datasource;
$scope.panelMeta.error = "Cannot find datasource " + datasource;
return;
}
};
@ -129,7 +129,7 @@ function (angular, _) {
$scope.get_data = function() {
if ($scope.otherPanelInFullscreenMode()) { return; }
delete $scope.panel.error;
delete $scope.panelMeta.error;
$scope.panelMeta.loading = true;
panel_get_data();

View File

@ -81,7 +81,6 @@ function(angular, _, config) {
// ignore timespan changes
current.time = original.time = {};
current.refresh = original.refresh;
var currentTimepicker = _.findWhere(current.nav, { type: 'timepicker' });