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