diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/SampleDataTable/SampleDataTable.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/SampleDataTable/SampleDataTable.component.tsx index db3b925321b..8e73cd7b208 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/SampleDataTable/SampleDataTable.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/SampleDataTable/SampleDataTable.component.tsx @@ -94,18 +94,19 @@ const SampleDataTable = ({ name: column, dataType: matchedColumn?.dataType ?? '', title: ( - +
{column} {matchedColumn?.dataType && ( {`(${lowerCase( matchedColumn?.dataType ?? '' )})`} )} - +
), dataIndex: column, key: column, accessor: column, + width: 210, render: (data: SampleDataType) => , }; }); @@ -264,7 +265,7 @@ const SampleDataTable = ({ dataSource={sampleData?.rows} pagination={false} rowKey="name" - scroll={{ x: true }} + scroll={{ y: 'calc(100vh - 160px)' }} size="small" /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/SchemaTable/SchemaTable.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/SchemaTable/SchemaTable.component.tsx index eb2dfcac70c..3c3d2bf8267 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/SchemaTable/SchemaTable.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/SchemaTable/SchemaTable.component.tsx @@ -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(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 ( <> diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx index 39af62d6e5e..d8c7b1a6462 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx @@ -515,7 +515,9 @@ export const prepareConstraintIcon = ({ ); }; -export const getAllRowKeysByKeyName = ( +export const getAllRowKeysByKeyName = < + T extends Column | Field | SearchIndexField +>( data: T[], keyName: keyof T ) => {