mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-25 10:20:10 +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,
|
name: column,
|
||||||
dataType: matchedColumn?.dataType ?? '',
|
dataType: matchedColumn?.dataType ?? '',
|
||||||
title: (
|
title: (
|
||||||
<Space direction="vertical" size={0}>
|
<div className="d-flex flex-column">
|
||||||
<Typography.Text> {column}</Typography.Text>
|
<Typography.Text> {column}</Typography.Text>
|
||||||
{matchedColumn?.dataType && (
|
{matchedColumn?.dataType && (
|
||||||
<Typography.Text className="text-grey-muted text-xs font-normal">{`(${lowerCase(
|
<Typography.Text className="text-grey-muted text-xs font-normal">{`(${lowerCase(
|
||||||
matchedColumn?.dataType ?? ''
|
matchedColumn?.dataType ?? ''
|
||||||
)})`}</Typography.Text>
|
)})`}</Typography.Text>
|
||||||
)}
|
)}
|
||||||
</Space>
|
</div>
|
||||||
),
|
),
|
||||||
dataIndex: column,
|
dataIndex: column,
|
||||||
key: column,
|
key: column,
|
||||||
accessor: column,
|
accessor: column,
|
||||||
|
width: 210,
|
||||||
render: (data: SampleDataType) => <RowData data={data} />,
|
render: (data: SampleDataType) => <RowData data={data} />,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@ -264,7 +265,7 @@ const SampleDataTable = ({
|
|||||||
dataSource={sampleData?.rows}
|
dataSource={sampleData?.rows}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
rowKey="name"
|
rowKey="name"
|
||||||
scroll={{ x: true }}
|
scroll={{ y: 'calc(100vh - 160px)' }}
|
||||||
size="small"
|
size="small"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ import {
|
|||||||
searchTagInData,
|
searchTagInData,
|
||||||
} from '../../../utils/TableTags/TableTags.utils';
|
} from '../../../utils/TableTags/TableTags.utils';
|
||||||
import {
|
import {
|
||||||
|
getAllRowKeysByKeyName,
|
||||||
getFilterIcon,
|
getFilterIcon,
|
||||||
getTableExpandableConfig,
|
getTableExpandableConfig,
|
||||||
makeData,
|
makeData,
|
||||||
@ -121,6 +122,12 @@ const SchemaTable = ({
|
|||||||
[searchedColumns]
|
[searchedColumns]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const nestedTableFqnKeys = useMemo(
|
||||||
|
() =>
|
||||||
|
getAllRowKeysByKeyName<Column>(tableColumns ?? [], 'fullyQualifiedName'),
|
||||||
|
[tableColumns]
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isEmpty(decodedEntityFqn)) {
|
if (!isEmpty(decodedEntityFqn)) {
|
||||||
fetchResourcePermission(decodedEntityFqn);
|
fetchResourcePermission(decodedEntityFqn);
|
||||||
@ -459,10 +466,8 @@ const SchemaTable = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setExpandedRowKeys(() =>
|
setExpandedRowKeys(nestedTableFqnKeys);
|
||||||
data.map((value) => value?.fullyQualifiedName ?? '')
|
}, [searchText]);
|
||||||
);
|
|
||||||
}, [data]);
|
|
||||||
|
|
||||||
return (
|
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[],
|
data: T[],
|
||||||
keyName: keyof T
|
keyName: keyof T
|
||||||
) => {
|
) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user