Skip to content

Commit 70f60b4

Browse files
committed
feat(FR-1419): improve resource terminology and unlimited value display in Dashboard (#4208)
Resolves #4207 ([FR-1419](https://lablup.atlassian.net/browse/FR-1419)) This PR improves resource-related UI terminology for better user understanding and consistency across the application, specifically focusing on Korean terminology standardization and unlimited value display enhancement. ## Changes ### Terminology Updates - **Korean**: "나의 자원" → "나의 총 자원 제한" (My Resources → My Total Resource Limit) - **Korean**: "가용량" → "허용량" (Available → Limits) - **Korean**: "무한대" → "제한없음" - Updated all language files consistently across 22+ locales ### Component Enhancements - Enhanced `BAIResourceWithSteppedProgress` component to properly display unlimited values with internationalized text instead of raw symbols - Improved resource calculation logic using `_.toNumber()` instead of `_.toInteger()` for better edge case handling - Updated `BaseResourceItem` and `MyResource` components with proper type options for "Usage" vs "Limits" display ### Technical Improvements - Added proper i18n support for unlimited value display - Improved numeric conversion methods for resource calculations - Enhanced segmented control options for resource display types **Checklist:** - [x] Documentation - Updated i18n files across all languages - [ ] Minimum required manager version - Not applicable - [ ] Specific setting for review - Test with Korean locale to verify terminology changes - [x] Minimum requirements to check during review - Verify unlimited values display correctly, terminology is consistent - [x] Test case(s) - Check resource panels show proper Korean terminology and unlimited values render as "제한없음" [FR-1419]: https://lablup.atlassian.net/browse/FR-1419?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 32e3c50 commit 70f60b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+212
-85
lines changed

packages/backend.ai-ui/src/components/BAIResourceWithSteppedProgress.tsx

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { divideNumberWithUnits, parseValueWithUnit } from '../helper';
22
import BAIFlex from './BAIFlex';
33
import { theme, Typography, Tooltip } from 'antd';
44
import _ from 'lodash';
5+
import { useTranslation } from 'react-i18next';
56

67
// Use Intl.NumberFormat for grouping and up to 2 decimal places (trims trailing zeros)
78
const numberFormatter = new Intl.NumberFormat('en-US', {
@@ -106,6 +107,7 @@ const BAIResourceWithSteppedProgress: React.FC<
106107
showProgress = true,
107108
}) => {
108109
const { token } = theme.useToken();
110+
const { t } = useTranslation();
109111

110112
const { formattedCurrent, formattedTotal, currentUnit, totalUnit } =
111113
formatResourceValues(title, current, total, displayUnit, unlimitedValue);
@@ -136,17 +138,38 @@ const BAIResourceWithSteppedProgress: React.FC<
136138
marginBottom: 8,
137139
}}
138140
>
139-
<Typography.Text
140-
style={{
141-
fontSize: 32,
142-
lineHeight: '1em',
143-
fontWeight: 700,
144-
color: token.colorSuccess,
145-
}}
146-
>
147-
{displayFormattedCurrent}
148-
</Typography.Text>
149-
{!_.isNaN(current) && <Typography.Text>{displayUnit}</Typography.Text>}
141+
{displayFormattedCurrent === unlimitedValue ? (
142+
<Typography.Text
143+
style={{
144+
fontSize: 32,
145+
lineHeight: '1em',
146+
}}
147+
>
148+
<Typography.Text
149+
style={{
150+
lineHeight: '1em',
151+
}}
152+
>
153+
{t('comp:BAIResourceWithSteppedProgress.Unlimited')}
154+
</Typography.Text>
155+
</Typography.Text>
156+
) : (
157+
<>
158+
<Typography.Text
159+
style={{
160+
fontSize: 32,
161+
lineHeight: '1em',
162+
fontWeight: 700,
163+
color: token.colorSuccess,
164+
}}
165+
>
166+
{displayFormattedCurrent}
167+
</Typography.Text>
168+
{!_.isNaN(current) && (
169+
<Typography.Text>{displayUnit}</Typography.Text>
170+
)}
171+
</>
172+
)}
150173
</BAIFlex>
151174
{showProgress && (
152175
<Tooltip

packages/backend.ai-ui/src/locale/de.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"comp:BAIPropertyFilter": {
1515
"PlaceHolder": "Suche",
1616
"ResetFilter": "Filter zurücksetzen"
17+
},
18+
"comp:BAIResourceWithSteppedProgress": {
19+
"Unlimited": "Unbegrenzt"
1720
}
1821
}

packages/backend.ai-ui/src/locale/el.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"comp:BAIPropertyFilter": {
1515
"PlaceHolder": "Αναζήτηση",
1616
"ResetFilter": "Επαναφορά φίλτρων"
17+
},
18+
"comp:BAIResourceWithSteppedProgress": {
19+
"Unlimited": "Απεριόριστος"
1720
}
1821
}

packages/backend.ai-ui/src/locale/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"comp:BAIPropertyFilter": {
1515
"PlaceHolder": "Search",
1616
"ResetFilter": "Reset filters"
17+
},
18+
"comp:BAIResourceWithSteppedProgress": {
19+
"Unlimited": "Unlimited"
1720
}
1821
}

packages/backend.ai-ui/src/locale/es.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"comp:BAIPropertyFilter": {
1515
"PlaceHolder": "Buscar en",
1616
"ResetFilter": "Restablecer filtros"
17+
},
18+
"comp:BAIResourceWithSteppedProgress": {
19+
"Unlimited": "Ilimitado"
1720
}
1821
}

packages/backend.ai-ui/src/locale/fi.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"comp:BAIPropertyFilter": {
1515
"PlaceHolder": "Etsi",
1616
"ResetFilter": "Nollaa suodattimet"
17+
},
18+
"comp:BAIResourceWithSteppedProgress": {
19+
"Unlimited": "Rajoittamaton"
1720
}
1821
}

packages/backend.ai-ui/src/locale/fr.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"comp:BAIPropertyFilter": {
1515
"PlaceHolder": "Recherche",
1616
"ResetFilter": "Réinitialiser les filtres"
17+
},
18+
"comp:BAIResourceWithSteppedProgress": {
19+
"Unlimited": "Illimité"
1720
}
1821
}

packages/backend.ai-ui/src/locale/id.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"comp:BAIPropertyFilter": {
1515
"PlaceHolder": "Pencarian",
1616
"ResetFilter": "Setel ulang filter"
17+
},
18+
"comp:BAIResourceWithSteppedProgress": {
19+
"Unlimited": "Tak terbatas"
1720
}
1821
}

packages/backend.ai-ui/src/locale/it.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"comp:BAIPropertyFilter": {
1515
"PlaceHolder": "Ricerca",
1616
"ResetFilter": "Reimposta i filtri"
17+
},
18+
"comp:BAIResourceWithSteppedProgress": {
19+
"Unlimited": "Illimitato"
1720
}
1821
}

packages/backend.ai-ui/src/locale/ja.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"comp:BAIPropertyFilter": {
1515
"PlaceHolder": "検索",
1616
"ResetFilter": "フィルターをリセットする"
17+
},
18+
"comp:BAIResourceWithSteppedProgress": {
19+
"Unlimited": "無制限"
1720
}
1821
}

0 commit comments

Comments
 (0)