= ({
-
+
{`${startWith}${tag}`}
{editable && isRemovable && (
) => {
e.preventDefault();
diff --git a/openmetadata-ui/src/main/resources/ui/src/interface/types.d.ts b/openmetadata-ui/src/main/resources/ui/src/interface/types.d.ts
index 06ebbfdd9ec..8782f9b0800 100644
--- a/openmetadata-ui/src/main/resources/ui/src/interface/types.d.ts
+++ b/openmetadata-ui/src/main/resources/ui/src/interface/types.d.ts
@@ -413,4 +413,13 @@ declare module 'Models' {
id: string | undefined;
state: boolean;
}
+
+ export type ExtraInfo = {
+ key?: string;
+ value: string | number | React.ReactNode;
+ isLink?: boolean;
+ placeholderText?: string;
+ openInNewTab?: boolean;
+ showLabel?: boolean;
+ };
}
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 12eb7b609c6..c032e35d3b8 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
@@ -408,7 +408,6 @@ const DatabaseDetails: FunctionComponent = () => {
{table.tags?.map((tag, tagIndex) => (
{
? tag.tagFQN.split('.')[1]
: tag.tagFQN,
}}
+ type="label"
/>
))}
{getTableTags(table.columns).map(
(tag, tagIdx) => (
)
)}
diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx
index 64ee2af9305..2f103eb0d0b 100644
--- a/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/utils/EntityUtils.tsx
@@ -11,9 +11,10 @@
* limitations under the License.
*/
-import { isEmpty, isNil } from 'lodash';
-import { Bucket, LeafNodes, LineagePos } from 'Models';
+import { isEmpty, isNil, isString } from 'lodash';
+import { Bucket, ExtraInfo, LeafNodes, LineagePos } from 'Models';
import React from 'react';
+import Avatar from '../components/common/avatar/Avatar';
import TableProfilerGraph from '../components/TableProfiler/TableProfilerGraph.component';
import {
getDatabaseDetailsPath,
@@ -30,6 +31,7 @@ import { Edge, EntityLineage } from '../generated/type/entityLineage';
import { EntityReference } from '../generated/type/entityUsage';
import { TagLabel } from '../generated/type/tagLabel';
import { getPartialNameFromFQN } from './CommonUtils';
+import SVGIcons from './SvgUtils';
import {
getOwnerFromId,
getTierFromTableTags,
@@ -324,3 +326,81 @@ export const isLeafNode = (
return false;
}
};
+
+export const getInfoElements = (data: ExtraInfo) => {
+ let retVal = <>>;
+ const displayVal = data.placeholderText || data.value;
+
+ switch (data.key) {
+ case 'Owner':
+ {
+ retVal =
+ displayVal && displayVal !== '--' ? (
+ isString(displayVal) ? (
+
+ ) : (
+ <>>
+ )
+ ) : (
+ <>No Owner>
+ );
+ }
+
+ break;
+ case 'Tier':
+ {
+ retVal = !displayVal || displayVal === '--' ? <>No Tier> : <>>;
+ }
+
+ break;
+ default:
+ {
+ retVal = (
+ <>
+ {data.key
+ ? displayVal
+ ? data.showLabel
+ ? `${data.key}: `
+ : null
+ : `No ${data.key}`
+ : null}
+ >
+ );
+ }
+
+ break;
+ }
+
+ return (
+ <>
+ {retVal}
+ {displayVal ? (
+
+ {data.isLink ? (
+
+ <>
+ {displayVal}
+ {data.openInNewTab && (
+
+ )}
+ >
+
+ ) : (
+ displayVal
+ )}
+
+ ) : null}
+ >
+ );
+};
diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/SvgUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/SvgUtils.tsx
index 4873efbba41..fd2b5cc47aa 100644
--- a/openmetadata-ui/src/main/resources/ui/src/utils/SvgUtils.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/utils/SvgUtils.tsx
@@ -82,6 +82,7 @@ import IconSlackGrey from '../assets/svg/slack-grey.svg';
import IconSlack from '../assets/svg/slack.svg';
import IconTableGrey from '../assets/svg/table-grey.svg';
import IconTable from '../assets/svg/table.svg';
+import IconTagGrey from '../assets/svg/tag-grey.svg';
import IconTag from '../assets/svg/tag.svg';
import IconTerns from '../assets/svg/terms.svg';
import IconTier from '../assets/svg/tier.svg';
@@ -179,6 +180,7 @@ export const Icons = {
ICON_PLUS: 'icon-plus',
ICON_MINUS: 'icon-minus',
TAG: 'icon-tag',
+ TAG_GREY: 'icon-tag-grey',
TIER: 'icon-tier',
SEARCHV1: 'icon-searchv1',
};
@@ -506,6 +508,10 @@ const SVGIcons: FunctionComponent = ({
case Icons.TAG:
IconComponent = IconTag;
+ break;
+ case Icons.TAG_GREY:
+ IconComponent = IconTagGrey;
+
break;
case Icons.TIER:
IconComponent = IconTier;
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 2d356a1445a..d52ca2d3bdf 100644
--- a/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/utils/TableUtils.tsx
@@ -51,11 +51,13 @@ export const usageSeverity = (value: number): string => {
}
};
-export const getUsagePercentile = (pctRank: number) => {
+export const getUsagePercentile = (pctRank: number, isLiteral = false) => {
const percentile = Math.round(pctRank * 10) / 10;
const ordinalPercentile = ordinalize(percentile);
const strSeverity = usageSeverity(percentile);
- const usagePercentile = `${strSeverity} - ${ordinalPercentile} pctile`;
+ const usagePercentile = `${strSeverity}${
+ isLiteral ? ' usage' : ''
+ } - ${ordinalPercentile} pctile`;
return usagePercentile;
};
|