From f3d3fd453b6c229173858eefef91f8ef978a9c39 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Fri, 16 Dec 2022 14:08:55 +0530 Subject: [PATCH] UI : Lineage UI improvement (#9312) * Lineage UI improvement * added util function for name --- .../src/components/EntityLineage/CustomControls.component.tsx | 3 ++- .../src/main/resources/ui/src/constants/Lineage.constants.ts | 4 ++-- .../src/main/resources/ui/src/utils/EntityLineageUtils.tsx | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/CustomControls.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/CustomControls.component.tsx index e8306c3d0fa..c53b4dd0106 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/CustomControls.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/EntityLineage/CustomControls.component.tsx @@ -32,6 +32,7 @@ import { ZOOM_SLIDER_STEP, ZOOM_TRANSITION_DURATION, } from '../../constants/Lineage.constants'; +import { getEntityName } from '../../utils/CommonUtils'; import { getLoadingStatusValue } from '../../utils/EntityLineageUtils'; import SVGIcons, { Icons } from '../../utils/SvgUtils'; import { ControlProps } from './EntityLineage.interface'; @@ -128,7 +129,7 @@ const CustomControls: FC = ({ const nodeOptions = useMemo( () => [lineageData.entity, ...(lineageData.nodes || [])].map((node) => ({ - label: node.fullyQualifiedName || node.name || '', + label: getEntityName(node), value: node.id, })), [lineageData] diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/Lineage.constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/Lineage.constants.ts index f59189e9098..b83e02cb3c7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/Lineage.constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/Lineage.constants.ts @@ -25,8 +25,8 @@ export const entityData = [ export const POSITION_X = 150; export const POSITION_Y = 60; -export const NODE_WIDTH = 600; -export const NODE_HEIGHT = 70; +export const NODE_WIDTH = 400; +export const NODE_HEIGHT = 50; export const EXPANDED_NODE_HEIGHT = 300; export const ELEMENT_DELETE_STATE = { diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.tsx index 048d806fc2a..6984a16f4e2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityLineageUtils.tsx @@ -47,9 +47,9 @@ import { FQN_SEPARATOR_CHAR } from '../constants/char.constants'; import { SECONDARY_COLOR } from '../constants/constants'; import { EXPANDED_NODE_HEIGHT, + MIN_ZOOM_VALUE, NODE_HEIGHT, NODE_WIDTH, - ZOOM_VALUE, } from '../constants/Lineage.constants'; import { EntityLineageDirection, @@ -106,7 +106,7 @@ export const getHeaderLabel = ( export const onLoad = (reactFlowInstance: ReactFlowInstance) => { reactFlowInstance.fitView(); - reactFlowInstance.zoomTo(ZOOM_VALUE); + reactFlowInstance.zoomTo(MIN_ZOOM_VALUE); }; /* eslint-disable-next-line */ export const onNodeMouseEnter = (_event: ReactMouseEvent, _node: Node) => {