Commit 40a491a8 by Torkel Ödegaard

Annotations: Elasticsearch annotation and field mapping fixes, small changes for PR #830

parent 06ec91c8
......@@ -5,6 +5,7 @@
- [Issue #795](https://github.com/grafana/grafana/issues/795). Chrome: Fix for display issue in chrome beta & chrome canary when entering edit mode
- [Issue #818](https://github.com/grafana/grafana/issues/818). Graph: Added percent y-axis format
- [Issue #828](https://github.com/grafana/grafana/issues/828). Elasticsearch: saving new dashboard with title equal to slugified url would cause it to deleted.
- [Issue #830](https://github.com/grafana/grafana/issues/830). Annotations: Fix for elasticsearch annotations and mapping nested fields
# 1.8.0-RC1 (2014-09-12)
......
......@@ -110,11 +110,6 @@ function (angular, $, kbn, moment, _) {
// Populate element
var options = {
hooks: {
drawSeries: [function() {
console.log('drawSeries', arguments);
}]
},
legend: { show: false },
series: {
stackpercent: panel.stack ? panel.percentage : false,
......
......@@ -57,7 +57,8 @@ define([
function errorHandler(err) {
console.log('Annotation error: ', err);
alertSrv.set('Annotations','Could not fetch annotations','error');
var message = err.message || "Aannotation query failed";
alertSrv.set('Annotations error', message,'error');
}
function addAnnotation(options) {
......
......@@ -87,22 +87,22 @@ function (angular, _, config, kbn, moment) {
var hits = results.data.hits.hits;
var getFieldFromSource = function(source, fieldName) {
var fieldValue;
if (fieldName) {
if (!fieldName) { return; }
var fieldNames = fieldName.split('.');
fieldValue = source;
var fieldValue = source;
for (var i = 0; i < fieldNames.length; i++) {
fieldValue = fieldValue[fieldNames[i]];
}
if (_.isArray(fieldValue)) {
fieldValue = fieldValue.join(',');
}
fieldValue = fieldValue.join(', ');
}
return fieldValue;
};
for (var i = 0; i < hits.length; i++) {
console.log('annotationQuery', hits[i]);
var source = hits[i]._source;
var fields = hits[i].fields;
var time = source[timeField];
......
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