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
427629b4
Unverified
Commit
427629b4
authored
Jan 29, 2020
by
michael-az
Committed by
GitHub
Jan 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TablePanel: display multi-line text (#20210)
* TablePanel: display multi-line text * Fix tests
parent
ffe0a1f9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
20 deletions
+14
-20
public/app/plugins/panel/table/renderer.ts
+11
-14
public/app/plugins/panel/table/specs/renderer.test.ts
+3
-6
No files found.
public/app/plugins/panel/table/renderer.ts
View file @
427629b4
...
...
@@ -305,26 +305,23 @@ export class TableRenderer {
cellClasses
.
push
(
'table-panel-cell-link'
);
columnHtml
+=
`
<a href="
${
sanitizedCellLink
}
" target="
${
cellTarget
}
" data-link-tooltip data-original-title="
${
cellLinkTooltip
}
" data-placement="right"
${
cellStyle
}
>
${
value
}
</a>
`
;
columnHtml
+=
`<a href="
${
sanitizedCellLink
}
" target="
${
cellTarget
}
" data-link-tooltip data-original-title="
${
cellLinkTooltip
}
" data-placement="right"
${
cellStyle
}
>`
;
columnHtml
+=
`
${
value
}
`
;
columnHtml
+=
`</a>`
;
}
else
{
columnHtml
+=
value
;
}
if
(
column
.
filterable
)
{
cellClasses
.
push
(
'table-panel-cell-filterable'
);
columnHtml
+=
`
<a class="table-panel-filter-link" data-link-tooltip data-original-title="Filter out value" data-placement="bottom"
data-row="
${
rowIndex
}
" data-column="
${
columnIndex
}
" data-operator="!=">
<i class="fa fa-search-minus"></i>
</a>
<a class="table-panel-filter-link" data-link-tooltip data-original-title="Filter for value" data-placement="bottom"
data-row="
${
rowIndex
}
" data-column="
${
columnIndex
}
" data-operator="=">
<i class="fa fa-search-plus"></i>
</a>`
;
columnHtml
+=
`<a class="table-panel-filter-link" data-link-tooltip data-original-title="Filter out value" data-placement="bottom"
data-row="
${
rowIndex
}
" data-column="
${
columnIndex
}
" data-operator="!=">`
;
columnHtml
+=
`<i class="fa fa-search-minus"></i>`
;
columnHtml
+=
`</a>`
;
columnHtml
+=
`<a class="table-panel-filter-link" data-link-tooltip data-original-title="Filter for value" data-placement="bottom"
data-row="
${
rowIndex
}
" data-column="
${
columnIndex
}
" data-operator="=">`
;
columnHtml
+=
`<i class="fa fa-search-plus"></i>`
;
columnHtml
+=
`</a>`
;
}
if
(
cellClasses
.
length
)
{
...
...
public/app/plugins/panel/table/specs/renderer.test.ts
View file @
427629b4
...
...
@@ -317,12 +317,9 @@ describe('when rendering table', () => {
it
(
'link should render as'
,
()
=>
{
const
html
=
renderer
.
renderCell
(
7
,
0
,
'host1'
);
const
expectedHtml
=
`
<td class="table-panel-cell-link">
<a href="/dashboard?param=host1¶m_1=1230¶m_2=40"
target="_blank" data-link-tooltip data-original-title="host1 1230 my.host.com" data-placement="right">
host1
</a>
</td>
<td class="table-panel-cell-link"><a href="/dashboard?param=host1¶m_1=1230¶m_2=40"
target="_blank" data-link-tooltip data-original-title="host1 1230 my.host.com"
data-placement="right">host1</a></td>
`
;
expect
(
normalize
(
html
)).
toBe
(
normalize
(
expectedHtml
));
});
...
...
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