From c817785bb1ab52385086437e5fb7af545d58096b Mon Sep 17 00:00:00 2001 From: Pranita Fulsundar Date: Fri, 24 Jan 2025 20:35:22 +0530 Subject: [PATCH] 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 --- .../Tag/TagsV1/TagsV1.component.tsx | 25 ++++++++++++------- .../components/Tag/TagsV1/TagsV1.interface.ts | 1 + .../AsyncSelectList/AsyncSelectList.tsx | 1 + .../AsyncSelectList/TreeAsyncSelectList.tsx | 1 + 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.component.tsx index 1eba4884903..450782471a3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.component.tsx @@ -41,6 +41,7 @@ const TagsV1 = ({ tooltipOverride, tagType, size, + isEditTags, }: TagsV1Props) => { const color = useMemo( () => (isVersionPage ? undefined : tag.style?.color), @@ -144,7 +145,8 @@ const TagsV1 = ({ ), }, 'tag-chip tag-chip-content', - size + size, + 'cursor-pointer' )} data-testid="tags" style={ @@ -185,14 +187,19 @@ const TagsV1 = ({ } return ( - - {tagChip} - + <> + {isEditTags ? ( + tagChip + ) : ( + + {tagChip} + + )} + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.interface.ts index e66686e9c7f..d73d707f8ca 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsV1/TagsV1.interface.ts @@ -31,4 +31,5 @@ export type TagsV1Props = { tooltipOverride?: string; tagType?: TagSource; size?: SelectProps['size']; + isEditTags?: boolean; }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/AsyncSelectList/AsyncSelectList.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/AsyncSelectList/AsyncSelectList.tsx index c10ba590800..3bd1621e228 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/AsyncSelectList/AsyncSelectList.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/AsyncSelectList/AsyncSelectList.tsx @@ -248,6 +248,7 @@ const AsyncSelectList: FC = ({ return ( > = ({ return (