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