Skip to content

Commit

Permalink
fix: tooltip logic for non edit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pranita09 committed Jan 22, 2025
1 parent 16667bd commit bcd5b51
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ const TagsContainerV2 = ({
showAddTagButton ? (
<Col className="m-t-xss" onClick={handleAddClick}>
<TagsV1
isEditTags={isEditTags}
startWith={TAG_START_WITH.PLUS}
tag={isGlossaryType ? GLOSSARY_CONSTANT : TAG_CONSTANT}
tagType={tagType}
Expand Down Expand Up @@ -348,6 +349,7 @@ const TagsContainerV2 = ({
{showAddTagButton ? (
<div onClick={handleAddClick}>
<TagsV1
isEditTags={isEditTags}
startWith={TAG_START_WITH.PLUS}
tag={isGlossaryType ? GLOSSARY_CONSTANT : TAG_CONSTANT}
tagType={tagType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Tag, Typography } from 'antd';
import { Tag, Tooltip, Typography } from 'antd';
import classNames from 'classnames';
import React, { useMemo } from 'react';
import { Link } from 'react-router-dom';
Expand All @@ -26,7 +26,7 @@ import {
getClassificationTagPath,
getGlossaryPath,
} from '../../../utils/RouterUtils';
import { getTagDisplay } from '../../../utils/TagsUtils';
import { getTagDisplay, getTagTooltip } from '../../../utils/TagsUtils';
import { HighlightedTagLabel } from '../../Explore/EntitySummaryPanel/SummaryList/SummaryList.interface';
import { TagsV1Props } from './TagsV1.interface';
import './tagsV1.less';
Expand All @@ -38,8 +38,10 @@ const TagsV1 = ({
showOnlyName = false,
isVersionPage = false,
tagProps,
tooltipOverride,
tagType,
size,
isEditTags,
}: TagsV1Props) => {
const color = useMemo(
() => (isVersionPage ? undefined : tag.style?.color),
Expand Down Expand Up @@ -184,7 +186,20 @@ const TagsV1 = ({
}

return (
<Typography.Text className="cursor-pointer">{tagChip}</Typography.Text>
<>
{isEditTags ? (
<Typography.Text className="cursor-pointer">{tagChip}</Typography.Text>
) : (
<Tooltip
className="cursor-pointer"
mouseEnterDelay={0.5}
placement="bottomLeft"
title={tooltipOverride ?? getTagTooltip(tag.tagFQN, tag.description)}
trigger="hover">
{tagChip}
</Tooltip>
)}
</>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ export type TagsV1Props = {
tooltipOverride?: string;
tagType?: TagSource;
size?: SelectProps['size'];
isEditTags?: boolean;
};

0 comments on commit bcd5b51

Please sign in to comment.