From 4faafe4235a0c74bca36eb4606e7c88ce9dcb6c3 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Mon, 14 Nov 2022 19:50:36 +0530 Subject: [PATCH] UI Fixed Deleting the Tier tag category causes UI errors #5849 (#8703) * UI Fixed Deleting the Tier tag category causes UI errors #5849 * fixed failing test * updated logic for restricting system tags deletion --- .../main/resources/ui/src/pages/tags/index.test.tsx | 1 + .../src/main/resources/ui/src/pages/tags/index.tsx | 12 +++++++++--- .../src/main/resources/ui/src/utils/TagsUtils.ts | 13 +++++++++++++ 3 files changed, 23 insertions(+), 3 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 902350eb31d..48dfe19a01f 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 @@ -254,6 +254,7 @@ jest.mock('../../utils/TagsUtils', () => ({ .mockImplementation(() => Promise.resolve({ data: mockTagsCategory })), getTaglist: jest.fn().mockReturnValue(['tag 1', 'tag 2']), getTagOptionsFromFQN: jest.fn().mockReturnValue([]), + isSystemTierTags: jest.fn().mockReturnValue(false), })); jest.mock( 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 1fd5fc88640..f953463ce65 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 @@ -67,7 +67,7 @@ import { } from '../../utils/RouterUtils'; import { getErrorText } from '../../utils/StringsUtils'; import SVGIcons, { Icons } from '../../utils/SvgUtils'; -import { getTagCategories } from '../../utils/TagsUtils'; +import { getTagCategories, isSystemTierTags } from '../../utils/TagsUtils'; import { showErrorToast } from '../../utils/ToastUtils'; import Form from './Form'; import './TagPage.style.less'; @@ -592,7 +592,10 @@ const TagsPage = () => {