mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[SQL Lab] Fix bug when filtering on results that include nulls (#8231)
This commit is contained in:
parent
bf7ce62166
commit
1ad17936ba
@ -26,6 +26,7 @@ describe('FilterableTable', () => {
|
|||||||
data: [
|
data: [
|
||||||
{ a: 'a1', b: 'b1', c: 'c1', d: 0 },
|
{ a: 'a1', b: 'b1', c: 'c1', d: 0 },
|
||||||
{ a: 'a2', b: 'b2', c: 'c2', d: 100 },
|
{ a: 'a2', b: 'b2', c: 'c2', d: 100 },
|
||||||
|
{ a: null, b: 'b3', c: 'c3', d: 50 },
|
||||||
],
|
],
|
||||||
height: 500,
|
height: 500,
|
||||||
};
|
};
|
||||||
@ -38,7 +39,7 @@ describe('FilterableTable', () => {
|
|||||||
});
|
});
|
||||||
it('renders a grid with 2 Table rows', () => {
|
it('renders a grid with 2 Table rows', () => {
|
||||||
expect(wrapper.find('.ReactVirtualized__Grid')).toHaveLength(1);
|
expect(wrapper.find('.ReactVirtualized__Grid')).toHaveLength(1);
|
||||||
expect(wrapper.find('.ReactVirtualized__Table__row')).toHaveLength(2);
|
expect(wrapper.find('.ReactVirtualized__Table__row')).toHaveLength(3);
|
||||||
});
|
});
|
||||||
it('renders a grid with 2 Grid rows for wide tables', () => {
|
it('renders a grid with 2 Grid rows for wide tables', () => {
|
||||||
const wideTableColumns = MAX_COLUMNS_FOR_TABLE + 1;
|
const wideTableColumns = MAX_COLUMNS_FOR_TABLE + 1;
|
||||||
|
@ -223,7 +223,7 @@ export default class FilterableTable extends PureComponent {
|
|||||||
const cellValue = row[key];
|
const cellValue = row[key];
|
||||||
if (typeof cellValue === 'string') {
|
if (typeof cellValue === 'string') {
|
||||||
values.push(cellValue.toLowerCase());
|
values.push(cellValue.toLowerCase());
|
||||||
} else if (typeof cellValue.toString === 'function') {
|
} else if (cellValue !== null && typeof cellValue.toString === 'function') {
|
||||||
values.push(cellValue.toString());
|
values.push(cellValue.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user