Fix #3686: Variable based separator used for fullyQualifiedName instead of hardcoded "." in UI code (#3705)

This commit is contained in:
darth-coder00 2022-03-29 02:48:31 +05:30 committed by GitHub
parent 7af4248eaf
commit 13f41a522f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 167 additions and 72 deletions

View File

@ -17,6 +17,7 @@ import { EntityTags, TagOption } from 'Models';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { useAuthContext } from '../../auth-provider/AuthProvider'; import { useAuthContext } from '../../auth-provider/AuthProvider';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { getTeamDetailsPath } from '../../constants/constants'; import { getTeamDetailsPath } from '../../constants/constants';
import { EntityType } from '../../enums/entity.enum'; import { EntityType } from '../../enums/entity.enum';
import { Dashboard } from '../../generated/entity/data/dashboard'; import { Dashboard } from '../../generated/entity/data/dashboard';
@ -196,7 +197,10 @@ const DashboardDetails = ({
isLink: owner?.type === 'team', isLink: owner?.type === 'team',
openInNewTab: false, openInNewTab: false,
}, },
{ key: 'Tier', value: tier?.tagFQN ? tier.tagFQN.split('.')[1] : '' }, {
key: 'Tier',
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
},
{ {
key: `${serviceType} Url`, key: `${serviceType} Url`,
value: dashboardUrl, value: dashboardUrl,

View File

@ -16,6 +16,7 @@ import { isUndefined } from 'lodash';
import { ExtraInfo } from 'Models'; import { ExtraInfo } from 'Models';
import React, { FC, useEffect, useState } from 'react'; import React, { FC, useEffect, useState } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { ChangeDescription } from '../../generated/entity/data/dashboard'; import { ChangeDescription } from '../../generated/entity/data/dashboard';
import { TagLabel } from '../../generated/type/tagLabel'; import { TagLabel } from '../../generated/type/tagLabel';
import { isEven } from '../../utils/CommonUtils'; import { isEven } from '../../utils/CommonUtils';
@ -146,11 +147,11 @@ const DashboardVersion: FC<DashboardVersionProp> = ({
value: value:
!isUndefined(newTier) || !isUndefined(oldTier) !isUndefined(newTier) || !isUndefined(oldTier)
? getDiffValue( ? getDiffValue(
oldTier?.tagFQN?.split('.')[1] || '', oldTier?.tagFQN?.split(FQN_SEPARATOR_CHAR)[1] || '',
newTier?.tagFQN?.split('.')[1] || '' newTier?.tagFQN?.split(FQN_SEPARATOR_CHAR)[1] || ''
) )
: tier?.tagFQN : tier?.tagFQN
? tier?.tagFQN.split('.')[1] ? tier?.tagFQN.split(FQN_SEPARATOR_CHAR)[1]
: '', : '',
}, },
{ {
@ -197,7 +198,7 @@ const DashboardVersion: FC<DashboardVersionProp> = ({
return [ return [
...uniqueTags.map((t) => ...uniqueTags.map((t) =>
t.tagFQN.startsWith('Tier') t.tagFQN.startsWith('Tier')
? { ...t, tagFQN: t.tagFQN.split('.')[1] } ? { ...t, tagFQN: t.tagFQN.split(FQN_SEPARATOR_CHAR)[1] }
: t : t
), ),
]; ];

View File

@ -16,6 +16,7 @@ import { isEqual, isNil, isUndefined } from 'lodash';
import { ColumnJoins, EntityTags, ExtraInfo } from 'Models'; import { ColumnJoins, EntityTags, ExtraInfo } from 'Models';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { useAuthContext } from '../../auth-provider/AuthProvider'; import { useAuthContext } from '../../auth-provider/AuthProvider';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { getTeamDetailsPath, ROUTES } from '../../constants/constants'; import { getTeamDetailsPath, ROUTES } from '../../constants/constants';
import { CSMode } from '../../enums/codemirror.enum'; import { CSMode } from '../../enums/codemirror.enum';
import { EntityType } from '../../enums/entity.enum'; import { EntityType } from '../../enums/entity.enum';
@ -292,7 +293,11 @@ const DatasetDetails: React.FC<DatasetDetailsProps> = ({
); );
return { return {
name: getPartialNameFromFQN(tableFQN, ['database', 'table'], '.'), name: getPartialNameFromFQN(
tableFQN,
['database', 'table'],
FQN_SEPARATOR_CHAR
),
fullyQualifiedName: tableFQN, fullyQualifiedName: tableFQN,
joinCount: joinedCol.joinCount, joinCount: joinedCol.joinCount,
}; };
@ -320,7 +325,10 @@ const DatasetDetails: React.FC<DatasetDetailsProps> = ({
isLink: owner?.type === 'team', isLink: owner?.type === 'team',
openInNewTab: false, openInNewTab: false,
}, },
{ key: 'Tier', value: tier?.tagFQN ? tier.tagFQN.split('.')[1] : '' }, {
key: 'Tier',
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
},
{ key: 'Type', value: `${tableType}`, showLabel: true }, { key: 'Type', value: `${tableType}`, showLabel: true },
{ value: usage }, { value: usage },
{ value: `${weeklyUsageCount} queries` }, { value: `${weeklyUsageCount} queries` },
@ -569,7 +577,7 @@ const DatasetDetails: React.FC<DatasetDetailsProps> = ({
columnName={getPartialNameFromFQN( columnName={getPartialNameFromFQN(
datasetFQN, datasetFQN,
['column'], ['column'],
'.' FQN_SEPARATOR_CHAR
)} )}
columns={columns} columns={columns}
entityFieldThreads={getEntityFieldThreadCounts( entityFieldThreads={getEntityFieldThreadCounts(

View File

@ -15,6 +15,7 @@ import classNames from 'classnames';
import { cloneDeep, isEqual, isUndefined } from 'lodash'; import { cloneDeep, isEqual, isUndefined } from 'lodash';
import { ExtraInfo } from 'Models'; import { ExtraInfo } from 'Models';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { import {
ChangeDescription, ChangeDescription,
Column, Column,
@ -57,7 +58,7 @@ const DatasetVersion: React.FC<DatasetVersionProp> = ({
); );
const getChangeColName = (name: string | undefined) => { const getChangeColName = (name: string | undefined) => {
return name?.split('.')?.slice(-2, -1)[0]; return name?.split(FQN_SEPARATOR_CHAR)?.slice(-2, -1)[0];
}; };
const isEndsWithField = (name: string | undefined, checkWith: string) => { const isEndsWithField = (name: string | undefined, checkWith: string) => {
@ -124,11 +125,11 @@ const DatasetVersion: React.FC<DatasetVersionProp> = ({
value: value:
!isUndefined(newTier) || !isUndefined(oldTier) !isUndefined(newTier) || !isUndefined(oldTier)
? getDiffValue( ? getDiffValue(
oldTier?.tagFQN?.split('.')[1] || '', oldTier?.tagFQN?.split(FQN_SEPARATOR_CHAR)[1] || '',
newTier?.tagFQN?.split('.')[1] || '' newTier?.tagFQN?.split(FQN_SEPARATOR_CHAR)[1] || ''
) )
: tier?.tagFQN : tier?.tagFQN
? tier?.tagFQN.split('.')[1] ? tier?.tagFQN.split(FQN_SEPARATOR_CHAR)[1]
: '', : '',
}, },
]; ];
@ -344,7 +345,7 @@ const DatasetVersion: React.FC<DatasetVersionProp> = ({
return [ return [
...uniqueTags.map((t) => ...uniqueTags.map((t) =>
t.tagFQN.startsWith('Tier') t.tagFQN.startsWith('Tier')
? { ...t, tagFQN: t.tagFQN.split('.')[1] } ? { ...t, tagFQN: t.tagFQN.split(FQN_SEPARATOR_CHAR)[1] }
: t : t
), ),
]; ];
@ -409,7 +410,7 @@ const DatasetVersion: React.FC<DatasetVersionProp> = ({
columnName={getPartialNameFromFQN( columnName={getPartialNameFromFQN(
datasetFQN, datasetFQN,
['column'], ['column'],
'.' FQN_SEPARATOR_CHAR
)} )}
columns={updatedColumns()} columns={updatedColumns()}
joins={currentVersionData.joins as ColumnJoins[]} joins={currentVersionData.joins as ColumnJoins[]}

View File

@ -39,6 +39,7 @@ import ReactFlow, {
} from 'react-flow-renderer'; } from 'react-flow-renderer';
import { useAuthContext } from '../../auth-provider/AuthProvider'; import { useAuthContext } from '../../auth-provider/AuthProvider';
import { getTableDetails } from '../../axiosAPIs/tableAPI'; import { getTableDetails } from '../../axiosAPIs/tableAPI';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { Column } from '../../generated/entity/data/table'; import { Column } from '../../generated/entity/data/table';
import { Operation } from '../../generated/entity/policies/accessControl/rule'; import { Operation } from '../../generated/entity/policies/accessControl/rule';
import { import {
@ -191,7 +192,13 @@ const Entitylineage: FunctionComponent<EntityLineageProp> = ({
) : null} ) : null}
<p className="tw-flex"> <p className="tw-flex">
<span className="tw-mr-2">{getEntityIcon(node.type)}</span> <span className="tw-mr-2">{getEntityIcon(node.type)}</span>
{getDataLabel(node.displayName, node.name, '.', false, node.type)} {getDataLabel(
node.displayName,
node.name,
FQN_SEPARATOR_CHAR,
false,
node.type
)}
</p> </p>
</> </>
); );
@ -544,7 +551,7 @@ const Entitylineage: FunctionComponent<EntityLineageProp> = ({
body: `Error while fetching ${getDataLabel( body: `Error while fetching ${getDataLabel(
expandNode.displayName, expandNode.displayName,
expandNode.name, expandNode.name,
'.', FQN_SEPARATOR_CHAR,
true true
)} columns`, )} columns`,
}); });

View File

@ -19,6 +19,7 @@ import { EntityFieldThreads, EntityTags, TagOption } from 'Models';
import React, { Fragment, useEffect, useState } from 'react'; import React, { Fragment, useEffect, useState } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { useExpanded, useTable } from 'react-table'; import { useExpanded, useTable } from 'react-table';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { getTableDetailsPath } from '../../constants/constants'; import { getTableDetailsPath } from '../../constants/constants';
import { EntityType } from '../../enums/entity.enum'; import { EntityType } from '../../enums/entity.enum';
import { import {
@ -683,7 +684,7 @@ const EntityTable = ({
{getPartialNameFromFQN( {getPartialNameFromFQN(
columnJoin?.fullyQualifiedName as string, columnJoin?.fullyQualifiedName as string,
['database', 'table', 'column'], ['database', 'table', 'column'],
'.' FQN_SEPARATOR_CHAR
)} )}
</Link> </Link>
</Fragment> </Fragment>

View File

@ -19,6 +19,7 @@ import RcTree from 'rc-tree';
import { DataNode, EventDataNode } from 'rc-tree/lib/interface'; import { DataNode, EventDataNode } from 'rc-tree/lib/interface';
import React, { useEffect, useRef, useState } from 'react'; import React, { useEffect, useRef, useState } from 'react';
import { useAuthContext } from '../../auth-provider/AuthProvider'; import { useAuthContext } from '../../auth-provider/AuthProvider';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { import {
getGlossaryPath, getGlossaryPath,
TITLE_FOR_NON_ADMIN_ACTION, TITLE_FOR_NON_ADMIN_ACTION,
@ -113,7 +114,7 @@ Props) => {
* @param fqn fqn of glossary or glossary term * @param fqn fqn of glossary or glossary term
*/ */
const handleBreadcrum = (fqn: string) => { const handleBreadcrum = (fqn: string) => {
const arr = fqn.split('.'); const arr = fqn.split(FQN_SEPARATOR_CHAR);
const dataFQN: Array<string> = []; const dataFQN: Array<string> = [];
const newData = arr.map((d, i) => { const newData = arr.map((d, i) => {
dataFQN.push(d); dataFQN.push(d);
@ -121,7 +122,7 @@ Props) => {
return { return {
name: d, name: d,
url: isLink ? getGlossaryPath(dataFQN.join('.')) : '', url: isLink ? getGlossaryPath(dataFQN.join(FQN_SEPARATOR_CHAR)) : '',
activeTitle: isLink, activeTitle: isLink,
}; };
}); });

View File

@ -5,6 +5,7 @@ import RcTree from 'rc-tree';
import { DataNode, EventDataNode } from 'rc-tree/lib/interface'; import { DataNode, EventDataNode } from 'rc-tree/lib/interface';
import React, { Fragment, useEffect, useRef, useState } from 'react'; import React, { Fragment, useEffect, useRef, useState } from 'react';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { import {
getAddGlossaryTermsPath, getAddGlossaryTermsPath,
getGlossaryTermsPath, getGlossaryTermsPath,
@ -177,7 +178,7 @@ const GlossaryTerms = ({
glossaryFormatedData[selectedKey], glossaryFormatedData[selectedKey],
selectedKey selectedKey
); );
handleBreadcrum(queryParams.split('.').splice(1)); handleBreadcrum(queryParams.split(FQN_SEPARATOR_CHAR).splice(1));
// if (queryParams.length > 1) { // if (queryParams.length > 1) {
// const expandedKey = [...queryParams]; // const expandedKey = [...queryParams];
// expandedKey.pop(); // expandedKey.pop();

View File

@ -18,6 +18,7 @@ import { EntityFieldThreads, EntityTags } from 'Models';
import React, { Fragment, useEffect, useState } from 'react'; import React, { Fragment, useEffect, useState } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { useAuthContext } from '../../auth-provider/AuthProvider'; import { useAuthContext } from '../../auth-provider/AuthProvider';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { getTeamDetailsPath } from '../../constants/constants'; import { getTeamDetailsPath } from '../../constants/constants';
import { EntityType } from '../../enums/entity.enum'; import { EntityType } from '../../enums/entity.enum';
import { Pipeline, Task } from '../../generated/entity/data/pipeline'; import { Pipeline, Task } from '../../generated/entity/data/pipeline';
@ -188,7 +189,10 @@ const PipelineDetails = ({
isLink: owner?.type === 'team', isLink: owner?.type === 'team',
openInNewTab: false, openInNewTab: false,
}, },
{ key: 'Tier', value: tier?.tagFQN ? tier.tagFQN.split('.')[1] : '' }, {
key: 'Tier',
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
},
{ {
key: `${serviceType} Url`, key: `${serviceType} Url`,
value: pipelineUrl, value: pipelineUrl,

View File

@ -16,6 +16,7 @@ import { isUndefined } from 'lodash';
import { ExtraInfo } from 'Models'; import { ExtraInfo } from 'Models';
import React, { FC, useEffect, useState } from 'react'; import React, { FC, useEffect, useState } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { ChangeDescription } from '../../generated/entity/data/pipeline'; import { ChangeDescription } from '../../generated/entity/data/pipeline';
import { TagLabel } from '../../generated/type/tagLabel'; import { TagLabel } from '../../generated/type/tagLabel';
import { isEven } from '../../utils/CommonUtils'; import { isEven } from '../../utils/CommonUtils';
@ -146,11 +147,11 @@ const PipelineVersion: FC<PipelineVersionProp> = ({
value: value:
!isUndefined(newTier) || !isUndefined(oldTier) !isUndefined(newTier) || !isUndefined(oldTier)
? getDiffValue( ? getDiffValue(
oldTier?.tagFQN?.split('.')[1] || '', oldTier?.tagFQN?.split(FQN_SEPARATOR_CHAR)[1] || '',
newTier?.tagFQN?.split('.')[1] || '' newTier?.tagFQN?.split(FQN_SEPARATOR_CHAR)[1] || ''
) )
: tier?.tagFQN : tier?.tagFQN
? tier?.tagFQN.split('.')[1] ? tier?.tagFQN.split(FQN_SEPARATOR_CHAR)[1]
: '', : '',
}, },
{ {
@ -197,7 +198,7 @@ const PipelineVersion: FC<PipelineVersionProp> = ({
return [ return [
...uniqueTags.map((t) => ...uniqueTags.map((t) =>
t.tagFQN.startsWith('Tier') t.tagFQN.startsWith('Tier')
? { ...t, tagFQN: t.tagFQN.split('.')[1] } ? { ...t, tagFQN: t.tagFQN.split(FQN_SEPARATOR_CHAR)[1] }
: t : t
), ),
]; ];

View File

@ -14,6 +14,7 @@
import { EntityTags } from 'Models'; import { EntityTags } from 'Models';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { useAuthContext } from '../../auth-provider/AuthProvider'; import { useAuthContext } from '../../auth-provider/AuthProvider';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { getTeamDetailsPath } from '../../constants/constants'; import { getTeamDetailsPath } from '../../constants/constants';
import { EntityType } from '../../enums/entity.enum'; import { EntityType } from '../../enums/entity.enum';
import { Topic } from '../../generated/entity/data/topic'; import { Topic } from '../../generated/entity/data/topic';
@ -191,7 +192,10 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
isLink: owner?.type === 'team', isLink: owner?.type === 'team',
openInNewTab: false, openInNewTab: false,
}, },
{ key: 'Tier', value: tier?.tagFQN ? tier.tagFQN.split('.')[1] : '' }, {
key: 'Tier',
value: tier?.tagFQN ? tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1] : '',
},
...getConfigDetails(), ...getConfigDetails(),
]; ];

View File

@ -15,6 +15,7 @@ import classNames from 'classnames';
import { isUndefined } from 'lodash'; import { isUndefined } from 'lodash';
import { ExtraInfo } from 'Models'; import { ExtraInfo } from 'Models';
import React, { FC, useEffect, useState } from 'react'; import React, { FC, useEffect, useState } from 'react';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { ChangeDescription } from '../../generated/entity/data/topic'; import { ChangeDescription } from '../../generated/entity/data/topic';
import { TagLabel } from '../../generated/type/tagLabel'; import { TagLabel } from '../../generated/type/tagLabel';
import { import {
@ -177,11 +178,11 @@ const TopicVersion: FC<TopicVersionProp> = ({
value: value:
!isUndefined(newTier) || !isUndefined(oldTier) !isUndefined(newTier) || !isUndefined(oldTier)
? getDiffValue( ? getDiffValue(
oldTier?.tagFQN?.split('.')[1] || '', oldTier?.tagFQN?.split(FQN_SEPARATOR_CHAR)[1] || '',
newTier?.tagFQN?.split('.')[1] || '' newTier?.tagFQN?.split(FQN_SEPARATOR_CHAR)[1] || ''
) )
: tier?.tagFQN : tier?.tagFQN
? tier?.tagFQN.split('.')[1] ? tier?.tagFQN.split(FQN_SEPARATOR_CHAR)[1]
: '', : '',
}, },
...getConfigDetails(), ...getConfigDetails(),
@ -221,7 +222,7 @@ const TopicVersion: FC<TopicVersionProp> = ({
return [ return [
...uniqueTags.map((t) => ...uniqueTags.map((t) =>
t.tagFQN.startsWith('Tier') t.tagFQN.startsWith('Tier')
? { ...t, tagFQN: t.tagFQN.split('.')[1] } ? { ...t, tagFQN: t.tagFQN.split(FQN_SEPARATOR_CHAR)[1] }
: t : t
), ),
]; ];

View File

@ -23,6 +23,7 @@ import {
TagOption, TagOption,
} from 'Models'; } from 'Models';
import React, { Fragment, useEffect, useState } from 'react'; import React, { Fragment, useEffect, useState } from 'react';
import { FQN_SEPARATOR_CHAR } from '../../../constants/char.constants';
import { FOLLOWERS_VIEW_CAP } from '../../../constants/constants'; import { FOLLOWERS_VIEW_CAP } from '../../../constants/constants';
import { Operation } from '../../../generated/entity/policies/accessControl/rule'; import { Operation } from '../../../generated/entity/policies/accessControl/rule';
import { User } from '../../../generated/entity/teams/user'; import { User } from '../../../generated/entity/teams/user';
@ -368,7 +369,10 @@ const EntityPageInfo = ({
{tier?.tagFQN && ( {tier?.tagFQN && (
<Tags <Tags
startWith="#" startWith="#"
tag={{ ...tier, tagFQN: tier.tagFQN.split('.')[1] }} tag={{
...tier,
tagFQN: tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1],
}}
type="label" type="label"
/> />
)} )}

View File

@ -14,6 +14,7 @@
import classNames from 'classnames'; import classNames from 'classnames';
import { isNil } from 'lodash'; import { isNil } from 'lodash';
import React, { FunctionComponent } from 'react'; import React, { FunctionComponent } from 'react';
import { FQN_SEPARATOR_CHAR } from '../../../constants/char.constants';
import { getCountBadge } from '../../../utils/CommonUtils'; import { getCountBadge } from '../../../utils/CommonUtils';
import PopOver from '../popover/PopOver'; import PopOver from '../popover/PopOver';
import { FilterContainerProp } from './FacetTypes'; import { FilterContainerProp } from './FacetTypes';
@ -27,7 +28,7 @@ const FilterContainer: FunctionComponent<FilterContainerProp> = ({
}: FilterContainerProp) => { }: FilterContainerProp) => {
const getFilterName = (name = '') => { const getFilterName = (name = '') => {
const formattedName = name.startsWith('Tier.Tier') const formattedName = name.startsWith('Tier.Tier')
? name.split('.')[1] ? name.split(FQN_SEPARATOR_CHAR)[1]
: name; : name;
return ( return (

View File

@ -18,6 +18,7 @@ import { ExtraInfo } from 'Models';
import React, { FunctionComponent } from 'react'; import React, { FunctionComponent } from 'react';
import { useHistory, useLocation } from 'react-router-dom'; import { useHistory, useLocation } from 'react-router-dom';
import AppState from '../../../AppState'; import AppState from '../../../AppState';
import { FQN_SEPARATOR_CHAR } from '../../../constants/char.constants';
import { ROUTES } from '../../../constants/constants'; import { ROUTES } from '../../../constants/constants';
import { SearchIndex } from '../../../enums/search.enum'; import { SearchIndex } from '../../../enums/search.enum';
import { CurrentTourPageType } from '../../../enums/tour.enum'; import { CurrentTourPageType } from '../../../enums/tour.enum';
@ -68,7 +69,7 @@ const TableDataCard: FunctionComponent<Props> = ({
const history = useHistory(); const history = useHistory();
const getTier = () => { const getTier = () => {
if (tier) { if (tier) {
return isString(tier) ? tier : tier.tagFQN.split('.')[1]; return isString(tier) ? tier : tier.tagFQN.split(FQN_SEPARATOR_CHAR)[1];
} }
return ''; return '';

View File

@ -14,6 +14,7 @@
import { isNil, isString } from 'lodash'; import { isNil, isString } from 'lodash';
import { ExtraInfo } from 'Models'; import { ExtraInfo } from 'Models';
import React, { FunctionComponent } from 'react'; import React, { FunctionComponent } from 'react';
import { FQN_SEPARATOR_CHAR } from '../../../constants/char.constants';
import { TagLabel } from '../../../generated/type/tagLabel'; import { TagLabel } from '../../../generated/type/tagLabel';
import { getInfoElements } from '../../../utils/EntityUtils'; import { getInfoElements } from '../../../utils/EntityUtils';
import SVGIcons from '../../../utils/SvgUtils'; import SVGIcons from '../../../utils/SvgUtils';
@ -33,12 +34,14 @@ const TableDataCardBody: FunctionComponent<Props> = ({
}: Props) => { }: Props) => {
const getTagValue = (tag: string | TagLabel): string | TagLabel => { const getTagValue = (tag: string | TagLabel): string | TagLabel => {
if (isString(tag)) { if (isString(tag)) {
return tag.startsWith('Tier.Tier') ? tag.split('.')[1] : tag; return tag.startsWith('Tier.Tier')
? tag.split(FQN_SEPARATOR_CHAR)[1]
: tag;
} else { } else {
return { return {
...tag, ...tag,
tagFQN: tag.tagFQN.startsWith('Tier.Tier') tagFQN: tag.tagFQN.startsWith('Tier.Tier')
? tag.tagFQN.split('.')[1] ? tag.tagFQN.split(FQN_SEPARATOR_CHAR)[1]
: tag.tagFQN, : tag.tagFQN,
}; };
} }

View File

@ -13,6 +13,7 @@
import { FormatedTableData } from 'Models'; import { FormatedTableData } from 'Models';
import React, { FunctionComponent, useEffect, useState } from 'react'; import React, { FunctionComponent, useEffect, useState } from 'react';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { getRecentlyViewedData } from '../../utils/CommonUtils'; import { getRecentlyViewedData } from '../../utils/CommonUtils';
import EntityList from '../EntityList/EntityList'; import EntityList from '../EntityList/EntityList';
import Loader from '../Loader/Loader'; import Loader from '../Loader/Loader';
@ -28,7 +29,7 @@ const RecentlyViewed: FunctionComponent = () => {
const formatedData = recentlyViewedData.map((data) => { const formatedData = recentlyViewedData.map((data) => {
return { return {
serviceType: data.serviceType, serviceType: data.serviceType,
name: data.displayName || data.fqn.split('.').pop(), name: data.displayName || data.fqn.split(FQN_SEPARATOR_CHAR).pop(),
fullyQualifiedName: data.fqn, fullyQualifiedName: data.fqn,
index: data.entityType, index: data.entityType,
}; };

View File

@ -15,6 +15,7 @@ import { isEmpty, isUndefined } from 'lodash';
import { FormatedTableData } from 'Models'; import { FormatedTableData } from 'Models';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React, { ReactNode } from 'react'; import React, { ReactNode } from 'react';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { PAGE_SIZE } from '../../constants/constants'; import { PAGE_SIZE } from '../../constants/constants';
import { TableType } from '../../generated/entity/data/table'; import { TableType } from '../../generated/entity/data/table';
import { pluralize } from '../../utils/CommonUtils'; import { pluralize } from '../../utils/CommonUtils';
@ -129,7 +130,7 @@ const SearchedData: React.FC<SearchedDataProp> = ({
tags={table.tags} tags={table.tags}
tier={ tier={
(table.tier || getTierFromSearchTableTags(table.tags))?.split( (table.tier || getTierFromSearchTableTags(table.tags))?.split(
'.' FQN_SEPARATOR_CHAR
)[1] )[1]
} }
usage={table.weeklyPercentileRank} usage={table.weeklyPercentileRank}

View File

@ -15,6 +15,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classNames from 'classnames'; import classNames from 'classnames';
import { isString } from 'lodash'; import { isString } from 'lodash';
import React, { FunctionComponent } from 'react'; import React, { FunctionComponent } from 'react';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import PopOver from '../common/popover/PopOver'; import PopOver from '../common/popover/PopOver';
import RichTextEditorPreviewer from '../common/rich-text-editor/RichTextEditorPreviewer'; import RichTextEditorPreviewer from '../common/rich-text-editor/RichTextEditorPreviewer';
import { TagProps } from './tags.interface'; import { TagProps } from './tags.interface';
@ -41,7 +42,7 @@ const Tags: FunctionComponent<TagProps> = ({
}; };
const getTag = (tag: string, startWith = '') => { const getTag = (tag: string, startWith = '') => {
const tagName = showOnlyName ? tag.split('.').pop() : tag; const tagName = showOnlyName ? tag.split(FQN_SEPARATOR_CHAR).pop() : tag;
return ( return (
<span <span

View File

@ -11,4 +11,8 @@
* limitations under the License. * limitations under the License.
*/ */
// To query All results from Elasticsearch
export const WILD_CARD_CHAR = '*'; export const WILD_CARD_CHAR = '*';
// Separator used for fullyQualifiedName of all entities
export const FQN_SEPARATOR_CHAR = '.';

View File

@ -52,6 +52,7 @@ import {
EdgeData, EdgeData,
} from '../../components/EntityLineage/EntityLineage.interface'; } from '../../components/EntityLineage/EntityLineage.interface';
import Loader from '../../components/Loader/Loader'; import Loader from '../../components/Loader/Loader';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { import {
getDatabaseDetailsPath, getDatabaseDetailsPath,
getServiceDetailsPath, getServiceDetailsPath,
@ -153,7 +154,11 @@ const DatasetDetailsPage: FunctionComponent = () => {
state: false, state: false,
}); });
const [tableFQN, setTableFQN] = useState<string>( const [tableFQN, setTableFQN] = useState<string>(
getPartialNameFromFQN(datasetFQN, ['service', 'database', 'table'], '.') getPartialNameFromFQN(
datasetFQN,
['service', 'database', 'table'],
FQN_SEPARATOR_CHAR
)
); );
const [deleted, setDeleted] = useState<boolean>(false); const [deleted, setDeleted] = useState<boolean>(false);
const [isError, setIsError] = useState(false); const [isError, setIsError] = useState(false);
@ -956,7 +961,11 @@ const DatasetDetailsPage: FunctionComponent = () => {
useEffect(() => { useEffect(() => {
setTableFQN( setTableFQN(
getPartialNameFromFQN(datasetFQN, ['service', 'database', 'table'], '.') getPartialNameFromFQN(
datasetFQN,
['service', 'database', 'table'],
FQN_SEPARATOR_CHAR
)
); );
setEntityLineage({} as EntityLineage); setEntityLineage({} as EntityLineage);
}, [datasetFQN]); }, [datasetFQN]);

View File

@ -40,6 +40,7 @@ import DatasetVersion from '../../components/DatasetVersion/DatasetVersion.compo
import Loader from '../../components/Loader/Loader'; import Loader from '../../components/Loader/Loader';
import PipelineVersion from '../../components/PipelineVersion/PipelineVersion.component'; import PipelineVersion from '../../components/PipelineVersion/PipelineVersion.component';
import TopicVersion from '../../components/TopicVersion/TopicVersion.component'; import TopicVersion from '../../components/TopicVersion/TopicVersion.component';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { import {
getDashboardDetailsPath, getDashboardDetailsPath,
getDatabaseDetailsPath, getDatabaseDetailsPath,
@ -142,7 +143,7 @@ const EntityVersionPage: FunctionComponent = () => {
getPartialNameFromFQN( getPartialNameFromFQN(
entityFQN, entityFQN,
['service', 'database', 'table'], ['service', 'database', 'table'],
'.' FQN_SEPARATOR_CHAR
), ),
['owner', 'tags'] ['owner', 'tags']
) )
@ -196,7 +197,11 @@ const EntityVersionPage: FunctionComponent = () => {
} }
case EntityType.TOPIC: { case EntityType.TOPIC: {
getTopicByFqn( getTopicByFqn(
getPartialNameFromFQN(entityFQN, ['service', 'database'], '.'), getPartialNameFromFQN(
entityFQN,
['service', 'database'],
FQN_SEPARATOR_CHAR
),
['owner', 'tags'] ['owner', 'tags']
) )
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
@ -244,7 +249,11 @@ const EntityVersionPage: FunctionComponent = () => {
} }
case EntityType.DASHBOARD: { case EntityType.DASHBOARD: {
getDashboardByFqn( getDashboardByFqn(
getPartialNameFromFQN(entityFQN, ['service', 'database'], '.'), getPartialNameFromFQN(
entityFQN,
['service', 'database'],
FQN_SEPARATOR_CHAR
),
['owner', 'tags', 'charts'] ['owner', 'tags', 'charts']
) )
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
@ -293,7 +302,11 @@ const EntityVersionPage: FunctionComponent = () => {
} }
case EntityType.PIPELINE: { case EntityType.PIPELINE: {
getPipelineByFqn( getPipelineByFqn(
getPartialNameFromFQN(entityFQN, ['service', 'database'], '.'), getPartialNameFromFQN(
entityFQN,
['service', 'database'],
FQN_SEPARATOR_CHAR
),
['owner', 'tags', 'tasks'] ['owner', 'tags', 'tasks']
) )
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
@ -354,7 +367,7 @@ const EntityVersionPage: FunctionComponent = () => {
getPartialNameFromFQN( getPartialNameFromFQN(
entityFQN, entityFQN,
['service', 'database', 'table'], ['service', 'database', 'table'],
'.' FQN_SEPARATOR_CHAR
) )
) )
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
@ -411,7 +424,11 @@ const EntityVersionPage: FunctionComponent = () => {
case EntityType.TOPIC: { case EntityType.TOPIC: {
getTopicByFqn( getTopicByFqn(
getPartialNameFromFQN(entityFQN, ['service', 'database'], '.') getPartialNameFromFQN(
entityFQN,
['service', 'database'],
FQN_SEPARATOR_CHAR
)
) )
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
const { id, name, service, serviceType } = res.data; const { id, name, service, serviceType } = res.data;
@ -462,7 +479,11 @@ const EntityVersionPage: FunctionComponent = () => {
} }
case EntityType.DASHBOARD: { case EntityType.DASHBOARD: {
getDashboardByFqn( getDashboardByFqn(
getPartialNameFromFQN(entityFQN, ['service', 'database'], '.') getPartialNameFromFQN(
entityFQN,
['service', 'database'],
FQN_SEPARATOR_CHAR
)
) )
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
const { id, displayName, service, serviceType } = res.data; const { id, displayName, service, serviceType } = res.data;
@ -513,7 +534,11 @@ const EntityVersionPage: FunctionComponent = () => {
} }
case EntityType.PIPELINE: { case EntityType.PIPELINE: {
getPipelineByFqn( getPipelineByFqn(
getPartialNameFromFQN(entityFQN, ['service', 'database'], '.') getPartialNameFromFQN(
entityFQN,
['service', 'database'],
FQN_SEPARATOR_CHAR
)
) )
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
const { id, displayName, service, serviceType } = res.data; const { id, displayName, service, serviceType } = res.data;

View File

@ -36,6 +36,7 @@ import { searchData } from '../../axiosAPIs/miscAPI';
import PageContainerV1 from '../../components/containers/PageContainerV1'; import PageContainerV1 from '../../components/containers/PageContainerV1';
import GlossaryV1 from '../../components/Glossary/GlossaryV1.component'; import GlossaryV1 from '../../components/Glossary/GlossaryV1.component';
import Loader from '../../components/Loader/Loader'; import Loader from '../../components/Loader/Loader';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { import {
getAddGlossaryTermsPath, getAddGlossaryTermsPath,
getGlossaryPath, getGlossaryPath,
@ -621,7 +622,7 @@ const GlossaryPageV1 = () => {
* To redirct to add glossary term page * To redirct to add glossary term page
*/ */
const handleAddGlossaryTermClick = () => { const handleAddGlossaryTermClick = () => {
const activeTerm = selectedKey.split('.'); const activeTerm = selectedKey.split(FQN_SEPARATOR_CHAR);
const glossaryName = activeTerm[0]; const glossaryName = activeTerm[0];
if (activeTerm.length > 1) { if (activeTerm.length > 1) {
history.push(getAddGlossaryTermsPath(glossaryName, selectedKey)); history.push(getAddGlossaryTermsPath(glossaryName, selectedKey));

View File

@ -50,6 +50,7 @@ import Loader from '../../components/Loader/Loader';
import ManageTabComponent from '../../components/ManageTab/ManageTab.component'; import ManageTabComponent from '../../components/ManageTab/ManageTab.component';
import RequestDescriptionModal from '../../components/Modals/RequestDescriptionModal/RequestDescriptionModal'; import RequestDescriptionModal from '../../components/Modals/RequestDescriptionModal/RequestDescriptionModal';
import TagsViewer from '../../components/tags-viewer/tags-viewer'; import TagsViewer from '../../components/tags-viewer/tags-viewer';
import { FQN_SEPARATOR_CHAR } from '../../constants/char.constants';
import { import {
getDatabaseDetailsPath, getDatabaseDetailsPath,
getExplorePathWithSearch, getExplorePathWithSearch,
@ -103,7 +104,7 @@ const DatabaseDetails: FunctionComponent = () => {
const [tableData, setTableData] = useState<Array<Table>>([]); const [tableData, setTableData] = useState<Array<Table>>([]);
const [databaseName, setDatabaseName] = useState<string>( const [databaseName, setDatabaseName] = useState<string>(
databaseFQN.split('.').slice(-1).pop() || '' databaseFQN.split(FQN_SEPARATOR_CHAR).slice(-1).pop() || ''
); );
const [isEdit, setIsEdit] = useState(false); const [isEdit, setIsEdit] = useState(false);
const [description, setDescription] = useState(''); const [description, setDescription] = useState('');
@ -662,7 +663,7 @@ const DatabaseDetails: FunctionComponent = () => {
tags={(table.tags || []).map((tag) => ({ tags={(table.tags || []).map((tag) => ({
...tag, ...tag,
tagFQN: tag.tagFQN?.startsWith('Tier.Tier') tagFQN: tag.tagFQN?.startsWith('Tier.Tier')
? tag.tagFQN.split('.')[1] ? tag.tagFQN.split(FQN_SEPARATOR_CHAR)[1]
: tag.tagFQN, : tag.tagFQN,
}))} }))}
/> />

View File

@ -24,6 +24,7 @@ import React, { FormEvent } from 'react';
import { reactLocalStorage } from 'reactjs-localstorage'; import { reactLocalStorage } from 'reactjs-localstorage';
import AppState from '../AppState'; import AppState from '../AppState';
import { Button } from '../components/buttons/Button/Button'; import { Button } from '../components/buttons/Button/Button';
import { FQN_SEPARATOR_CHAR } from '../constants/char.constants';
import { import {
imageTypes, imageTypes,
LOCALSTORAGE_RECENTLY_SEARCHED, LOCALSTORAGE_RECENTLY_SEARCHED,
@ -65,9 +66,9 @@ export const isEven = (value: number): boolean => {
}; };
export const getTableFQNFromColumnFQN = (columnFQN: string): string => { export const getTableFQNFromColumnFQN = (columnFQN: string): string => {
const arrColFQN = columnFQN.split('.'); const arrColFQN = columnFQN.split(FQN_SEPARATOR_CHAR);
return arrColFQN.slice(0, arrColFQN.length - 1).join('.'); return arrColFQN.slice(0, arrColFQN.length - 1).join(FQN_SEPARATOR_CHAR);
}; };
export const getPartialNameFromFQN = ( export const getPartialNameFromFQN = (
@ -75,7 +76,7 @@ export const getPartialNameFromFQN = (
arrTypes: Array<'service' | 'database' | 'table' | 'column'> = [], arrTypes: Array<'service' | 'database' | 'table' | 'column'> = [],
joinSeperator = '/' joinSeperator = '/'
): string => { ): string => {
const arrFqn = fqn.split('.'); const arrFqn = fqn.split(FQN_SEPARATOR_CHAR);
const arrPartialName = []; const arrPartialName = [];
for (const type of arrTypes) { for (const type of arrTypes) {
if (type === 'service' && arrFqn.length > 0) { if (type === 'service' && arrFqn.length > 0) {
@ -473,7 +474,7 @@ export const getDocButton = (label: string, url: string, dataTestId = '') => {
}; };
export const getNameFromFQN = (fqn: string): string => { export const getNameFromFQN = (fqn: string): string => {
const arr = fqn.split('.'); const arr = fqn.split(FQN_SEPARATOR_CHAR);
return arr[arr.length - 1]; return arr[arr.length - 1];
}; };

View File

@ -36,6 +36,7 @@ import {
SelectedNode, SelectedNode,
} from '../components/EntityLineage/EntityLineage.interface'; } from '../components/EntityLineage/EntityLineage.interface';
import Loader from '../components/Loader/Loader'; import Loader from '../components/Loader/Loader';
import { FQN_SEPARATOR_CHAR } from '../constants/char.constants';
import { import {
nodeHeight, nodeHeight,
nodeWidth, nodeWidth,
@ -57,7 +58,7 @@ export const getHeaderLabel = (
fqn: string, fqn: string,
type: string, type: string,
isMainNode: boolean, isMainNode: boolean,
separator = '.' separator = FQN_SEPARATOR_CHAR
) => { ) => {
const length = v.split(separator).length; const length = v.split(separator).length;
@ -420,7 +421,7 @@ export const getLineageData = (
export const getDataLabel = ( export const getDataLabel = (
displayName?: string, displayName?: string,
name = '', name = '',
separator = '.', separator = FQN_SEPARATOR_CHAR,
isTextOnly = false, isTextOnly = false,
type?: string type?: string
) => { ) => {

View File

@ -17,6 +17,7 @@ import { Bucket, ExtraInfo, LeafNodes, LineagePos } from 'Models';
import React from 'react'; import React from 'react';
import Avatar from '../components/common/avatar/Avatar'; import Avatar from '../components/common/avatar/Avatar';
import TableProfilerGraph from '../components/TableProfiler/TableProfilerGraph.component'; import TableProfilerGraph from '../components/TableProfiler/TableProfilerGraph.component';
import { FQN_SEPARATOR_CHAR } from '../constants/char.constants';
import { import {
getDatabaseDetailsPath, getDatabaseDetailsPath,
getServiceDetailsPath, getServiceDetailsPath,
@ -92,8 +93,8 @@ export const getEntityOverview = (
const [service, database] = getPartialNameFromFQN( const [service, database] = getPartialNameFromFQN(
fullyQualifiedName ?? '', fullyQualifiedName ?? '',
['service', 'database'], ['service', 'database'],
'.' FQN_SEPARATOR_CHAR
).split('.'); ).split(FQN_SEPARATOR_CHAR);
const ownerValue = getOwnerFromId(owner?.id); const ownerValue = getOwnerFromId(owner?.id);
const tier = getTierFromTableTags(tags || []); const tier = getTierFromTableTags(tags || []);
const usage = !isNil(usageSummary?.weeklyStats?.percentileRank) const usage = !isNil(usageSummary?.weeklyStats?.percentileRank)
@ -118,7 +119,7 @@ export const getEntityOverview = (
getPartialNameFromFQN( getPartialNameFromFQN(
fullyQualifiedName ?? '', fullyQualifiedName ?? '',
['service', 'database'], ['service', 'database'],
'.' FQN_SEPARATOR_CHAR
) )
), ),
isLink: true, isLink: true,
@ -135,7 +136,7 @@ export const getEntityOverview = (
}, },
{ {
name: 'Tier', name: 'Tier',
value: tier ? tier.split('.')[1] : '--', value: tier ? tier.split(FQN_SEPARATOR_CHAR)[1] : '--',
isLink: false, isLink: false,
}, },
{ {
@ -213,12 +214,12 @@ export const getEntityOverview = (
}, },
{ {
name: 'Tier', name: 'Tier',
value: tier ? tier.split('.')[1] : '--', value: tier ? tier.split(FQN_SEPARATOR_CHAR)[1] : '--',
isLink: false, isLink: false,
}, },
{ {
name: `${serviceType} url`, name: `${serviceType} url`,
value: fullyQualifiedName?.split('.')[1] as string, value: fullyQualifiedName?.split(FQN_SEPARATOR_CHAR)[1] as string,
url: pipelineUrl as string, url: pipelineUrl as string,
isLink: true, isLink: true,
isExternal: true, isExternal: true,
@ -261,12 +262,14 @@ export const getEntityOverview = (
}, },
{ {
name: 'Tier', name: 'Tier',
value: tier ? tier.split('.')[1] : '--', value: tier ? tier.split(FQN_SEPARATOR_CHAR)[1] : '--',
isLink: false, isLink: false,
}, },
{ {
name: `${serviceType} url`, name: `${serviceType} url`,
value: displayName || (fullyQualifiedName?.split('.')[1] as string), value:
displayName ||
(fullyQualifiedName?.split(FQN_SEPARATOR_CHAR)[1] as string),
url: dashboardUrl as string, url: dashboardUrl as string,
isLink: true, isLink: true,
isExternal: true, isExternal: true,

View File

@ -18,6 +18,7 @@ import Markdown from 'markdown-to-jsx';
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import ReactDOMServer from 'react-dom/server'; import ReactDOMServer from 'react-dom/server';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { FQN_SEPARATOR_CHAR } from '../constants/char.constants';
import { DESCRIPTIONLENGTH, getTeamDetailsPath } from '../constants/constants'; import { DESCRIPTIONLENGTH, getTeamDetailsPath } from '../constants/constants';
import { ChangeType } from '../enums/entity.enum'; import { ChangeType } from '../enums/entity.enum';
import { Column } from '../generated/entity/data/table'; import { Column } from '../generated/entity/data/table';
@ -194,11 +195,11 @@ export const getPreposition = (type: ChangeType) => {
}; };
const getColumnName = (column: string) => { const getColumnName = (column: string) => {
const name = column.split('.'); const name = column.split(FQN_SEPARATOR_CHAR);
const length = name.length; const length = name.length;
return name return name
.slice(length > 1 ? 1 : 0, length > 1 ? length - 1 : length) .slice(length > 1 ? 1 : 0, length > 1 ? length - 1 : length)
.join('.'); .join(FQN_SEPARATOR_CHAR);
}; };
const getLinkWithColumn = (column: string, eFqn: string, eType: string) => { const getLinkWithColumn = (column: string, eFqn: string, eType: string) => {
@ -348,7 +349,7 @@ export const feedSummaryFromatter = (
) : null} ) : null}
{tier ? ( {tier ? (
<p key={uniqueId()}>{`${type} tier ${ <p key={uniqueId()}>{`${type} tier ${
tier?.tagFQN?.split('.')[1] tier?.tagFQN?.split(FQN_SEPARATOR_CHAR)[1]
}`}</p> }`}</p>
) : null} ) : null}
</div> </div>

View File

@ -25,7 +25,10 @@ import {
getGlossaryTerms, getGlossaryTerms,
} from '../axiosAPIs/glossaryAPI'; } from '../axiosAPIs/glossaryAPI';
import { searchData } from '../axiosAPIs/miscAPI'; import { searchData } from '../axiosAPIs/miscAPI';
import { WILD_CARD_CHAR } from '../constants/char.constants'; import {
FQN_SEPARATOR_CHAR,
WILD_CARD_CHAR,
} from '../constants/char.constants';
import { SearchIndex } from '../enums/search.enum'; import { SearchIndex } from '../enums/search.enum';
import { GlossaryTerm } from '../generated/entity/data/glossaryTerm'; import { GlossaryTerm } from '../generated/entity/data/glossaryTerm';
import { ModifiedGlossaryData } from '../pages/GlossaryPage/GlossaryPageV1.component'; import { ModifiedGlossaryData } from '../pages/GlossaryPage/GlossaryPageV1.component';
@ -125,7 +128,7 @@ const createGlossaryTermNode = (
name: string name: string
): GlossaryTermTreeNode => { ): GlossaryTermTreeNode => {
const arrFQN = leafFqn.split(`${name}.`); const arrFQN = leafFqn.split(`${name}.`);
const childName = arrFQN[1]?.split('.')[0]; const childName = arrFQN[1]?.split(FQN_SEPARATOR_CHAR)[0];
return !childName return !childName
? { ? {
@ -182,7 +185,7 @@ export const getSearchedGlossaryTermTree = (
): GlossaryTermTreeNode[] => { ): GlossaryTermTreeNode[] => {
const termTree: GlossaryTermTreeNode[] = []; const termTree: GlossaryTermTreeNode[] = [];
for (const term of searchedTerms) { for (const term of searchedTerms) {
const arrFQN = term.fqdn.split('.'); const arrFQN = term.fqdn.split(FQN_SEPARATOR_CHAR);
const rootName = arrFQN[0]; const rootName = arrFQN[0];
termTree.push(createGlossaryTermNode(term.fqdn, rootName)); termTree.push(createGlossaryTermNode(term.fqdn, rootName));
} }
@ -235,7 +238,7 @@ export const getActionsList = () => {
* @returns list of fqns * @returns list of fqns
*/ */
export const getHierarchicalKeysByFQN = (fqn: string) => { export const getHierarchicalKeysByFQN = (fqn: string) => {
const keys = fqn.split('.').reduce((prev, curr) => { 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]}.${curr}` : curr;
return [...prev, currFqn]; return [...prev, currFqn];