fix(snapshots): Fixed issue with empty snapshots, fixes #4706

This commit is contained in:
Torkel Ödegaard 2016-04-14 11:06:48 -04:00
parent 6216ce455f
commit 6355896584
5 changed files with 5 additions and 12 deletions

View File

@ -2,6 +2,7 @@
### Bug fixes
* **Graph**: Fixed issue with light theme text color issue in tooltip, fixes [#4702](https://github.com/grafana/grafana/issues/4702)
* **Snapshot**: Fixed issue with empty snapshots, fixes [#4706](https://github.com/grafana/grafana/issues/4706)
# 3.0.0-beta4 (2016-04-13)

View File

@ -65,7 +65,7 @@ class MetricsPanelCtrl extends PanelCtrl {
var data = this.panel.snapshotData;
// backward compatability
if (!_.isArray(data)) {
data = data;
data = data.data;
}
this.events.emit('data-snapshot-load', data);

View File

@ -161,7 +161,7 @@ class GraphCtrl extends MetricsPanelCtrl {
onDataSnapshotLoad(snapshotData) {
this.annotationsPromise = this.annotationsSrv.getAnnotations(this.dashboard);
this.onDataReceived(snapshotData.data);
this.onDataReceived(snapshotData);
}
onDataError(err) {

View File

@ -56,7 +56,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
this.events.on('data-received', this.onDataReceived.bind(this));
this.events.on('data-error', this.onDataError.bind(this));
this.events.on('data-snapshot-load', this.onDataSnapshotLoad.bind(this));
this.events.on('data-snapshot-load', this.onDataReceived.bind(this));
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
}
@ -71,10 +71,6 @@ class SingleStatCtrl extends MetricsPanelCtrl {
this.render();
}
onDataSnapshotLoad(snapshotData) {
this.onDataReceived(snapshotData.data);
}
onDataError(err) {
this.onDataReceived({data: []});
}

View File

@ -60,7 +60,7 @@ class TablePanelCtrl extends MetricsPanelCtrl {
this.events.on('data-received', this.onDataReceived.bind(this));
this.events.on('data-error', this.onDataError.bind(this));
this.events.on('data-snapshot-load', this.onDataSnapshotLoad.bind(this));
this.events.on('data-snapshot-load', this.onDataReceived.bind(this));
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
this.events.on('init-panel-actions', this.onInitPanelActions.bind(this));
}
@ -86,10 +86,6 @@ class TablePanelCtrl extends MetricsPanelCtrl {
return super.issueQueries(datasource);
}
onDataSnapshotLoad(data) {
this.onDataReceived(data.data);
}
onDataError(err) {
this.dataRaw = [];
this.render();