Commit 55af92eb by bergquist

fix(table): fixes broken annotation rendering

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