mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
removed table-panel-link class and add a class white to modify table-panel-cell-link class
This commit is contained in:
parent
d4d896ade8
commit
36d981597e
@ -214,15 +214,10 @@ export class TableRenderer {
|
|||||||
var style = '';
|
var style = '';
|
||||||
var cellClasses = [];
|
var cellClasses = [];
|
||||||
var cellClass = '';
|
var cellClass = '';
|
||||||
var linkClass = '';
|
|
||||||
|
|
||||||
if (this.colorState.row) {
|
|
||||||
linkClass = 'table-panel-link';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.colorState.cell) {
|
if (this.colorState.cell) {
|
||||||
style = ' style="background-color:' + this.colorState.cell + ';color: white"';
|
style = ' style="background-color:' + this.colorState.cell + ';color: white"';
|
||||||
linkClass = 'table-panel-link';
|
cellClasses.push('white');
|
||||||
this.colorState.cell = null;
|
this.colorState.cell = null;
|
||||||
} else if (this.colorState.value) {
|
} else if (this.colorState.value) {
|
||||||
style = ' style="color:' + this.colorState.value + '"';
|
style = ' style="color:' + this.colorState.value + '"';
|
||||||
@ -257,13 +252,12 @@ export class TableRenderer {
|
|||||||
var cellTarget = column.style.linkTargetBlank ? '_blank' : '';
|
var cellTarget = column.style.linkTargetBlank ? '_blank' : '';
|
||||||
|
|
||||||
cellClasses.push('table-panel-cell-link');
|
cellClasses.push('table-panel-cell-link');
|
||||||
|
|
||||||
|
if (this.colorState.row) {
|
||||||
|
cellClasses.push('white');
|
||||||
|
}
|
||||||
columnHtml += `
|
columnHtml += `
|
||||||
<a href="${cellLink}"
|
<a href="${cellLink}" target="${cellTarget}" data-link-tooltip data-original-title="${cellLinkTooltip}" data-placement="right">
|
||||||
target="${cellTarget}"
|
|
||||||
data-link-tooltip
|
|
||||||
data-original-title="${cellLinkTooltip}"
|
|
||||||
data-placement="right"
|
|
||||||
class="${linkClass}">
|
|
||||||
${value}
|
${value}
|
||||||
</a>
|
</a>
|
||||||
`;
|
`;
|
||||||
|
@ -268,7 +268,7 @@ describe('when rendering table', () => {
|
|||||||
var expectedHtml = `
|
var expectedHtml = `
|
||||||
<td class="table-panel-cell-link">
|
<td class="table-panel-cell-link">
|
||||||
<a href="/dashboard?param=host1¶m_1=1230¶m_2=40"
|
<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" class="">
|
target="_blank" data-link-tooltip data-original-title="host1 1230 my.host.com" data-placement="right">
|
||||||
host1
|
host1
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -87,6 +87,12 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.white {
|
||||||
|
a {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.cell-highlighted:hover {
|
&.cell-highlighted:hover {
|
||||||
|
Loading…
Reference in New Issue
Block a user