Commit d3bc5227 by Mitsuhiro Tanda

annotation snapshot fix

parent 012d1378
...@@ -46,9 +46,9 @@ define([ ...@@ -46,9 +46,9 @@ define([
var query = {range: range, rangeRaw: rangeRaw, annotation: annotation}; var query = {range: range, rangeRaw: rangeRaw, annotation: annotation};
return datasource.annotationQuery(query) return datasource.annotationQuery(query)
.then(self.receiveAnnotationResults) .then(self.receiveAnnotationResults)
.then(function(options) { .then(function(results) {
if (dashboard.snapshot) { if (dashboard.snapshot) {
annotation.snapshotData = angular.copy(options); annotation.snapshotData = angular.copy(results);
} }
}) })
.then(null, errorHandler); .then(null, errorHandler);
......
...@@ -102,13 +102,17 @@ function (angular, _) { ...@@ -102,13 +102,17 @@ function (angular, _) {
panel.datasource = null; panel.datasource = null;
}); });
// remove annotation queries // remove annotation queries
dash.annotations.list = _.map(dash.annotations.list, function(annotation) { dash.annotations.list = _.chain(dash.annotations.list)
.filter(function(annotation) {
return annotation.enable;
})
.map(function(annotation) {
return { return {
name: annotation.name, name: annotation.name,
enable: annotation.enable, enable: annotation.enable,
snapshotData: annotation.snapshotData snapshotData: annotation.snapshotData
}; };
}); }).value();
// remove template queries // remove template queries
_.each(dash.templating.list, function(variable) { _.each(dash.templating.list, function(variable) {
variable.query = ""; variable.query = "";
......
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