mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-30 20:06:19 +00:00
Use Backend system level flag for system tags (#9126)
This commit is contained in:
parent
0306bc6d69
commit
0f889e0327
@ -254,7 +254,6 @@ jest.mock('../../utils/TagsUtils', () => ({
|
|||||||
.mockImplementation(() => Promise.resolve({ data: mockTagsCategory })),
|
.mockImplementation(() => Promise.resolve({ data: mockTagsCategory })),
|
||||||
getTaglist: jest.fn().mockReturnValue(['tag 1', 'tag 2']),
|
getTaglist: jest.fn().mockReturnValue(['tag 1', 'tag 2']),
|
||||||
getTagOptionsFromFQN: jest.fn().mockReturnValue([]),
|
getTagOptionsFromFQN: jest.fn().mockReturnValue([]),
|
||||||
isSystemTierTags: jest.fn().mockReturnValue(false),
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock(
|
jest.mock(
|
||||||
|
@ -48,6 +48,7 @@ import { TIER_CATEGORY } from '../../constants/constants';
|
|||||||
import { NO_PERMISSION_FOR_ACTION } from '../../constants/HelperTextUtil';
|
import { NO_PERMISSION_FOR_ACTION } from '../../constants/HelperTextUtil';
|
||||||
import { delimiterRegex } from '../../constants/regex.constants';
|
import { delimiterRegex } from '../../constants/regex.constants';
|
||||||
import { CreateTagCategory } from '../../generated/api/tags/createTagCategory';
|
import { CreateTagCategory } from '../../generated/api/tags/createTagCategory';
|
||||||
|
import { ProviderType } from '../../generated/entity/bot';
|
||||||
import { Operation } from '../../generated/entity/policies/accessControl/rule';
|
import { Operation } from '../../generated/entity/policies/accessControl/rule';
|
||||||
import { TagCategory, TagClass } from '../../generated/entity/tags/tagCategory';
|
import { TagCategory, TagClass } from '../../generated/entity/tags/tagCategory';
|
||||||
import { EntityReference } from '../../generated/type/entityReference';
|
import { EntityReference } from '../../generated/type/entityReference';
|
||||||
@ -68,7 +69,7 @@ import {
|
|||||||
} from '../../utils/RouterUtils';
|
} from '../../utils/RouterUtils';
|
||||||
import { getErrorText } from '../../utils/StringsUtils';
|
import { getErrorText } from '../../utils/StringsUtils';
|
||||||
import SVGIcons, { Icons } from '../../utils/SvgUtils';
|
import SVGIcons, { Icons } from '../../utils/SvgUtils';
|
||||||
import { getTagCategories, isSystemTierTags } from '../../utils/TagsUtils';
|
import { getTagCategories } from '../../utils/TagsUtils';
|
||||||
import { showErrorToast } from '../../utils/ToastUtils';
|
import { showErrorToast } from '../../utils/ToastUtils';
|
||||||
import Form from './Form';
|
import Form from './Form';
|
||||||
import './TagPage.style.less';
|
import './TagPage.style.less';
|
||||||
@ -594,7 +595,7 @@ const TagsPage = () => {
|
|||||||
className="link-text"
|
className="link-text"
|
||||||
data-testid="delete-tag"
|
data-testid="delete-tag"
|
||||||
disabled={
|
disabled={
|
||||||
isSystemTierTags(record.fullyQualifiedName || '') ||
|
record.provider === ProviderType.System ||
|
||||||
!categoryPermissions.EditAll
|
!categoryPermissions.EditAll
|
||||||
}
|
}
|
||||||
onClick={() => handleActionDeleteTag(record)}>
|
onClick={() => handleActionDeleteTag(record)}>
|
||||||
@ -666,7 +667,7 @@ const TagsPage = () => {
|
|||||||
className="tw-h-8 tw-rounded tw-ml-2"
|
className="tw-h-8 tw-rounded tw-ml-2"
|
||||||
data-testid="delete-tag-category-button"
|
data-testid="delete-tag-category-button"
|
||||||
disabled={
|
disabled={
|
||||||
isSystemTierTags(currentCategory.name || '') ||
|
currentCategory.provider === ProviderType.System ||
|
||||||
!categoryPermissions.Delete
|
!categoryPermissions.Delete
|
||||||
}
|
}
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -151,16 +151,3 @@ export const fetchTagsAndGlossaryTerms = async () => {
|
|||||||
|
|
||||||
return tagsAndTerms;
|
return tagsAndTerms;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const isSystemTierTags = (tag: string) => {
|
|
||||||
const tierTags = [
|
|
||||||
'Tier',
|
|
||||||
'Tier.Tier1',
|
|
||||||
'Tier.Tier2',
|
|
||||||
'Tier.Tier3',
|
|
||||||
'Tier.Tier4',
|
|
||||||
'Tier.Tier5',
|
|
||||||
];
|
|
||||||
|
|
||||||
return tierTags.includes(tag);
|
|
||||||
};
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user