Commit 55af92eb by bergquist

fix(table): fixes broken annotation rendering

closes #7268
parent 2dd1eb81
......@@ -153,14 +153,16 @@ describe('when transforming time series table', () => {
describe('Annnotations', () => {
var panel = {transform: 'annotations'};
var rawData = [
{
min: 1000,
text: 'hej',
tags: ['tags', 'asd'],
title: 'title',
}
];
var rawData = {
annotations: [
{
min: 1000,
text: 'hej',
tags: ['tags', 'asd'],
title: 'title',
}
]
};
beforeEach(() => {
table = transformDataToTable(rawData, panel);
......
......@@ -125,12 +125,12 @@ transformers['annotations'] = {
model.columns.push({text: 'Text'});
model.columns.push({text: 'Tags'});
if (!data || data.length === 0) {
if (!data || !data.annotations || data.annotations.length === 0) {
return;
}
for (var i = 0; i < data.length; i++) {
var evt = data[i];
for (var i = 0; i < data.annotations.length; i++) {
var evt = data.annotations[i];
model.rows.push([evt.min, evt.title, evt.text, evt.tags]);
}
}
......
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