diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx index 22faa30e0e2..0c5e8cdc4b7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.component.tsx @@ -21,6 +21,7 @@ import React, { FunctionComponent, useEffect, useState } from 'react'; import appState from '../../AppState'; import { useAuthContext } from '../../auth-provider/AuthProvider'; import { getCategory } from '../../axiosAPIs/tagAPI'; +import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants'; import { Operation } from '../../generated/entity/policies/accessControl/rule'; import { useAuth } from '../../hooks/authHooks'; import { getUserTeams } from '../../utils/CommonUtils'; @@ -193,7 +194,7 @@ const ManageTab: FunctionComponent = ({ if (res.data) { const tierData = res.data.children.map( (tier: { name: string; description: string }) => ({ - id: `Tier.${tier.name}`, + id: `Tier${FQN_SEPARATOR_CHAR}${tier.name}`, title: tier.name, description: tier.description.substring( 0, diff --git a/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.test.tsx index f78186aa775..b0c9267d625 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/ManageTab/ManageTab.test.tsx @@ -45,15 +45,15 @@ jest.mock('../../hooks/authHooks', () => ({ const mockTierData = { children: [ { - fullyQualifiedName: 'Tier.Tier1', + fullyQualifiedName: 'Tier:Tier1', description: 'description for card 1', }, { - fullyQualifiedName: 'Tier.Tier2', + fullyQualifiedName: 'Tier:Tier2', description: 'description for card 2', }, { - fullyQualifiedName: 'Tier.Tier3', + fullyQualifiedName: 'Tier:Tier3', description: 'description for card 3', }, ], diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/EntityPageInfo.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/EntityPageInfo.test.tsx index 8eae7610bb0..7b88ab5b9f1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/EntityPageInfo.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/entityPageInfo/EntityPageInfo.test.tsx @@ -35,7 +35,7 @@ const followHandler = jest.fn(); const versionHandler = jest.fn(); const onThreadLinkSelect = jest.fn(); const mockTier = { - tagFQN: 'Tier.Tier1', + tagFQN: 'Tier:Tier1', description: '', source: 'Tag', labelType: 'Manual', diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/facetfilter/FilterContainer.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/facetfilter/FilterContainer.tsx index e285681b872..d1d32732d99 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/facetfilter/FilterContainer.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/facetfilter/FilterContainer.tsx @@ -27,7 +27,7 @@ const FilterContainer: FunctionComponent = ({ isDisabled = false, }: FilterContainerProp) => { const getFilterName = (name = '') => { - const formattedName = name.startsWith('Tier.Tier') + const formattedName = name.startsWith(`Tier${FQN_SEPARATOR_CHAR}Tier`) ? name.split(FQN_SEPARATOR_CHAR)[1] : name; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/table-data-card/TableDataCardBody.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/table-data-card/TableDataCardBody.tsx index 4ce62d08adb..a26c856459a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/table-data-card/TableDataCardBody.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/table-data-card/TableDataCardBody.tsx @@ -34,13 +34,13 @@ const TableDataCardBody: FunctionComponent = ({ }: Props) => { const getTagValue = (tag: string | TagLabel): string | TagLabel => { if (isString(tag)) { - return tag.startsWith('Tier.Tier') + return tag.startsWith(`Tier${FQN_SEPARATOR_CHAR}Tier`) ? tag.split(FQN_SEPARATOR_CHAR)[1] : tag; } else { return { ...tag, - tagFQN: tag.tagFQN.startsWith('Tier.Tier') + tagFQN: tag.tagFQN.startsWith(`Tier${FQN_SEPARATOR_CHAR}Tier`) ? tag.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : tag.tagFQN, }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/tags-container/tags-container.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/tags-container/tags-container.test.tsx index 61ad6582928..8c2e338f43b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/tags-container/tags-container.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/tags-container/tags-container.test.tsx @@ -28,10 +28,10 @@ const tagList = [ ]; const tagListWithTier = [ - { fqn: 'Tier.Tier1', source: 'Tag' }, - { fqn: 'Data.Tier1Data', source: 'Tag' }, - { fqn: 'Tier.Tier2', source: 'Glossary' }, - { fqn: 'Count.Tier2Count', source: 'Glossary' }, + { fqn: 'Tier:Tier1', source: 'Tag' }, + { fqn: 'Data:Tier1Data', source: 'Tag' }, + { fqn: 'Tier:Tier2', source: 'Glossary' }, + { fqn: 'Count:Tier2Count', source: 'Glossary' }, ]; const onCancel = jest.fn(); const onSelectionChange = jest.fn(); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/tags-container/tags-container.tsx b/openmetadata-ui/src/main/resources/ui/src/components/tags-container/tags-container.tsx index 3d552992517..a6ff3e50842 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/tags-container/tags-container.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/tags-container/tags-container.tsx @@ -16,6 +16,7 @@ import classNames from 'classnames'; import { isNull } from 'lodash'; import { EntityTags, TagOption } from 'Models'; import React, { FunctionComponent, useEffect, useRef, useState } from 'react'; +import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants'; import { Source } from '../../generated/type/tagLabel'; import { withLoader } from '../../hoc/withLoader'; import { Button } from '../buttons/Button/Button'; @@ -76,7 +77,7 @@ const TagsContainer: FunctionComponent = ({ .filter((tag) => { return !tags.some((selectedTag) => selectedTag.tagFQN === tag.fqn); }) - .filter((tag) => !tag.fqn?.startsWith('Tier.Tier')) // To filter out Tier tags + .filter((tag) => !tag.fqn?.startsWith(`Tier${FQN_SEPARATOR_CHAR}Tier`)) // To filter out Tier tags .map((tag) => { return { name: tag.fqn, diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/constants.ts index 004c418715f..90203f1f92a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/constants.ts @@ -11,6 +11,8 @@ * limitations under the License. */ +import { FQN_SEPARATOR_CHAR } from './char.constants'; + export const FOLLOWERS_VIEW_CAP = 20; export const JSON_TAB_SIZE = 2; export const PAGE_SIZE = 10; @@ -59,11 +61,11 @@ export const ONLY_NUMBER_REGEX = /^[0-9\b]+$/; /* eslint-disable @typescript-eslint/camelcase */ export const tiers = [ - { key: 'Tier.Tier1', doc_count: 0 }, - { key: 'Tier.Tier2', doc_count: 0 }, - { key: 'Tier.Tier3', doc_count: 0 }, - { key: 'Tier.Tier4', doc_count: 0 }, - { key: 'Tier.Tier5', doc_count: 0 }, + { key: `Tier${FQN_SEPARATOR_CHAR}Tier1`, doc_count: 0 }, + { key: `Tier${FQN_SEPARATOR_CHAR}Tier2`, doc_count: 0 }, + { key: `Tier${FQN_SEPARATOR_CHAR}Tier3`, doc_count: 0 }, + { key: `Tier${FQN_SEPARATOR_CHAR}Tier4`, doc_count: 0 }, + { key: `Tier${FQN_SEPARATOR_CHAR}Tier5`, doc_count: 0 }, ]; export const versionTypes = [ diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/mockTourData.constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/mockTourData.constants.ts index 1748a2100d1..8536ecf186e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/mockTourData.constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/mockTourData.constants.ts @@ -11,6 +11,8 @@ * limitations under the License. */ +import { FQN_SEPARATOR_CHAR } from './char.constants'; + /* eslint-disable */ export const mockFeedData = [ @@ -3746,7 +3748,7 @@ export const mockSearchData = { 'User.CreditCardNumber', ], fqdn: 'bigquery.shopify.fact_sale', - tier: 'Tier.Tier1', + tier: `Tier${FQN_SEPARATOR_CHAR}Tier1`, schema_description: null, owner: '', followers: [], @@ -3787,7 +3789,7 @@ export const mockSearchData = { sum_other_doc_count: 0, buckets: [ { - key: 'Tier.Tier1', + key: `Tier${FQN_SEPARATOR_CHAR}Tier1`, doc_count: 1, }, ], @@ -3894,7 +3896,7 @@ export const mockSearchData = { sum_other_doc_count: 0, buckets: [ { - key: 'Tier.Tier1', + key: `Tier${FQN_SEPARATOR_CHAR}Tier1`, doc_count: 1, }, ], @@ -4001,7 +4003,7 @@ export const mockSearchData = { sum_other_doc_count: 0, buckets: [ { - key: 'Tier.Tier1', + key: `Tier${FQN_SEPARATOR_CHAR}Tier1`, doc_count: 1, }, ], @@ -4108,7 +4110,7 @@ export const mockSearchData = { sum_other_doc_count: 0, buckets: [ { - key: 'Tier.Tier1', + key: `Tier${FQN_SEPARATOR_CHAR}Tier1`, doc_count: 1, }, ], diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/database-details/index.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/database-details/index.tsx index 807fa5e2e82..63588692fa8 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/database-details/index.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/database-details/index.tsx @@ -662,7 +662,9 @@ const DatabaseDetails: FunctionComponent = () => { sizeCap={-1} tags={(table.tags || []).map((tag) => ({ ...tag, - tagFQN: tag.tagFQN?.startsWith('Tier.Tier') + tagFQN: tag.tagFQN?.startsWith( + `Tier${FQN_SEPARATOR_CHAR}Tier` + ) ? tag.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : tag.tagFQN, }))} diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/GlossaryUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/GlossaryUtils.ts index 8d547fa64a4..2ebab7e3a17 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/GlossaryUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/GlossaryUtils.ts @@ -127,7 +127,7 @@ const createGlossaryTermNode = ( leafFqn: string, name: string ): GlossaryTermTreeNode => { - const arrFQN = leafFqn.split(`${name}.`); + const arrFQN = leafFqn.split(`${name}${FQN_SEPARATOR_CHAR}`); const childName = arrFQN[1]?.split(FQN_SEPARATOR_CHAR)[0]; return !childName @@ -239,7 +239,9 @@ export const getActionsList = () => { */ export const getHierarchicalKeysByFQN = (fqn: string) => { const keys = fqn.split(FQN_SEPARATOR_CHAR).reduce((prev, curr) => { - const currFqn = prev.length ? `${prev[prev.length - 1]}.${curr}` : curr; + const currFqn = prev.length + ? `${prev[prev.length - 1]}${FQN_SEPARATOR_CHAR}${curr}` + : curr; return [...prev, currFqn]; }, [] as string[]); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx index fff068f09c7..e8d45061221 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx @@ -18,6 +18,7 @@ import { EntityTags, TableDetail } from 'Models'; import React, { Fragment } from 'react'; import AppState from '../AppState'; import PopOver from '../components/common/popover/PopOver'; +import { FQN_SEPARATOR_CHAR } from '../constants/char.constants'; import { getDashboardDetailsPath, getDatabaseDetailsPath, @@ -74,7 +75,7 @@ export const getTierFromTableTags = ( ): EntityTags['tagFQN'] => { const tierTag = tags.find( (item) => - item.tagFQN.startsWith('Tier.Tier') && + item.tagFQN.startsWith(`Tier${FQN_SEPARATOR_CHAR}Tier`) && !isNaN(parseInt(item.tagFQN.substring(9).trim())) ); @@ -84,7 +85,7 @@ export const getTierFromTableTags = ( export const getTierTags = (tags: Array) => { const tierTag = tags.find( (item) => - item.tagFQN.startsWith('Tier.Tier') && + item.tagFQN.startsWith(`Tier${FQN_SEPARATOR_CHAR}Tier`) && !isNaN(parseInt(item.tagFQN.substring(9).trim())) ); @@ -96,7 +97,7 @@ export const getTagsWithoutTier = ( ): Array => { return tags.filter( (item) => - !item.tagFQN.startsWith('Tier.Tier') || + !item.tagFQN.startsWith(`Tier${FQN_SEPARATOR_CHAR}Tier`) || isNaN(parseInt(item.tagFQN.substring(9).trim())) ); }; @@ -104,7 +105,8 @@ export const getTagsWithoutTier = ( export const getTierFromSearchTableTags = (tags: Array): string => { const tierTag = tags.find( (item) => - item.startsWith('Tier.Tier') && !isNaN(parseInt(item.substring(9).trim())) + item.startsWith(`Tier${FQN_SEPARATOR_CHAR}Tier`) && + !isNaN(parseInt(item.substring(9).trim())) ); return tierTag || ''; @@ -115,7 +117,8 @@ export const getSearchTableTagsWithoutTier = ( ): Array => { return tags.filter( (item) => - !item.startsWith('Tier.Tier') || isNaN(parseInt(item.substring(9).trim())) + !item.startsWith(`Tier${FQN_SEPARATOR_CHAR}Tier`) || + isNaN(parseInt(item.substring(9).trim())) ); };