Skip to content

Commit d3bc522

Browse files
committed
annotation snapshot fix
1 parent 012d137 commit d3bc522

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

public/app/features/annotations/annotationsSrv.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ define([
4646
var query = {range: range, rangeRaw: rangeRaw, annotation: annotation};
4747
return datasource.annotationQuery(query)
4848
.then(self.receiveAnnotationResults)
49-
.then(function(options) {
49+
.then(function(results) {
5050
if (dashboard.snapshot) {
51-
annotation.snapshotData = angular.copy(options);
51+
annotation.snapshotData = angular.copy(results);
5252
}
5353
})
5454
.then(null, errorHandler);

public/app/features/dashboard/shareSnapshotCtrl.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,17 @@ function (angular, _) {
102102
panel.datasource = null;
103103
});
104104
// remove annotation queries
105-
dash.annotations.list = _.map(dash.annotations.list, function(annotation) {
105+
dash.annotations.list = _.chain(dash.annotations.list)
106+
.filter(function(annotation) {
107+
return annotation.enable;
108+
})
109+
.map(function(annotation) {
106110
return {
107111
name: annotation.name,
108112
enable: annotation.enable,
109113
snapshotData: annotation.snapshotData
110114
};
111-
});
115+
}).value();
112116
// remove template queries
113117
_.each(dash.templating.list, function(variable) {
114118
variable.query = "";

0 commit comments

Comments
 (0)