From a2694c6664d3fa47db0cf542cfed9e65e32c303d Mon Sep 17 00:00:00 2001 From: Dhruv Parmar <83108871+dhruvjsx@users.noreply.github.com> Date: Fri, 13 Jun 2025 03:20:13 +0530 Subject: [PATCH] Fix (ui) : tooltip for follower , manage button and Data asset tree (#21465) * fix tooltip * fixed tooltip text * removed nested contions * removed unwated code * fixed mlmodel tooltip * fixed tree tooltip * addressed comments * fixed sonar tests * added classes to integrated with collate * reused entityUtilsClassBase * cleaned file * addressed comments * removed unncessary code * fixed sonar tests * fixed sonar tests * fixed comments --- .../EntityHeaderTitle.component.tsx | 11 +- .../ExploreTree/ExploreTree.interface.ts | 1 + .../Explore/ExploreTree/ExploreTree.tsx | 66 +++++---- .../DataAssetCard/DataAssetCard.component.tsx | 7 +- .../DataAssetCard/DataAssetCard.test.tsx | 2 +- .../ManageButton/ManageButton.tsx | 10 +- .../ui/src/locale/languages/de-de.json | 21 +++ .../ui/src/locale/languages/en-us.json | 21 +++ .../ui/src/locale/languages/es-es.json | 21 +++ .../ui/src/locale/languages/fr-fr.json | 21 +++ .../ui/src/locale/languages/gl-es.json | 21 +++ .../ui/src/locale/languages/he-he.json | 21 +++ .../ui/src/locale/languages/ja-jp.json | 21 +++ .../ui/src/locale/languages/ko-kr.json | 21 +++ .../ui/src/locale/languages/mr-in.json | 21 +++ .../ui/src/locale/languages/nl-nl.json | 21 +++ .../ui/src/locale/languages/pr-pr.json | 21 +++ .../ui/src/locale/languages/pt-br.json | 21 +++ .../ui/src/locale/languages/pt-pt.json | 21 +++ .../ui/src/locale/languages/ru-ru.json | 21 +++ .../ui/src/locale/languages/th-th.json | 21 +++ .../ui/src/locale/languages/tr-tr.json | 21 +++ .../ui/src/locale/languages/zh-cn.json | 21 +++ .../ui/src/utils/EntityUtilClassBase.ts | 63 +++++++++ .../ui/src/utils/EntityUtils.interface.ts | 126 ++++++++++++++++++ .../resources/ui/src/utils/EntityUtils.tsx | 76 +++++++++++ .../ui/src/utils/ServiceUtilClassBase.ts | 90 +------------ 27 files changed, 689 insertions(+), 120 deletions(-) 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 8ada53fffb4..7baba43310a 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 @@ -13,7 +13,7 @@ import Icon, { ExclamationCircleFilled } from '@ant-design/icons'; import { Badge, Button, Col, Row, Tooltip, Typography } from 'antd'; import classNames from 'classnames'; -import { capitalize, isEmpty } from 'lodash'; +import { isEmpty } from 'lodash'; import React, { useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; @@ -21,8 +21,10 @@ import { ReactComponent as ShareIcon } from '../../../assets/svg/copy-right.svg' import { ReactComponent as IconExternalLink } from '../../../assets/svg/external-link-grey.svg'; import { ReactComponent as StarFilledIcon } from '../../../assets/svg/ic-star-filled.svg'; import { ROUTES } from '../../../constants/constants'; +import { EntityType } from '../../../enums/entity.enum'; import { useClipboard } from '../../../hooks/useClipBoard'; import useCustomLocation from '../../../hooks/useCustomLocation/useCustomLocation'; +import entityUtilClassBase from '../../../utils/EntityUtilClassBase'; import { getEntityName } from '../../../utils/EntityUtils'; import { stringToHTML } from '../../../utils/StringsUtils'; import './entity-header-title.less'; @@ -66,6 +68,11 @@ const EntityHeaderTitle = ({ [location.pathname] ); + const formattedEntityType = useMemo( + () => entityUtilClassBase.getFormattedEntityType(entityType as EntityType), + [entityType] + ); + const entityName = useMemo( () => stringToHTML( @@ -180,7 +187,7 @@ const EntityHeaderTitle = ({