mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-30 03:46:10 +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 })),
|
||||
getTaglist: jest.fn().mockReturnValue(['tag 1', 'tag 2']),
|
||||
getTagOptionsFromFQN: jest.fn().mockReturnValue([]),
|
||||
isSystemTierTags: jest.fn().mockReturnValue(false),
|
||||
}));
|
||||
|
||||
jest.mock(
|
||||
|
@ -48,6 +48,7 @@ import { TIER_CATEGORY } from '../../constants/constants';
|
||||
import { NO_PERMISSION_FOR_ACTION } from '../../constants/HelperTextUtil';
|
||||
import { delimiterRegex } from '../../constants/regex.constants';
|
||||
import { CreateTagCategory } from '../../generated/api/tags/createTagCategory';
|
||||
import { ProviderType } from '../../generated/entity/bot';
|
||||
import { Operation } from '../../generated/entity/policies/accessControl/rule';
|
||||
import { TagCategory, TagClass } from '../../generated/entity/tags/tagCategory';
|
||||
import { EntityReference } from '../../generated/type/entityReference';
|
||||
@ -68,7 +69,7 @@ import {
|
||||
} from '../../utils/RouterUtils';
|
||||
import { getErrorText } from '../../utils/StringsUtils';
|
||||
import SVGIcons, { Icons } from '../../utils/SvgUtils';
|
||||
import { getTagCategories, isSystemTierTags } from '../../utils/TagsUtils';
|
||||
import { getTagCategories } from '../../utils/TagsUtils';
|
||||
import { showErrorToast } from '../../utils/ToastUtils';
|
||||
import Form from './Form';
|
||||
import './TagPage.style.less';
|
||||
@ -594,7 +595,7 @@ const TagsPage = () => {
|
||||
className="link-text"
|
||||
data-testid="delete-tag"
|
||||
disabled={
|
||||
isSystemTierTags(record.fullyQualifiedName || '') ||
|
||||
record.provider === ProviderType.System ||
|
||||
!categoryPermissions.EditAll
|
||||
}
|
||||
onClick={() => handleActionDeleteTag(record)}>
|
||||
@ -666,7 +667,7 @@ const TagsPage = () => {
|
||||
className="tw-h-8 tw-rounded tw-ml-2"
|
||||
data-testid="delete-tag-category-button"
|
||||
disabled={
|
||||
isSystemTierTags(currentCategory.name || '') ||
|
||||
currentCategory.provider === ProviderType.System ||
|
||||
!categoryPermissions.Delete
|
||||
}
|
||||
size="small"
|
||||
|
@ -151,16 +151,3 @@ export const fetchTagsAndGlossaryTerms = async () => {
|
||||
|
||||
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