Skip to content

Commit

Permalink
fix(ui): hide description tooltip for tag edit mode (#19463)
Browse files Browse the repository at this point in the history
* fix: remove tooltip for tag edit mode

* refactor: remove comments

* fix: tooltip logic for non edit mode

* fix: hide tooltip for tag edit mode

* refactor: remove prop for TagsV1 component

* style: move cursor-pointer property to Tag

* fix: unit test failure

* fix: mock implementations for unit test

* revert test case changes
  • Loading branch information
pranita09 authored Jan 24, 2025
1 parent e003a5f commit c817785
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const TagsV1 = ({
tooltipOverride,
tagType,
size,
isEditTags,
}: TagsV1Props) => {
const color = useMemo(
() => (isVersionPage ? undefined : tag.style?.color),
Expand Down Expand Up @@ -144,7 +145,8 @@ const TagsV1 = ({
),
},
'tag-chip tag-chip-content',
size
size,
'cursor-pointer'
)}
data-testid="tags"
style={
Expand Down Expand Up @@ -185,14 +187,19 @@ const TagsV1 = ({
}

return (
<Tooltip
className="cursor-pointer"
mouseEnterDelay={0.5}
placement="bottomLeft"
title={tooltipOverride ?? getTagTooltip(tag.tagFQN, tag.description)}
trigger="hover">
{tagChip}
</Tooltip>
<>
{isEditTags ? (
tagChip
) : (
<Tooltip
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;
};
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ const AsyncSelectList: FC<AsyncSelectListProps & SelectProps> = ({

return (
<TagsV1
isEditTags
size={props.size}
startWith={TAG_START_WITH.SOURCE_ICON}
tag={tag}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ const TreeAsyncSelectList: FC<Omit<AsyncSelectListProps, 'fetchOptions'>> = ({

return (
<TagsV1
isEditTags
startWith={TAG_START_WITH.SOURCE_ICON}
tag={tag}
tagProps={tagProps}
Expand Down

0 comments on commit c817785

Please sign in to comment.