mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-03 12:08:31 +00:00
parent
3cef7ed4cc
commit
5fe741be9e
@ -35,6 +35,7 @@ import {
|
||||
getOwnerValue,
|
||||
} from '../../../utils/CommonUtils';
|
||||
import { serviceTypeLogo } from '../../../utils/ServiceUtils';
|
||||
import { getUsagePercentile } from '../../../utils/TableUtils';
|
||||
import { SearchedDataProps } from '../../searched-data/SearchedData.interface';
|
||||
import '../table-data-card/TableDataCard.style.css';
|
||||
import TableDataCardBody from '../table-data-card/TableDataCardBody';
|
||||
@ -92,8 +93,10 @@ const TableDataCardV2: React.FC<TableDataCardPropsV2> = ({
|
||||
|
||||
if ('usageSummary' in source) {
|
||||
_otherDetails.push({
|
||||
key: 'Usage',
|
||||
value: source.usageSummary?.weeklyStats?.count,
|
||||
value: getUsagePercentile(
|
||||
source.usageSummary?.weeklyStats?.percentileRank || 0,
|
||||
true
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -314,7 +314,8 @@
|
||||
"clearAll": "Clear All",
|
||||
"view-less": "View less",
|
||||
"view-more": "View more",
|
||||
"column-plural": "Columns"
|
||||
"column-plural": "Columns",
|
||||
"pctile-lowercase": "pctile"
|
||||
},
|
||||
"message": {
|
||||
"service-email-required": "Service account Email is required",
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
import classNames from 'classnames';
|
||||
import i18n from 'i18next';
|
||||
import { upperCase } from 'lodash';
|
||||
import { EntityTags } from 'Models';
|
||||
import React from 'react';
|
||||
@ -73,8 +74,8 @@ export const getUsagePercentile = (pctRank: number, isLiteral = false) => {
|
||||
const percentile = Math.round(pctRank * 10) / 10;
|
||||
const ordinalPercentile = ordinalize(percentile);
|
||||
const usagePercentile = `${
|
||||
isLiteral ? 'Usage' : ''
|
||||
} - ${ordinalPercentile} pctile`;
|
||||
isLiteral ? i18n.t('label.usage') : ''
|
||||
} - ${ordinalPercentile} ${i18n.t('label.pctile-lowercase')}`;
|
||||
|
||||
return usagePercentile;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user