Skip to content

Commit fec2e5d

Browse files
committed
fix: review
1 parent 4c32c58 commit fec2e5d

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/ProgressWrapper.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,23 @@ interface ProgressWrapperProps {
1717
width?: number;
1818
}
1919

20+
const isValidValue = (val?: number | string): boolean =>
21+
isNumeric(val) && safeParseNumber(val) >= 0;
22+
2023
export function ProgressWrapper({
2124
value,
2225
capacity,
2326
formatValues = defaultFormatProgressValues,
2427
className,
2528
width = DEFAULT_PROGRESS_WIDTH,
2629
}: ProgressWrapperProps) {
27-
if (!isNumeric(value)) {
30+
if (!isValidValue(value)) {
2831
return <div className={className}>{i18n('alert_no-data')}</div>;
2932
}
3033

3134
const numericValue = safeParseNumber(value);
3235
const numericCapacity = safeParseNumber(capacity);
3336

34-
if (numericValue < 0) {
35-
return <div className={className}>{i18n('alert_no-data')}</div>;
36-
}
37-
3837
const rawPercentage =
3938
numericCapacity > 0
4039
? Math.floor((numericValue / numericCapacity) * MAX_PERCENTAGE)

src/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function TenantStorage({tenantName, metrics}: TenantStorageProps) {
8989
return (
9090
<React.Fragment>
9191
<TenantDashboard database={tenantName} charts={storageDashboardConfig} />
92-
<InfoViewer variant="small" title={i18n('storage.storage-details-title')} info={info} />
92+
<InfoViewer variant="small" title={i18n('title_storage-details')} info={info} />
9393

9494
<div className={tenantStorageCn('tabs-container')}>
9595
<TabProvider value={storageTab}>

src/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"charts.cpu-usage": "CPU usage by pool",
3636
"charts.storage-usage": "Tablet storage usage",
3737
"charts.memory-usage": "Memory usage",
38-
"storage.storage-details-title": "Storage Details",
38+
"title_storage-details": "Storage Details",
3939
"storage.tablet-storage-title": "Tablet storage",
4040
"storage.tablet-storage-description": "Size of user data and indexes stored in schema objects (tables, topics, etc.)",
4141
"storage.db-storage-title": "Database storage",

0 commit comments

Comments
 (0)