diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.interface.ts index ab163f1ba3f..405a5d0e0a7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.interface.ts @@ -15,6 +15,7 @@ import { DefaultOptionType } from 'antd/lib/select'; import { PagingResponse } from 'Models'; import { Tag } from '../../generated/entity/classification/tag'; import { GlossaryTerm } from '../../generated/entity/data/glossaryTerm'; +import { TagSource } from '../../generated/type/tagLabel'; export type SelectOption = { label: string; @@ -29,6 +30,7 @@ export interface AsyncSelectListProps { debounceTimeout?: number; defaultValue?: string[]; value?: string[]; + tagType?: TagSource; initialOptions?: SelectOption[]; filterOptions?: string[]; // array of fqn onChange?: (option: DefaultOptionType | DefaultOptionType[]) => void; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.tsx index 1d2f54853f0..d7cd8f556e4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AsyncSelectList/AsyncSelectList.tsx @@ -47,6 +47,7 @@ const AsyncSelectList: FC = ({ initialOptions, filterOptions = [], className, + tagType, ...props }) => { const [isLoading, setIsLoading] = useState(false); @@ -222,6 +223,7 @@ const AsyncSelectList: FC = ({ startWith={TAG_START_WITH.SOURCE_ICON} tag={tag} tagProps={tagProps} + tagType={tagType} tooltipOverride={ isDerived ? t('message.derived-tag-warning') : undefined } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsContainerV2/TagsContainerV2.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsContainerV2/TagsContainerV2.tsx index 4d81fa6fb9d..c036ad851c9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsContainerV2/TagsContainerV2.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsContainerV2/TagsContainerV2.tsx @@ -23,7 +23,11 @@ import { ReactComponent as EditIcon } from '../../../assets/svg/edit-new.svg'; import { ReactComponent as IconRequest } from '../../../assets/svg/request-icon.svg'; import { TableTagsProps } from '../../../components/TableTags/TableTags.interface'; import { DE_ACTIVE_COLOR } from '../../../constants/constants'; -import { TAG_CONSTANT, TAG_START_WITH } from '../../../constants/Tag.constants'; +import { + GLOSSARY_CONSTANT, + TAG_CONSTANT, + TAG_START_WITH, +} from '../../../constants/Tag.constants'; import { LabelType } from '../../../generated/entity/data/table'; import { TagSource } from '../../../generated/type/tagLabel'; import { getEntityFeedLink } from '../../../utils/EntityUtils'; @@ -152,7 +156,11 @@ const TagsContainerV2 = ({ () => showAddTagButton ? ( - + ) : null, [showAddTagButton] @@ -164,6 +172,7 @@ const TagsContainerV2 = ({ @@ -178,6 +187,7 @@ const TagsContainerV2 = ({ fetchApi={fetchAPI} placeholder={getTagPlaceholder(isGlossaryType)} tagData={initialOptions} + tagType={tagType} onCancel={handleCancel} onSubmit={handleSave} /> @@ -316,7 +326,11 @@ const TagsContainerV2 = ({ {showAddTagButton ? (
- +
) : null} { const [form] = useForm(); const [isSubmitLoading, setIsSubmitLoading] = useState(false); @@ -69,6 +70,7 @@ const TagSelectForm = ({ initialOptions={tagData} mode="multiple" placeholder={placeholder} + tagType={tagType} /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsSelectForm/TagsSelectForm.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsSelectForm/TagsSelectForm.interface.ts index 15e932d24bc..df1b7876973 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsSelectForm/TagsSelectForm.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsSelectForm/TagsSelectForm.interface.ts @@ -14,6 +14,7 @@ import { DefaultOptionType } from 'antd/lib/select'; import { SelectOption } from '../../../components/AsyncSelectList/AsyncSelectList.interface'; import { Paging } from '../../../generated/type/paging'; +import { TagSource } from '../../../generated/type/tagLabel'; export type TagsSelectFormProps = { placeholder: string; @@ -22,6 +23,7 @@ export type TagsSelectFormProps = { onChange?: (value: string[]) => void; onSubmit: (option: DefaultOptionType | DefaultOptionType[]) => Promise; onCancel: () => void; + tagType?: TagSource; fetchApi: ( search: string, page: number 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 6254ea2ce8b..2aba33ef2c7 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 @@ -38,6 +38,7 @@ const TagsV1 = ({ isVersionPage = false, tagProps, tooltipOverride, + tagType, }: TagsV1Props) => { const history = useHistory(); const color = useMemo( @@ -88,12 +89,12 @@ const TagsV1 = ({ const redirectLink = useCallback( () => - tag.source === TagSource.Glossary + (tagType ?? tag.source) === TagSource.Glossary ? history.push(`${ROUTES.GLOSSARY}/${getEncodedFqn(tag.tagFQN)}`) : history.push( `${ROUTES.TAGS}/${getEncodedFqn(Fqn.split(tag.tagFQN)[0])}` ), - [tag.source, tag.tagFQN] + [tagType, tag.source, tag.tagFQN] ); const tagColorBar = useMemo( 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 5a30c028dde..9524dcef9aa 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 @@ -13,7 +13,7 @@ import { TagProps } from 'antd'; import { TAG_START_WITH } from '../../../constants/Tag.constants'; -import { TagLabel } from '../../../generated/type/tagLabel'; +import { TagLabel, TagSource } from '../../../generated/type/tagLabel'; import { HighlightedTagLabel } from '../../../utils/EntitySummaryPanelUtils'; export type TagsV1Props = { @@ -25,4 +25,5 @@ export type TagsV1Props = { tagProps?: TagProps; disabled?: boolean; tooltipOverride?: string; + tagType?: TagSource; }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsViewer/TagsViewer.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsViewer/TagsViewer.interface.ts index 0f22143db40..312e9e440a5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsViewer/TagsViewer.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Tag/TagsViewer/TagsViewer.interface.ts @@ -12,12 +12,14 @@ */ import { EntityTags } from 'Models'; +import { TagSource } from '../../../generated/type/tagLabel'; export interface TagsViewerProps { tags: EntityTags[]; sizeCap?: number; displayType?: DisplayType; showNoDataPlaceholder?: boolean; + tagType?: TagSource; } export enum DisplayType { diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/Tag.constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/Tag.constants.ts index c0eb53f32a5..5d80bc7ea27 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/Tag.constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/Tag.constants.ts @@ -21,6 +21,13 @@ export const TAG_CONSTANT = { tagFQN: t('label.add'), }; +export const GLOSSARY_CONSTANT = { + labelType: LabelType.Manual, + source: TagSource.Glossary, + state: State.Confirmed, + tagFQN: t('label.add'), +}; + export enum TAG_START_WITH { PLUS = '+', SOURCE_ICON = 'source_icon',