mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
Fixes filters emitted from table viz (#2335)
This commit is contained in:
parent
bd480e0c6b
commit
ad4a950b56
@ -110,6 +110,10 @@ class ChartContainer extends React.PureComponent {
|
|||||||
{}
|
{}
|
||||||
),
|
),
|
||||||
|
|
||||||
|
addFilter: () => {},
|
||||||
|
|
||||||
|
removeFilter: () => {},
|
||||||
|
|
||||||
done: () => {},
|
done: () => {},
|
||||||
clearError: () => {
|
clearError: () => {
|
||||||
// no need to do anything here since Alert is closable
|
// no need to do anything here since Alert is closable
|
||||||
|
@ -68,18 +68,24 @@ function tableVis(slice, payload) {
|
|||||||
.enter()
|
.enter()
|
||||||
.append('tr')
|
.append('tr')
|
||||||
.selectAll('td')
|
.selectAll('td')
|
||||||
.data((row) => data.columns.map((c) => {
|
.data(row => data.columns.map(c => {
|
||||||
let val = row[c];
|
const val = row[c];
|
||||||
|
let html;
|
||||||
|
const isMetric = metrics.indexOf(c) >= 0;
|
||||||
if (c === 'timestamp') {
|
if (c === 'timestamp') {
|
||||||
val = timestampFormatter(val);
|
html = timestampFormatter(val);
|
||||||
}
|
}
|
||||||
if (typeof(val) === 'string') {
|
if (typeof(val) === 'string') {
|
||||||
val = `<span class="like-pre">${val}</span>`;
|
html = `<span class="like-pre">${val}</span>`;
|
||||||
|
}
|
||||||
|
if (isMetric) {
|
||||||
|
html = slice.d3format(c, val);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
col: c,
|
col: c,
|
||||||
val,
|
val,
|
||||||
isMetric: metrics.indexOf(c) >= 0,
|
html,
|
||||||
|
isMetric,
|
||||||
};
|
};
|
||||||
}))
|
}))
|
||||||
.enter()
|
.enter()
|
||||||
@ -118,12 +124,7 @@ function tableVis(slice, payload) {
|
|||||||
.style('cursor', function (d) {
|
.style('cursor', function (d) {
|
||||||
return (!d.isMetric) ? 'pointer' : '';
|
return (!d.isMetric) ? 'pointer' : '';
|
||||||
})
|
})
|
||||||
.html((d) => {
|
.html(d => d.html ? d.html : d.val);
|
||||||
if (d.isMetric) {
|
|
||||||
return slice.d3format(d.col, d.val);
|
|
||||||
}
|
|
||||||
return d.val;
|
|
||||||
});
|
|
||||||
const height = slice.height();
|
const height = slice.height();
|
||||||
let paging = false;
|
let paging = false;
|
||||||
let pageLength;
|
let pageLength;
|
||||||
|
Loading…
Reference in New Issue
Block a user