fix(sqllab): Broken query containing 'children' (#25490)

This commit is contained in:
JUST.in DO IT 2023-10-04 11:06:01 -07:00 committed by GitHub
parent dab18250d7
commit b92957e510
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -25,11 +25,11 @@ import userEvent from '@testing-library/user-event';
describe('FilterableTable', () => {
const mockedProps = {
orderedColumnKeys: ['a', 'b', 'c'],
orderedColumnKeys: ['a', 'b', 'c', 'children'],
data: [
{ a: 'a1', b: 'b1', c: 'c1', d: 0 },
{ a: 'a2', b: 'b2', c: 'c2', d: 100 },
{ a: null, b: 'b3', c: 'c3', d: 50 },
{ a: 'a1', b: 'b1', c: 'c1', d: 0, children: 0 },
{ a: 'a2', b: 'b2', c: 'c2', d: 100, children: 2 },
{ a: null, b: 'b3', c: 'c3', d: 50, children: 1 },
],
height: 500,
};

View File

@ -366,6 +366,7 @@ const FilterableTable = ({
usePagination={false}
columns={columns}
data={filteredList}
childrenColumnName=""
virtualize
bordered
/>

View File

@ -150,6 +150,12 @@ export interface TableProps<RecordType> {
* only supported for virtualize == true
*/
allowHTML?: boolean;
/**
* The column that contains children to display.
* Check https://ant.design/components/table#table for more details.
*/
childrenColumnName?: string;
}
const defaultRowSelection: React.Key[] = [];
@ -259,6 +265,7 @@ export function Table<RecordType extends object>(
recordCount,
onRow,
allowHTML = false,
childrenColumnName,
} = props;
const wrapperRef = useRef<HTMLDivElement | null>(null);
@ -392,6 +399,9 @@ export function Table<RecordType extends object>(
theme,
height: bodyHeight,
bordered,
expandable: {
childrenColumnName,
},
};
return (