Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
ecbe7d06
Commit
ecbe7d06
authored
Nov 13, 2017
by
Marcus Efraimsson
Committed by
Torkel Ödegaard
Nov 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Table panel now renders annotations correctly. Fixes #9842 (#9868)
parent
ac8b20a6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
4 deletions
+16
-4
public/app/plugins/panel/table/renderer.ts
+1
-1
public/app/plugins/panel/table/specs/renderer.jest.ts
+13
-1
public/app/plugins/panel/table/specs/transformers.jest.ts
+1
-1
public/app/plugins/panel/table/transformers.ts
+1
-1
No files found.
public/app/plugins/panel/table/renderer.ts
View file @
ecbe7d06
...
...
@@ -104,7 +104,7 @@ export class TableRenderer {
return
'-'
;
}
if
(
_
.
isString
(
v
))
{
if
(
_
.
isString
(
v
)
||
_
.
isArray
(
v
)
)
{
return
this
.
defaultCellFormatter
(
v
,
column
.
style
);
}
...
...
public/app/plugins/panel/table/specs/renderer.jest.ts
View file @
ecbe7d06
...
...
@@ -14,9 +14,10 @@ describe('when rendering table', () => {
{
text
:
'United'
,
unit
:
'bps'
},
{
text
:
'Sanitized'
},
{
text
:
'Link'
},
{
text
:
'Array'
},
];
table
.
rows
=
[
[
1388556366666
,
1230
,
40
,
undefined
,
""
,
""
,
"my.host.com"
,
"host1"
]
[
1388556366666
,
1230
,
40
,
undefined
,
""
,
""
,
"my.host.com"
,
"host1"
,
[
"value1"
,
"value2"
]
]
];
var
panel
=
{
...
...
@@ -66,6 +67,12 @@ describe('when rendering table', () => {
linkUrl
:
"/dashboard?param=$__cell¶m_1=$__cell_1¶m_2=$__cell_2"
,
linkTooltip
:
"$__cell $__cell_1 $__cell_6"
,
linkTargetBlank
:
true
},
{
pattern
:
'Array'
,
type
:
'number'
,
unit
:
'ms'
,
decimals
:
3
}
]
};
...
...
@@ -182,6 +189,11 @@ describe('when rendering table', () => {
`
;
expect
(
normalize
(
html
)).
toBe
(
normalize
(
expectedHtml
));
});
it
(
'Array column should not use number as formatter'
,
()
=>
{
var
html
=
renderer
.
renderCell
(
8
,
0
,
[
'value1'
,
'value2'
]);
expect
(
html
).
toBe
(
'<td>value1, value2</td>'
);
});
});
});
...
...
public/app/plugins/panel/table/specs/transformers.jest.ts
View file @
ecbe7d06
...
...
@@ -154,7 +154,7 @@ describe('when transforming time series table', () => {
var
rawData
=
{
annotations
:
[
{
min
:
1000
,
time
:
1000
,
text
:
'hej'
,
tags
:
[
'tags'
,
'asd'
],
title
:
'title'
,
...
...
public/app/plugins/panel/table/transformers.ts
View file @
ecbe7d06
...
...
@@ -124,7 +124,7 @@ transformers['annotations'] = {
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
]);
model
.
rows
.
push
([
evt
.
time
,
evt
.
title
,
evt
.
text
,
evt
.
tags
]);
}
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment