mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-27 09:55:36 +00:00
Fixed frequently joined col to trim more than 3 entries (#148)
This commit is contained in:
parent
78e54d73b2
commit
672bb9bea3
@ -35,6 +35,7 @@ import {
|
|||||||
import SVGIcons from '../../utils/SvgUtils';
|
import SVGIcons from '../../utils/SvgUtils';
|
||||||
import { getConstraintIcon } from '../../utils/TableUtils';
|
import { getConstraintIcon } from '../../utils/TableUtils';
|
||||||
import { getTagCategories, getTaglist } from '../../utils/TagsUtils';
|
import { getTagCategories, getTaglist } from '../../utils/TagsUtils';
|
||||||
|
import PopOver from '../common/popover/PopOver';
|
||||||
import RichTextEditorPreviewer from '../common/rich-text-editor/RichTextEditorPreviewer';
|
import RichTextEditorPreviewer from '../common/rich-text-editor/RichTextEditorPreviewer';
|
||||||
// import { EditSchemaColumnModal } from '../Modals/EditSchemaColumnModal/EditSchemaColumnModal';
|
// import { EditSchemaColumnModal } from '../Modals/EditSchemaColumnModal/EditSchemaColumnModal';
|
||||||
import { ModalWithMarkdownEditor } from '../Modals/ModalWithMarkdownEditor/ModalWithMarkdownEditor';
|
import { ModalWithMarkdownEditor } from '../Modals/ModalWithMarkdownEditor/ModalWithMarkdownEditor';
|
||||||
@ -202,6 +203,7 @@ const SchemaTable: FunctionComponent<Props> = ({
|
|||||||
setEditColumn(undefined);
|
setEditColumn(undefined);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!searchText) {
|
if (!searchText) {
|
||||||
setSearchedColumns(columns);
|
setSearchedColumns(columns);
|
||||||
@ -292,8 +294,9 @@ const SchemaTable: FunctionComponent<Props> = ({
|
|||||||
<span className="tw-text-gray-400 tw-mr-1">
|
<span className="tw-text-gray-400 tw-mr-1">
|
||||||
Frequently joined columns:
|
Frequently joined columns:
|
||||||
</span>
|
</span>
|
||||||
{getFrequentlyJoinedWithColumns(column.name).map(
|
{getFrequentlyJoinedWithColumns(column.name)
|
||||||
(columnJoin, index) => (
|
.slice(0, 3)
|
||||||
|
.map((columnJoin, index) => (
|
||||||
<Fragment key={index}>
|
<Fragment key={index}>
|
||||||
{index > 0 && <span className="tw-mr-1">,</span>}
|
{index > 0 && <span className="tw-mr-1">,</span>}
|
||||||
<Link
|
<Link
|
||||||
@ -314,7 +317,42 @@ const SchemaTable: FunctionComponent<Props> = ({
|
|||||||
)}
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)
|
))}
|
||||||
|
{getFrequentlyJoinedWithColumns(column.name).length >
|
||||||
|
3 && (
|
||||||
|
<PopOver
|
||||||
|
html={
|
||||||
|
<div className="tw-text-left">
|
||||||
|
{getFrequentlyJoinedWithColumns(column.name)
|
||||||
|
?.slice(3)
|
||||||
|
.map((columnJoin, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<a
|
||||||
|
className="link-text tw-block tw-py-1"
|
||||||
|
href={getDatasetDetailsPath(
|
||||||
|
getTableFQNFromColumnFQN(
|
||||||
|
columnJoin.fullyQualifiedName
|
||||||
|
),
|
||||||
|
getPartialNameFromFQN(
|
||||||
|
columnJoin.fullyQualifiedName,
|
||||||
|
['column']
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
onClick={handleClick}>
|
||||||
|
{getPartialNameFromFQN(
|
||||||
|
columnJoin.fullyQualifiedName,
|
||||||
|
['database', 'table', 'column']
|
||||||
|
)}
|
||||||
|
</a>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
position="bottom"
|
||||||
|
theme="light"
|
||||||
|
trigger="click">
|
||||||
|
<span className="show-more tw-ml-1">...</span>
|
||||||
|
</PopOver>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user