diff --git a/public/app/features/annotations/annotationsSrv.js b/public/app/features/annotations/annotationsSrv.js index 64ebadd9e1a..c58c5ff6d4e 100644 --- a/public/app/features/annotations/annotationsSrv.js +++ b/public/app/features/annotations/annotationsSrv.js @@ -46,9 +46,9 @@ define([ var query = {range: range, rangeRaw: rangeRaw, annotation: annotation}; return datasource.annotationQuery(query) .then(self.receiveAnnotationResults) - .then(function(options) { + .then(function(results) { if (dashboard.snapshot) { - annotation.snapshotData = angular.copy(options); + annotation.snapshotData = angular.copy(results); } }) .then(null, errorHandler); diff --git a/public/app/features/dashboard/shareSnapshotCtrl.js b/public/app/features/dashboard/shareSnapshotCtrl.js index 1c02a5af3d2..445677d5a12 100644 --- a/public/app/features/dashboard/shareSnapshotCtrl.js +++ b/public/app/features/dashboard/shareSnapshotCtrl.js @@ -102,13 +102,17 @@ function (angular, _) { panel.datasource = null; }); // 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 { name: annotation.name, enable: annotation.enable, snapshotData: annotation.snapshotData }; - }); + }).value(); // remove template queries _.each(dash.templating.list, function(variable) { variable.query = "";