mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-23 09:22:18 +00:00
fix the table row issue and make sample data table header fix (#15268)
This commit is contained in:
parent
1cbe09c8ac
commit
9c46391e73
@ -94,18 +94,19 @@ const SampleDataTable = ({
|
||||
name: column,
|
||||
dataType: matchedColumn?.dataType ?? '',
|
||||
title: (
|
||||
<Space direction="vertical" size={0}>
|
||||
<div className="d-flex flex-column">
|
||||
<Typography.Text> {column}</Typography.Text>
|
||||
{matchedColumn?.dataType && (
|
||||
<Typography.Text className="text-grey-muted text-xs font-normal">{`(${lowerCase(
|
||||
matchedColumn?.dataType ?? ''
|
||||
)})`}</Typography.Text>
|
||||
)}
|
||||
</Space>
|
||||
</div>
|
||||
),
|
||||
dataIndex: column,
|
||||
key: column,
|
||||
accessor: column,
|
||||
width: 210,
|
||||
render: (data: SampleDataType) => <RowData data={data} />,
|
||||
};
|
||||
});
|
||||
@ -264,7 +265,7 @@ const SampleDataTable = ({
|
||||
dataSource={sampleData?.rows}
|
||||
pagination={false}
|
||||
rowKey="name"
|
||||
scroll={{ x: true }}
|
||||
scroll={{ y: 'calc(100vh - 160px)' }}
|
||||
size="small"
|
||||
/>
|
||||
|
||||
|
@ -53,6 +53,7 @@ import {
|
||||
searchTagInData,
|
||||
} from '../../../utils/TableTags/TableTags.utils';
|
||||
import {
|
||||
getAllRowKeysByKeyName,
|
||||
getFilterIcon,
|
||||
getTableExpandableConfig,
|
||||
makeData,
|
||||
@ -121,6 +122,12 @@ const SchemaTable = ({
|
||||
[searchedColumns]
|
||||
);
|
||||
|
||||
const nestedTableFqnKeys = useMemo(
|
||||
() =>
|
||||
getAllRowKeysByKeyName<Column>(tableColumns ?? [], 'fullyQualifiedName'),
|
||||
[tableColumns]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isEmpty(decodedEntityFqn)) {
|
||||
fetchResourcePermission(decodedEntityFqn);
|
||||
@ -459,10 +466,8 @@ const SchemaTable = ({
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setExpandedRowKeys(() =>
|
||||
data.map((value) => value?.fullyQualifiedName ?? '')
|
||||
);
|
||||
}, [data]);
|
||||
setExpandedRowKeys(nestedTableFqnKeys);
|
||||
}, [searchText]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -515,7 +515,9 @@ export const prepareConstraintIcon = ({
|
||||
);
|
||||
};
|
||||
|
||||
export const getAllRowKeysByKeyName = <T extends Field | SearchIndexField>(
|
||||
export const getAllRowKeysByKeyName = <
|
||||
T extends Column | Field | SearchIndexField
|
||||
>(
|
||||
data: T[],
|
||||
keyName: keyof T
|
||||
) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user