Skip to content

Commit 0ec7e43

Browse files
committed
fix(FR-1876): remove unnecessary filter for resource usage values in MyResourceWithinResourceGroup (#4951)
Resolves #4952 ([FR-1876](https://lablup.atlassian.net/browse/FR-1876)) # Improved Resource Slot Filtering Logic This PR refines the filtering logic for resource slots in the `MyResourceWithinResourceGroup` component. Previously, slots were hidden when both `usingCurrent` and `remainingCurrent` values were zero or not finite. The updated logic now only hides resource slots when both values are not finite numbers, allowing slots with zero values to be displayed. **Checklist:** - [ ] Documentation - [ ] Minium required manager version - [ ] Specific setting for review (eg., KB link, endpoint or how to setup) - [ ] Minimum requirements to check during review - [ ] Test case(s) to demonstrate the difference of before/after [FR-1876]: https://lablup.atlassian.net/browse/FR-1876?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 1954b61 commit 0ec7e43

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

react/src/components/MyResourceWithinResourceGroup.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,8 @@ const MyResourceWithinResourceGroup: React.FC<
144144
?.remaining?.[key as ResourceSlotName],
145145
);
146146

147-
// Filter out if both using and remaining have no values
148-
if (
149-
(usingCurrent === 0 || !isFinite(usingCurrent)) &&
150-
(remainingCurrent === 0 || !isFinite(remainingCurrent))
151-
)
152-
return null;
147+
// Skip displaying if both used and free are not finite numbers
148+
if (!isFinite(usingCurrent) && !isFinite(remainingCurrent)) return null;
153149

154150
return {
155151
key,

0 commit comments

Comments
 (0)