From ec3eda8ae03a3bd732097f8a3bce7ead012fbbf0 Mon Sep 17 00:00:00 2001 From: Dhruv Parmar <83108871+dhruvjsx@users.noreply.github.com> Date: Tue, 3 Jun 2025 11:01:10 +0530 Subject: [PATCH] fix(ui): fixed entity header truncate issue (#21489) * fixed entity header * remove fixed value * removed unnnecessary changers * removed unnnecessary changers * centered all the button for glossery header * fixed badge wrapping * fixed sonar test cases * removed row col from glossery header * fixed spacing --- .../EntityHeaderTitle.component.tsx | 2 +- .../EntityInfoDrawer/entity-info-drawer.less | 6 +++++ .../GlossaryHeader.component.tsx | 24 +++++++++---------- .../GlossaryHeader/glossery-header.less | 21 ++++++++++++++++ 4 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/glossery-header.less diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeaderTitle/EntityHeaderTitle.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeaderTitle/EntityHeaderTitle.component.tsx index f46a4c668c3..8ada53fffb4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeaderTitle/EntityHeaderTitle.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityHeaderTitle/EntityHeaderTitle.component.tsx @@ -204,7 +204,7 @@ const EntityHeaderTitle = ({ return link && !isTourRoute ? ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/entity-info-drawer.less b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/entity-info-drawer.less index 120993e8094..9b5b9f3c2dc 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/entity-info-drawer.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityInfoDrawer/entity-info-drawer.less @@ -34,6 +34,12 @@ .ant-drawer-header { border-bottom: none; + align-items: flex-start; + } + + .entity-header-title-link { + // added to fix title overlap with close button + max-width: 90%; } .ant-drawer-body { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx index d0c2429b63b..8f79c0a0d66 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryHeader/GlossaryHeader.component.tsx @@ -11,13 +11,13 @@ * limitations under the License. */ import Icon, { DownOutlined } from '@ant-design/icons'; -import { Button, Col, Dropdown, Row, Space, Tooltip, Typography } from 'antd'; +import { Button, Dropdown, Space, Tooltip, Typography } from 'antd'; import ButtonGroup from 'antd/lib/button/button-group'; import { ItemType } from 'antd/lib/menu/hooks/useItems'; import { AxiosError } from 'axios'; import classNames from 'classnames'; import { compare } from 'fast-json-patch'; -import { cloneDeep, toString } from 'lodash'; +import { cloneDeep, isEmpty, toString } from 'lodash'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useHistory, useParams } from 'react-router-dom'; @@ -77,7 +77,7 @@ import ChangeParentHierarchy from '../../Modals/ChangeParentHierarchy/ChangePare import StyleModal from '../../Modals/StyleModal/StyleModal.component'; import { GlossaryStatusBadge } from '../GlossaryStatusBadge/GlossaryStatusBadge.component'; import { GlossaryHeaderProps } from './GlossaryHeader.interface'; - +import './glossery-header.less'; const GlossaryHeader = ({ onDelete, onAssetAdd, @@ -257,8 +257,8 @@ const GlossaryHeader = ({ const onStyleSave = async (data: Style) => { const style: Style = { // if color/iconURL is empty or undefined send undefined - color: data.color ? data.color : undefined, - iconURL: data.iconURL ? data.iconURL : undefined, + color: !isEmpty(data.color) ? data.color : undefined, + iconURL: !isEmpty(data.iconURL) ? data.iconURL : undefined, }; const updatedDetails = { ...selectedData, @@ -543,7 +543,7 @@ const GlossaryHeader = ({ useEffect(() => { const { fullyQualifiedName, name } = selectedData; - handleBreadcrumb(fullyQualifiedName ? fullyQualifiedName : name); + handleBreadcrumb(fullyQualifiedName ?? name); }, [selectedData]); useEffect(() => { @@ -554,8 +554,8 @@ const GlossaryHeader = ({ return ( <> - - +
+
- - +
+
{!isVersionView && createButtons} @@ -642,8 +642,8 @@ const GlossaryHeader = ({ )}
- - +
+
{selectedData && (