Skip to content

Commit

Permalink
Merge branch 'main' into multi_owners
Browse files Browse the repository at this point in the history
  • Loading branch information
karanh37 authored Jul 29, 2024
2 parents bdc4893 + be1d5a2 commit 8fa972a
Show file tree
Hide file tree
Showing 24 changed files with 81 additions and 44 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -101,7 +101,7 @@ const FeedCardHeaderV2 = ({
<EntityPopOverCard entityFQN={entityFQN} entityType={entityType}>
<>
<span className="w-5 h-5 m-r-xss d-inline-flex text-xl align-middle">
{getEntityIcon(entityType ?? '')}
{searchClassBase.getEntityIcon(entityType ?? '')}
</span>
<Link
className="break-all"
Expand All @@ -120,7 +120,7 @@ const FeedCardHeaderV2 = ({
return (
<>
<span className="w-5 h-5 m-r-xss d-inline-flex text-xl align-middle">
{getEntityIcon(entityType ?? '')}
{searchClassBase.getEntityIcon(entityType ?? '')}
</span>
<Typography.Text className="break-all font-bold">
{feed?.entityRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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';
Expand Down Expand Up @@ -141,7 +141,7 @@ export const FeedEditor = forwardRef<editorRef, FeedEditorProp>(
</div>`
: '';

const icon = getEntityIcon(item.type as string);
const icon = searchClassBase.getEntityIcon(item.type ?? '');

const iconString = ReactDOMServer.renderToString(icon ?? <></>);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down Expand Up @@ -128,7 +128,7 @@ export default forwardRef<
</div>
<Space align="center">
<div className="w-5" style={{ marginTop: '6px' }}>
{getEntityIcon(item.type)}
{searchClassBase.getEntityIcon(item.type)}
</div>
<Typography className="truncate w-max-200">
{item.label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -155,7 +155,7 @@ const DataAssetAsyncSelectList: FC<DataAssetAsyncSelectListProps> = ({
className="d-flex items-center gap-2"
data-testid={`option-${value}`}>
<div className="flex-center data-asset-icon">
{getEntityIcon(reference.type)}
{searchClassBase.getEntityIcon(reference.type)}
</div>
<div className="d-flex flex-col">
<span className="text-grey-muted text-xs">{reference.type}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -157,7 +157,7 @@ const AddPipeLineModal = ({

<div className="edge-option-container">
{edgeOptions.map((item) => {
const icon = getEntityIcon(item.type);
const icon = searchClassBase.getEntityIcon(item.type);
const breadcrumb = Fqn.split(item.fullyQualifiedName ?? '').join('/');

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLDivElement> {
Expand Down Expand Up @@ -56,7 +56,7 @@ const EntityNode: FC<EntityNodeProps> = ({ type, label, draggable }) => {
e.preventDefault();
e.stopPropagation();
}}>
{getEntityIcon(type || '')}
{searchClassBase.getEntityIcon(type ?? '')}
</span>
<span className="d-flex m-l-xs">
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ReactComponent as Layers } from '../../../../assets/svg/ic-layers.svg';
import { useLineageProvider } from '../../../../context/LineageProvider/LineageProvider';
import { LineageLayerView } from '../../../../context/LineageProvider/LineageProvider.interface';
import { EntityType } from '../../../../enums/entity.enum';
import { getEntityIcon } from '../../../../utils/TableUtils';
import searchClassBase from '../../../../utils/SearchClassBase';
import './lineage-layers.less';

const LineageLayers = () => {
Expand All @@ -47,7 +47,7 @@ const LineageLayers = () => {
onClick={() => onButtonClick(LineageLayerView.COLUMN)}>
<div className="lineage-layer-btn">
<div className="layer-icon">
{getEntityIcon(EntityType.TABLE)}
{searchClassBase.getEntityIcon(EntityType.TABLE)}
</div>
<Typography.Text className="text-xss">
{t('label.column')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -85,7 +85,7 @@ const LineageSearchSelect = () => {
</div>
<div className="d-flex items-center gap-1 ">
<div className="flex-center w-4 h-4 text-base-color">
{getEntityIcon(node.entityType ?? '')}
{searchClassBase.getEntityIcon(node.entityType ?? '')}
</div>
<Typography.Text>{getEntityName(column)}</Typography.Text>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -200,7 +200,7 @@ const NodeChildren = ({ node, isConnectable }: NodeChildrenProps) => {
}}>
<Space>
<div className=" w-5 h-5 text-base-color">
{getEntityIcon(node.entityType ?? '')}
{searchClassBase.getEntityIcon(node.entityType ?? '')}
</div>
{childrenHeading}
{isExpanded ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -75,7 +75,7 @@ export const EntityListWithV1: FunctionComponent<AntdEntityListProp> = ({
className="entity-button flex-center p-0 m--ml-1"
icon={
<div className="entity-button-icon m-r-xs">
{getEntityIcon(item.type || '')}
{searchClassBase.getEntityIcon(item.type || '')}
</div>
}
title={getEntityName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { 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 { OwnerLabel } from '../../common/OwnerLabel/OwnerLabel.component';
import TitleBreadcrumb from '../../common/TitleBreadcrumb/TitleBreadcrumb.component';
import TableDataCardBody from '../../Database/TableDataCardBody/TableDataCardBody';
Expand Down Expand Up @@ -153,13 +153,13 @@ const ExploreSearchCard: React.FC<ExploreSearchCardProps> = forwardRef<

return (
<span className="w-6 h-6 m-r-xs d-inline-flex text-xl align-middle">
{getEntityIcon(source.entityType ?? '')}
{searchClassBase.getEntityIcon(source.entityType ?? '')}
</span>
);
}

return;
}, [source, showEntityIcon, getEntityIcon]);
}, [source, showEntityIcon]);

const entityLink = useMemo(
() => searchClassBase.getEntityLink(source),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -172,7 +172,9 @@ const MyDataWidgetInternal = ({
className="entity-button flex-center p-0 m--ml-1"
icon={
<div className="entity-button-icon m-r-xs">
{getEntityIcon(item.entityType ?? '')}
{searchClassBase.getEntityIcon(
item.entityType ?? ''
)}
</div>
}
type="text">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -143,7 +143,7 @@ const RecentlyViewed = ({
className="entity-button flex-center p-0 m--ml-1"
icon={
<div className="entity-button-icon m-r-xs">
{getEntityIcon(item.type || '')}
{searchClassBase.getEntityIcon(item.type ?? '')}
</div>
}
title={getEntityName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -702,7 +702,7 @@ export const PropertyValue: FC<PropertyValueProps> = ({
width="18"
/>
) : (
getEntityIcon(item.type)
searchClassBase.getEntityIcon(item.type)
)}
</div>
}
Expand Down Expand Up @@ -753,7 +753,7 @@ export const PropertyValue: FC<PropertyValueProps> = ({
width="18"
/>
) : (
getEntityIcon(item.type)
searchClassBase.getEntityIcon(item.type)
)}
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,5 @@ export const NON_SERVICE_TYPE_ASSETS = [
EntityType.PERSONA,
EntityType.ROLE,
EntityType.POLICY,
EntityType.KPI,
];
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -366,7 +366,7 @@ function AlertDetailsPage({
subHeading={t('message.alerts-source-description')}>
<div className="d-flex items-center gap-2 m-l-sm">
<div className="d-flex h-4 w-4">
{getEntityIcon(resource ?? '')}
{searchClassBase.getEntityIcon(resource ?? '')}
</div>
<span data-testid="resource-name">
{startCase(resource)}
Expand Down
Loading

0 comments on commit 8fa972a

Please sign in to comment.