From 1bf12f729b3f94c9da29e7731fb931f618b7cc20 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Thu, 21 Apr 2022 13:51:10 +0530 Subject: [PATCH] Fix issue-4216 Remove Associated Tags field from tags page (#4308) --- .../ui/src/pages/tags/index.test.tsx | 5 - .../resources/ui/src/pages/tags/index.tsx | 98 +------------------ 2 files changed, 3 insertions(+), 100 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.test.tsx index 4793dabfa3c..3a5b3cb78ad 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.test.tsx @@ -425,17 +425,12 @@ describe('Test TagsPage page', () => { const name = await findByTestId(container, 'heading-name'); const description = await findByTestId(container, 'heading-description'); const actions = await findByTestId(container, 'heading-actions'); - const associatedTags = await findByTestId( - container, - 'heading-associated-tags' - ); const tableBody = await findByTestId(container, 'table-body'); expect(table).toBeInTheDocument(); expect(actions).toBeInTheDocument(); expect(name).toBeInTheDocument(); expect(description).toBeInTheDocument(); - expect(associatedTags).toBeInTheDocument(); expect(tableBody).toBeInTheDocument(); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx index e061e8c9b17..335fa9fdfa3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/tags/index.tsx @@ -15,8 +15,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { AxiosError, AxiosResponse } from 'axios'; import classNames from 'classnames'; import { isUndefined, toLower } from 'lodash'; -import { EntityTags, FormErrorData, LoadingState } from 'Models'; -import React, { useCallback, useEffect, useState } from 'react'; +import { FormErrorData, LoadingState } from 'Models'; +import React, { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import { useAuthContext } from '../../authentication/auth-provider/AuthProvider'; import { @@ -39,8 +39,6 @@ import Loader from '../../components/Loader/Loader'; import ConfirmationModal from '../../components/Modals/ConfirmationModal/ConfirmationModal'; import FormModal from '../../components/Modals/FormModal'; import { ModalWithMarkdownEditor } from '../../components/Modals/ModalWithMarkdownEditor/ModalWithMarkdownEditor'; -import TagsContainer from '../../components/tags-container/tags-container'; -import Tags from '../../components/tags/tags'; import { getExplorePathWithSearch, TITLE_FOR_NON_ADMIN_ACTION, @@ -61,11 +59,7 @@ import { } from '../../utils/CommonUtils'; import { getErrorText } from '../../utils/StringsUtils'; import SVGIcons from '../../utils/SvgUtils'; -import { - getTagCategories, - getTaglist, - getTagOptionsFromFQN, -} from '../../utils/TagsUtils'; +import { getTagCategories } from '../../utils/TagsUtils'; import { showErrorToast } from '../../utils/ToastUtils'; import Form from './Form'; @@ -101,14 +95,6 @@ const TagsPage = () => { state: false, }); - const getTags = useCallback(() => { - const filteredTags = getTaglist(categories).filter( - (tag) => editTag?.fullyQualifiedName !== tag - ); - - return getTagOptionsFromFQN(filteredTags); - }, [currentCategory, editTag]); - const fetchCategories = () => { setIsLoading(true); getTagCategories('usageCount') @@ -393,32 +379,6 @@ const TagsPage = () => { }); }; - const handleTagSelection = (tags?: Array) => { - const newTags = tags?.map((tag) => tag.tagFQN); - if (newTags && editTag) { - updateTag(currentCategory?.name, editTag?.name, { - description: editTag?.description, - name: editTag?.name, - associatedTags: newTags, - }) - .then((res: AxiosResponse) => { - if (res.data) { - fetchCurrentCategory(currentCategory?.name as string, true); - } else { - throw jsonData['api-error-messages']['unexpected-server-response']; - } - }) - .catch((err: AxiosError) => { - showErrorToast( - err, - jsonData['api-error-messages']['update-tags-error'] - ); - }); - } - - setEditTag(undefined); - }; - const getUsageCountLink = (tagFQN: string) => { if (tagFQN.startsWith('Tier')) { return `${getExplorePathWithSearch()}?tier=${tagFQN}`; @@ -575,11 +535,6 @@ const TagsPage = () => { data-testid="heading-description"> Description - - Associated tags - @@ -655,53 +610,6 @@ const TagsPage = () => { )} - { - setEditTag(tag); - }}> - - ({ - tagFQN: tag, - })) || [] - } - tagList={getTags()} - onCancel={() => { - handleTagSelection(); - }} - onSelectionChange={(tags) => { - handleTagSelection(tags); - }}> - {tag.associatedTags?.length ? ( - - ) : ( - - - - )} - - -