fix(ui): hide description tooltip for tag edit mode (#19463)

* 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
This commit is contained in:
Pranita Fulsundar 2025-01-24 20:35:22 +05:30 committed by GitHub
parent e003a5f9ed
commit c817785bb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 9 deletions

View File

@ -41,6 +41,7 @@ const TagsV1 = ({
tooltipOverride, tooltipOverride,
tagType, tagType,
size, size,
isEditTags,
}: TagsV1Props) => { }: TagsV1Props) => {
const color = useMemo( const color = useMemo(
() => (isVersionPage ? undefined : tag.style?.color), () => (isVersionPage ? undefined : tag.style?.color),
@ -144,7 +145,8 @@ const TagsV1 = ({
), ),
}, },
'tag-chip tag-chip-content', 'tag-chip tag-chip-content',
size size,
'cursor-pointer'
)} )}
data-testid="tags" data-testid="tags"
style={ style={
@ -185,14 +187,19 @@ const TagsV1 = ({
} }
return ( return (
<>
{isEditTags ? (
tagChip
) : (
<Tooltip <Tooltip
className="cursor-pointer"
mouseEnterDelay={0.5} mouseEnterDelay={0.5}
placement="bottomLeft" placement="bottomLeft"
title={tooltipOverride ?? getTagTooltip(tag.tagFQN, tag.description)} title={tooltipOverride ?? getTagTooltip(tag.tagFQN, tag.description)}
trigger="hover"> trigger="hover">
{tagChip} {tagChip}
</Tooltip> </Tooltip>
)}
</>
); );
}; };

View File

@ -31,4 +31,5 @@ export type TagsV1Props = {
tooltipOverride?: string; tooltipOverride?: string;
tagType?: TagSource; tagType?: TagSource;
size?: SelectProps['size']; size?: SelectProps['size'];
isEditTags?: boolean;
}; };

View File

@ -248,6 +248,7 @@ const AsyncSelectList: FC<AsyncSelectListProps & SelectProps> = ({
return ( return (
<TagsV1 <TagsV1
isEditTags
size={props.size} size={props.size}
startWith={TAG_START_WITH.SOURCE_ICON} startWith={TAG_START_WITH.SOURCE_ICON}
tag={tag} tag={tag}

View File

@ -173,6 +173,7 @@ const TreeAsyncSelectList: FC<Omit<AsyncSelectListProps, 'fetchOptions'>> = ({
return ( return (
<TagsV1 <TagsV1
isEditTags
startWith={TAG_START_WITH.SOURCE_ICON} startWith={TAG_START_WITH.SOURCE_ICON}
tag={tag} tag={tag}
tagProps={tagProps} tagProps={tagProps}