diff --git a/openmetadata-ui/src/main/resources/ui/src/assets/svg/kpi.svg b/openmetadata-ui/src/main/resources/ui/src/assets/svg/kpi.svg index 29cbd505f54..76200b180f7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/assets/svg/kpi.svg +++ b/openmetadata-ui/src/main/resources/ui/src/assets/svg/kpi.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardHeader/FeedCardHeaderV2.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardHeader/FeedCardHeaderV2.test.tsx index c4ccbc2a6fa..f4c61d55552 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardHeader/FeedCardHeaderV2.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardHeader/FeedCardHeaderV2.test.tsx @@ -20,7 +20,7 @@ import { } from '../../../../generated/entity/feed/thread'; import FeedCardHeaderV2 from './FeedCardHeaderV2'; -jest.mock('../../../../utils/TableUtils', () => ({ +jest.mock('../../../../utils/SearchClassBase', () => ({ getEntityIcon: jest.fn().mockReturnValue('entityIcon'), })); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardHeader/FeedCardHeaderV2.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardHeader/FeedCardHeaderV2.tsx index 7bacb1fc562..dd07c635c9e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardHeader/FeedCardHeaderV2.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardV2/FeedCardHeader/FeedCardHeaderV2.tsx @@ -36,7 +36,7 @@ import { ASSET_CARD_STYLES } from '../../../../constants/Feeds.constants'; import { EntityType } from '../../../../enums/entity.enum'; import { CardStyle } from '../../../../generated/entity/feed/thread'; import entityUtilClassBase from '../../../../utils/EntityUtilClassBase'; -import { getEntityIcon } from '../../../../utils/TableUtils'; +import searchClassBase from '../../../../utils/SearchClassBase'; import UserPopOverCard from '../../../common/PopOverCard/UserPopOverCard'; import './feed-card-header-v2.less'; import { FeedCardHeaderV2Props } from './FeedCardHeaderV2.interface'; @@ -101,7 +101,7 @@ const FeedCardHeaderV2 = ({ <> - {getEntityIcon(entityType ?? '')} + {searchClassBase.getEntityIcon(entityType ?? '')} - {getEntityIcon(entityType ?? '')} + {searchClassBase.getEntityIcon(entityType ?? '')} {feed?.entityRef diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/FeedEditor/FeedEditor.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/FeedEditor/FeedEditor.tsx index 711b92d37b4..737a7af0355 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/FeedEditor/FeedEditor.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/FeedEditor/FeedEditor.tsx @@ -45,7 +45,7 @@ import { import { LinkBlot } from '../../../utils/QuillLink/QuillLink'; import { insertMention, insertRef } from '../../../utils/QuillUtils'; import { getSanitizeContent } from '../../../utils/sanitize.utils'; -import { getEntityIcon } from '../../../utils/TableUtils'; +import searchClassBase from '../../../utils/SearchClassBase'; import { editorRef } from '../../common/RichTextEditor/RichTextEditor.interface'; import './feed-editor.less'; import { FeedEditorProp, MentionSuggestionsItem } from './FeedEditor.interface'; @@ -140,7 +140,7 @@ export const FeedEditor = forwardRef( ` : ''; - const icon = getEntityIcon(item.type as string); + const icon = searchClassBase.getEntityIcon(item.type ?? ''); const iconString = ReactDOMServer.renderToString(icon ?? <>); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/BlockEditor/Extensions/hashtag/HashList.tsx b/openmetadata-ui/src/main/resources/ui/src/components/BlockEditor/Extensions/hashtag/HashList.tsx index d447a0d99d6..acaceb81e32 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/BlockEditor/Extensions/hashtag/HashList.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/BlockEditor/Extensions/hashtag/HashList.tsx @@ -15,7 +15,7 @@ import { Space, Typography } from 'antd'; import classNames from 'classnames'; import React, { forwardRef, useImperativeHandle, useState } from 'react'; import { isInViewport } from '../../../../utils/BlockEditorUtils'; -import { getEntityIcon } from '../../../../utils/TableUtils'; +import searchClassBase from '../../../../utils/SearchClassBase'; import { ExtensionRef, SuggestionItem } from '../../BlockEditor.interface'; export default forwardRef< @@ -128,7 +128,7 @@ export default forwardRef<
- {getEntityIcon(item.type)} + {searchClassBase.getEntityIcon(item.type)}
{item.label} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetAsyncSelectList/DataAssetAsyncSelectList.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetAsyncSelectList/DataAssetAsyncSelectList.tsx index 03172434565..eea3e0c55b5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetAsyncSelectList/DataAssetAsyncSelectList.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataAssets/DataAssetAsyncSelectList/DataAssetAsyncSelectList.tsx @@ -24,7 +24,7 @@ import { getEntityName, getEntityReferenceFromEntity, } from '../../../utils/EntityUtils'; -import { getEntityIcon } from '../../../utils/TableUtils'; +import searchClassBase from '../../../utils/SearchClassBase'; import { showErrorToast } from '../../../utils/ToastUtils'; import Loader from '../../common/Loader/Loader'; import ProfilePicture from '../../common/ProfilePicture/ProfilePicture'; @@ -155,7 +155,7 @@ const DataAssetAsyncSelectList: FC = ({ className="d-flex items-center gap-2" data-testid={`option-${value}`}>
- {getEntityIcon(reference.type)} + {searchClassBase.getEntityIcon(reference.type)}
{reference.type} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/AppPipelineModel/AddPipeLineModal.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/AppPipelineModel/AddPipeLineModal.tsx index ae2fa3d83c7..50406275c4c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/AppPipelineModel/AddPipeLineModal.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/AppPipelineModel/AddPipeLineModal.tsx @@ -29,7 +29,7 @@ import { getEntityReferenceFromEntity, } from '../../../../utils/EntityUtils'; import Fqn from '../../../../utils/Fqn'; -import { getEntityIcon } from '../../../../utils/TableUtils'; +import searchClassBase from '../../../../utils/SearchClassBase'; import { showErrorToast } from '../../../../utils/ToastUtils'; import '../../../ActivityFeed/FeedEditor/feed-editor.less'; import ErrorPlaceHolder from '../../../common/ErrorWithPlaceholder/ErrorPlaceHolder'; @@ -157,7 +157,7 @@ const AddPipeLineModal = ({
{edgeOptions.map((item) => { - const icon = getEntityIcon(item.type); + const icon = searchClassBase.getEntityIcon(item.type); const breadcrumb = Fqn.split(item.fullyQualifiedName ?? '').join('/'); return ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/EntityLineageSidebar.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/EntityLineageSidebar.component.tsx index 31a0d5864e9..d4d83a67641 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/EntityLineageSidebar.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/EntityLineageSidebar.component.tsx @@ -20,7 +20,7 @@ import { Node } from 'reactflow'; import { ReactComponent as DragIconDotted } from '../../../assets/svg/dots-six-bold.svg'; import { entityData } from '../../../constants/Lineage.constants'; import { useApplicationStore } from '../../../hooks/useApplicationStore'; -import { getEntityIcon } from '../../../utils/TableUtils'; +import searchClassBase from '../../../utils/SearchClassBase'; import './entity-lineage-sidebar.less'; interface SidebarProps extends HTMLAttributes { @@ -56,7 +56,7 @@ const EntityNode: FC = ({ type, label, draggable }) => { e.preventDefault(); e.stopPropagation(); }}> - {getEntityIcon(type || '')} + {searchClassBase.getEntityIcon(type ?? '')} { @@ -47,7 +47,7 @@ const LineageLayers = () => { onClick={() => onButtonClick(LineageLayerView.COLUMN)}>
- {getEntityIcon(EntityType.TABLE)} + {searchClassBase.getEntityIcon(EntityType.TABLE)}
{t('label.column')} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageSearchSelect/LineageSearchSelect.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageSearchSelect/LineageSearchSelect.tsx index 240471f8c4b..7b99c456887 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageSearchSelect/LineageSearchSelect.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/LineageSearchSelect/LineageSearchSelect.tsx @@ -22,8 +22,8 @@ import { useLineageProvider } from '../../../../context/LineageProvider/LineageP import { Column } from '../../../../generated/entity/data/table'; import { getEntityChildrenAndLabel } from '../../../../utils/EntityLineageUtils'; import { getEntityName } from '../../../../utils/EntityUtils'; +import searchClassBase from '../../../../utils/SearchClassBase'; import serviceUtilClassBase from '../../../../utils/ServiceUtilClassBase'; -import { getEntityIcon } from '../../../../utils/TableUtils'; const LineageSearchSelect = () => { const { t } = useTranslation(); @@ -85,7 +85,7 @@ const LineageSearchSelect = () => {
- {getEntityIcon(node.entityType ?? '')} + {searchClassBase.getEntityIcon(node.entityType ?? '')}
{getEntityName(column)}
diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/NodeChildren/NodeChildren.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/NodeChildren/NodeChildren.component.tsx index bdacf4163d5..1ac8f1ce1d4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/NodeChildren/NodeChildren.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityLineage/NodeChildren/NodeChildren.component.tsx @@ -26,7 +26,7 @@ import { EntityType } from '../../../../enums/entity.enum'; import { Column, Table } from '../../../../generated/entity/data/table'; import { getEntityChildrenAndLabel } from '../../../../utils/EntityLineageUtils'; import { getEntityName } from '../../../../utils/EntityUtils'; -import { getEntityIcon } from '../../../../utils/TableUtils'; +import searchClassBase from '../../../../utils/SearchClassBase'; import { getColumnContent } from '../CustomNode.utils'; import TestSuiteSummaryWidget from '../TestSuiteSummaryWidget/TestSuiteSummaryWidget.component'; import { EntityChildren, NodeChildrenProps } from './NodeChildren.interface'; @@ -200,7 +200,7 @@ const NodeChildren = ({ node, isConnectable }: NodeChildrenProps) => { }}>
- {getEntityIcon(node.entityType ?? '')} + {searchClassBase.getEntityIcon(node.entityType ?? '')}
{childrenHeading} {isExpanded ? ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityList/EntityList.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityList/EntityList.tsx index 561a2f28a8a..00f4ad933f9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityList/EntityList.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityList/EntityList.tsx @@ -18,7 +18,7 @@ import { Link } from 'react-router-dom'; import { EntityReference } from '../../../generated/entity/type'; import entityUtilClassBase from '../../../utils/EntityUtilClassBase'; import { getEntityName } from '../../../utils/EntityUtils'; -import { getEntityIcon } from '../../../utils/TableUtils'; +import searchClassBase from '../../../utils/SearchClassBase'; import EntityListSkeleton from '../../common/Skeleton/MyData/EntityListSkeleton/EntityListSkeleton.component'; import './entity.less'; @@ -75,7 +75,7 @@ export const EntityListWithV1: FunctionComponent = ({ className="entity-button flex-center p-0 m--ml-1" icon={
- {getEntityIcon(item.type || '')} + {searchClassBase.getEntityIcon(item.type || '')}
} title={getEntityName( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExploreTree/ExploreTree.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExploreTree/ExploreTree.tsx index 044969a93a4..1afbf9a5e47 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExploreTree/ExploreTree.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Explore/ExploreTree/ExploreTree.tsx @@ -33,7 +33,6 @@ import { } from '../../../utils/ExploreUtils'; import searchClassBase from '../../../utils/SearchClassBase'; import serviceUtilClassBase from '../../../utils/ServiceUtilClassBase'; -import { getEntityIcon } from '../../../utils/TableUtils'; import { showErrorToast } from '../../../utils/ToastUtils'; import { UrlParams } from '../ExplorePage.interface'; import { @@ -136,7 +135,10 @@ const ExploreTree = ({ onFieldValueSelect }: ExploreTreeProps) => { let logo = undefined; if (isEntityType) { - logo = getEntityIcon(bucket.key, 'service-icon w-4 h-4') ?? <>; + logo = searchClassBase.getEntityIcon( + bucket.key, + 'service-icon w-4 h-4' + ) ?? <>; } else if (isServiceType) { const serviceIcon = serviceUtilClassBase.getServiceLogo(bucket.key); logo = ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx index d505a1bf097..a62129188f7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ExploreV1/ExploreSearchCard/ExploreSearchCard.tsx @@ -33,7 +33,7 @@ import { getEntityId, getEntityName } from '../../../utils/EntityUtils'; import { getDomainPath } from '../../../utils/RouterUtils'; import searchClassBase from '../../../utils/SearchClassBase'; import { stringToHTML } from '../../../utils/StringsUtils'; -import { getEntityIcon, getUsagePercentile } from '../../../utils/TableUtils'; +import { getUsagePercentile } from '../../../utils/TableUtils'; import TitleBreadcrumb from '../../common/TitleBreadcrumb/TitleBreadcrumb.component'; import TableDataCardBody from '../../Database/TableDataCardBody/TableDataCardBody'; import { GlossaryStatusBadge } from '../../Glossary/GlossaryStatusBadge/GlossaryStatusBadge.component'; @@ -166,13 +166,13 @@ const ExploreSearchCard: React.FC = forwardRef< return ( - {getEntityIcon(source.entityType ?? '')} + {searchClassBase.getEntityIcon(source.entityType ?? '')} ); } return; - }, [source, showEntityIcon, getEntityIcon]); + }, [source, showEntityIcon]); const entityLink = useMemo( () => searchClassBase.getEntityLink(source), diff --git a/openmetadata-ui/src/main/resources/ui/src/components/MyData/MyDataWidget/MyDataWidget.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/MyData/MyDataWidget/MyDataWidget.component.tsx index e659fecc3ae..5779dc6bf05 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/MyData/MyDataWidget/MyDataWidget.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/MyData/MyDataWidget/MyDataWidget.component.tsx @@ -30,9 +30,9 @@ import { searchData } from '../../../rest/miscAPI'; import { Transi18next } from '../../../utils/CommonUtils'; import entityUtilClassBase from '../../../utils/EntityUtilClassBase'; import { getEntityName } from '../../../utils/EntityUtils'; -import { getEntityIcon } from '../../../utils/TableUtils'; import { useApplicationStore } from '../../../hooks/useApplicationStore'; +import searchClassBase from '../../../utils/SearchClassBase'; import ErrorPlaceHolder from '../../common/ErrorWithPlaceholder/ErrorPlaceHolder'; import EntityListSkeleton from '../../common/Skeleton/MyData/EntityListSkeleton/EntityListSkeleton.component'; import { SourceType } from '../../SearchedData/SearchedData.interface'; @@ -172,7 +172,9 @@ const MyDataWidgetInternal = ({ className="entity-button flex-center p-0 m--ml-1" icon={
- {getEntityIcon(item.entityType ?? '')} + {searchClassBase.getEntityIcon( + item.entityType ?? '' + )}
} type="text"> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/MyData/MyDataWidget/MyDataWidget.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/MyData/MyDataWidget/MyDataWidget.test.tsx index 7eb0b7da924..1090e8ea9c0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/MyData/MyDataWidget/MyDataWidget.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/MyData/MyDataWidget/MyDataWidget.test.tsx @@ -63,7 +63,7 @@ jest.mock('../../../utils/EntityUtils', () => ({ getEntityName: jest.fn().mockImplementation((obj) => obj.name), })); -jest.mock('../../../utils/TableUtils', () => ({ +jest.mock('../../../utils/SearchClassBase', () => ({ getEntityIcon: jest.fn().mockImplementation((obj) => obj.name), })); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/RecentlyViewed/RecentlyViewed.tsx b/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/RecentlyViewed/RecentlyViewed.tsx index ec6f32d951b..81b79866a27 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/RecentlyViewed/RecentlyViewed.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/RecentlyViewed/RecentlyViewed.tsx @@ -28,7 +28,7 @@ import { } from '../../../../utils/CommonUtils'; import entityUtilClassBase from '../../../../utils/EntityUtilClassBase'; import { getEntityName } from '../../../../utils/EntityUtils'; -import { getEntityIcon } from '../../../../utils/TableUtils'; +import searchClassBase from '../../../../utils/SearchClassBase'; import ErrorPlaceHolder from '../../../common/ErrorWithPlaceholder/ErrorPlaceHolder'; import EntityListSkeleton from '../../../common/Skeleton/MyData/EntityListSkeleton/EntityListSkeleton.component'; import './recently-viewed.less'; @@ -143,7 +143,7 @@ const RecentlyViewed = ({ className="entity-button flex-center p-0 m--ml-1" icon={
- {getEntityIcon(item.type || '')} + {searchClassBase.getEntityIcon(item.type ?? '')}
} title={getEntityName( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx index 54b25fdf250..9c4e54d84db 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/CustomPropertyTable/PropertyValue.tsx @@ -50,7 +50,7 @@ import { EntityReference } from '../../../generated/entity/type'; import { EnumConfig } from '../../../generated/type/customProperty'; import entityUtilClassBase from '../../../utils/EntityUtilClassBase'; import { getEntityName } from '../../../utils/EntityUtils'; -import { getEntityIcon } from '../../../utils/TableUtils'; +import searchClassBase from '../../../utils/SearchClassBase'; import { showErrorToast } from '../../../utils/ToastUtils'; import DataAssetAsyncSelectList from '../../DataAssets/DataAssetAsyncSelectList/DataAssetAsyncSelectList'; import { DataAssetOption } from '../../DataAssets/DataAssetAsyncSelectList/DataAssetAsyncSelectList.interface'; @@ -702,7 +702,7 @@ export const PropertyValue: FC = ({ width="18" /> ) : ( - getEntityIcon(item.type) + searchClassBase.getEntityIcon(item.type) )}
} @@ -753,7 +753,7 @@ export const PropertyValue: FC = ({ width="18" /> ) : ( - getEntityIcon(item.type) + searchClassBase.getEntityIcon(item.type) )}
} diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/Assets.constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/Assets.constants.ts index 7a432865ef2..046c1a404a0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/Assets.constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/Assets.constants.ts @@ -178,4 +178,5 @@ export const NON_SERVICE_TYPE_ASSETS = [ EntityType.PERSONA, EntityType.ROLE, EntityType.POLICY, + EntityType.KPI, ]; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/AlertDetailsPage/AlertDetailsPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/AlertDetailsPage/AlertDetailsPage.tsx index 6bcf4adb3a3..36f34d4f6e3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/AlertDetailsPage/AlertDetailsPage.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/AlertDetailsPage/AlertDetailsPage.tsx @@ -55,7 +55,7 @@ import { getObservabilityAlertsEditPath, getSettingPath, } from '../../utils/RouterUtils'; -import { getEntityIcon } from '../../utils/TableUtils'; +import searchClassBase from '../../utils/SearchClassBase'; import { AlertDetailsPageProps } from './AlertDetailsPage.interface'; function AlertDetailsPage({ @@ -366,7 +366,7 @@ function AlertDetailsPage({ subHeading={t('message.alerts-source-description')}>
- {getEntityIcon(resource ?? '')} + {searchClassBase.getEntityIcon(resource ?? '')}
{startCase(resource)} diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/Alerts/AlertsUtil.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/Alerts/AlertsUtil.tsx index 949ec7b9882..000a465a39c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/Alerts/AlertsUtil.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/Alerts/AlertsUtil.tsx @@ -50,7 +50,6 @@ import { getEntityName, getEntityNameLabel } from '../EntityUtils'; import { handleEntityCreationError } from '../formUtils'; import { getConfigFieldFromDestinationType } from '../ObservabilityUtils'; import searchClassBase from '../SearchClassBase'; -import { getEntityIcon } from '../TableUtils'; import { showSuccessToast } from '../ToastUtils'; export const getAlertsActionTypeIcon = (type?: SubscriptionType) => { @@ -880,7 +879,7 @@ export const getSourceOptionsFromResourceList = ( selectedResource?: string[] ) => resources.map((resource) => { - const sourceIcon = getEntityIcon(resource ?? ''); + const sourceIcon = searchClassBase.getEntityIcon(resource ?? ''); return { label: ( diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx index b86932bba7f..606e986004a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx @@ -48,6 +48,7 @@ import { getBotsPath, getEntityDetailsPath, getGlossaryTermDetailsPath, + getKpiPath, getServiceDetailsPath, getTagsDetailsPath, NO_DATA, @@ -69,6 +70,7 @@ import { ExplorePageTabs } from '../enums/Explore.enum'; import { SearchIndex } from '../enums/search.enum'; import { ServiceCategory, ServiceCategoryPlural } from '../enums/service.enum'; import { PrimaryTableDataTypes } from '../enums/table.enum'; +import { Kpi } from '../generated/dataInsight/kpi/kpi'; import { Classification } from '../generated/entity/classification/classification'; import { APICollection } from '../generated/entity/data/apiCollection'; import { APIEndpoint } from '../generated/entity/data/apiEndpoint'; @@ -110,6 +112,7 @@ import { EntityReference } from '../generated/type/entityUsage'; import { TagLabel } from '../generated/type/tagLabel'; import { UsageDetails } from '../generated/type/usageDetails'; import { Votes } from '../generated/type/votes'; +import { DataInsightTabs } from '../interface/data-insight.interface'; import { SearchSourceAlias } from '../interface/search.interface'; import { DataQualityPageTabs } from '../pages/DataQuality/DataQualityPage.interface'; import { @@ -117,6 +120,7 @@ import { getPartialNameFromTableFQN, getTableFQNFromColumnFQN, } from './CommonUtils'; +import { getDataInsightPathWithFqn } from './DataInsightUtils'; import EntityLink from './EntityLink'; import { BasicEntityOverviewInfo } from './EntityUtils.interface'; import Fqn from './Fqn'; @@ -1558,6 +1562,8 @@ export const getEntityLinkFromType = ( return getPolicyWithFqnPath(fullyQualifiedName); case EntityType.PERSONA: return getPersonaDetailsPath(fullyQualifiedName); + case EntityType.KPI: + return getKpiPath(fullyQualifiedName); default: return ''; } @@ -1780,6 +1786,19 @@ export const getBreadcrumbForTestSuite = (entity: TestSuite) => { ]; }; +export const getBreadCrumbForKpi = (entity: Kpi) => { + return [ + { + name: i18next.t('label.kpi-uppercase'), + url: getDataInsightPathWithFqn(DataInsightTabs.KPIS), + }, + { + name: getEntityName(entity), + url: getKpiPath(entity.name), + }, + ]; +}; + export const getEntityBreadcrumbs = ( entity: | SearchedDataProps['data'][number]['_source'] @@ -2141,6 +2160,9 @@ export const getEntityBreadcrumbs = ( case EntityType.API_ENDPOINT: return getBreadCrumbForAPIEndpoint(entity as APIEndpoint); + case EntityType.KPI: + return getBreadCrumbForKpi(entity as Kpi); + case EntityType.TOPIC: case EntityType.DASHBOARD: case EntityType.PIPELINE: diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts index 3b362eb0925..868b5698c07 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/SearchClassBase.ts @@ -76,7 +76,7 @@ import { getEntityName, } from './EntityUtils'; import i18n from './i18next/LocalUtil'; -import { getServiceIcon } from './TableUtils'; +import { getEntityIcon, getServiceIcon } from './TableUtils'; import { getTestSuiteDetailsPath, getTestSuiteFQN } from './TestSuiteUtils'; class SearchClassBase { @@ -484,6 +484,10 @@ class SearchClassBase { return getServiceIcon(source); } + public getEntityIcon(indexType: string, iconClass = '', iconStyle = {}) { + return getEntityIcon(indexType, iconClass, iconStyle); + } + public getListOfEntitiesWithoutDomain(): string[] { return [EntityType.TEST_CASE]; } 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 7195a4991fc..3d81c44de85 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx @@ -68,6 +68,7 @@ import { ReactComponent as IconNotNull } from '../assets/svg/icon-not-null.svg'; import { ReactComponent as RoleIcon } from '../assets/svg/icon-role-grey.svg'; import { ReactComponent as IconUniqueLineThrough } from '../assets/svg/icon-unique-line-through.svg'; import { ReactComponent as IconUnique } from '../assets/svg/icon-unique.svg'; +import { ReactComponent as KPIIcon } from '../assets/svg/kpi.svg'; import { ReactComponent as LocationIcon } from '../assets/svg/location.svg'; import { ReactComponent as MetadataServiceIcon } from '../assets/svg/metadata-service.svg'; import { ReactComponent as NotificationIcon } from '../assets/svg/notification.svg'; @@ -99,6 +100,7 @@ import { sortTagsCaseInsensitive, } from './CommonUtils'; import EntityLink from './EntityLink'; +import searchClassBase from './SearchClassBase'; import serviceUtilClassBase from './ServiceUtilClassBase'; import { ordinalize } from './StringsUtils'; import { TableFieldsInfoCommonEntities } from './TableUtils.interface'; @@ -265,6 +267,7 @@ export const getEntityIcon = ( [EntityType.INGESTION_PIPELINE]: PipelineIcon, [SearchIndex.INGESTION_PIPELINE]: PipelineIcon, [EntityType.ALERT]: AlertIcon, + [EntityType.KPI]: KPIIcon, ['tagCategory']: ClassificationIcon, ['announcement']: AnnouncementIcon, ['conversation']: ConversationIcon, @@ -308,9 +311,13 @@ export const getServiceIcon = (source: SourceType) => { ); if (isDataAsset) { - return getEntityIcon(source.entityType ?? '', 'service-icon w-7 h-7', { - color: DE_ACTIVE_COLOR, - }); + return searchClassBase.getEntityIcon( + source.entityType ?? '', + 'service-icon w-7 h-7', + { + color: DE_ACTIVE_COLOR, + } + ); } else { return (