mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-28 02:13:09 +00:00
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:
parent
e003a5f9ed
commit
c817785bb1
@ -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>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,4 +31,5 @@ export type TagsV1Props = {
|
|||||||
tooltipOverride?: string;
|
tooltipOverride?: string;
|
||||||
tagType?: TagSource;
|
tagType?: TagSource;
|
||||||
size?: SelectProps['size'];
|
size?: SelectProps['size'];
|
||||||
|
isEditTags?: boolean;
|
||||||
};
|
};
|
||||||
|
@ -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}
|
||||||
|
@ -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}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user