Fixed: Struct type columns not expanding in UI #8907 (#8915)

* Fixed: Struct type columns not expanding in UI #8907

* updated expand icon logic
This commit is contained in:
Shailesh Parmar 2022-11-21 17:58:38 +05:30 committed by GitHub
parent 27997b2f77
commit edadfba9b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -680,20 +680,22 @@ const EntityTable = ({
data-testid="entity-table" data-testid="entity-table"
dataSource={data} dataSource={data}
expandable={{ expandable={{
defaultExpandedRowKeys: [], rowExpandable: (record) => {
expandIcon: ({ expanded, onExpand, record }) => return (record.children && record.children.length > 0) || false;
record.children ? ( },
<FontAwesomeIcon expandIcon: ({ expanded, onExpand, expandable, record }) =>
className="tw-mr-2 tw-cursor-pointer" expandable && (
icon={expanded ? faCaretDown : faCaretRight} <span
className="m-r-xs cursor-pointer"
onClick={(e) => onClick={(e) =>
onExpand( onExpand(
record, record,
e as unknown as React.MouseEvent<HTMLElement, MouseEvent> e as unknown as React.MouseEvent<HTMLElement, MouseEvent>
) )
} }>
/> <FontAwesomeIcon icon={expanded ? faCaretDown : faCaretRight} />
) : null, </span>
),
}} }}
pagination={false} pagination={false}
size="small" size="small"