Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improve resource allocation form item labels with resource details API #2485

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

yomybaby
Copy link
Member

@yomybaby yomybaby commented Jun 19, 2024

TL;DR

Add functionality to use resourceSlotsDetails for better resource information display in ResourceAllocationFormItems and ResourceNumber components.

What changed?

  • Imported useResourceSlotsDetails from backendai hooks
  • Added resourceSlotsDetails usage in ResourceAllocationFormItems
  • Updated ResourceNumber component to use resourceSlotsDetails for better display of resources
  • Adjusted stale time for useResourceSlotsDetails query

How to test?

  1. Ensure that the resource display reflects human-readable names and units as provided by resourceSlotsDetails.
  2. Check the display of CPU and memory resources in the ResourceAllocationFormItems.
  3. Verify the ResourceNumber component displays the updated format and units.

Why make this change?

Enhances the clarity and accuracy of resource information displayed to the users through the ResourceAllocationFormItems and ResourceNumber components by utilizing detailed slot information.


Checklist: (if applicable)

  • Mention to the original issue
  • 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

@github-actions github-actions bot added the size:L 100~500 LoC label Jun 19, 2024
Copy link
Member Author

yomybaby commented Jun 19, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @yomybaby and the rest of your teammates on Graphite Graphite

@yomybaby yomybaby changed the title feat: use number_format of useResourceResourceSlotDetails feat: use number_format of useResourceSlotDetails Jun 19, 2024
Copy link

github-actions bot commented Jun 19, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements 2.82% 140/4965
🔴 Branches
3% (-0.01% 🔻)
101/3370
🔴 Functions 1.66% 27/1631
🔴 Lines 2.69% 131/4875

Test suite run success

51 tests passing in 5 suites.

Report generated by 🧪jest coverage report action from a3638bf

@yomybaby yomybaby force-pushed the feature/use-resource-slot-details branch from 7ab7cb4 to 6b32b37 Compare June 19, 2024 10:28
@github-actions github-actions bot added size:M 30~100 LoC and removed size:L 100~500 LoC labels Jun 19, 2024
@yomybaby yomybaby mentioned this pull request Jun 19, 2024
6 tasks
@yomybaby yomybaby changed the title feat: use number_format of useResourceSlotDetails feat: improve resource allocation form item labels with resource details API Jun 19, 2024
@yomybaby yomybaby force-pushed the feature/use-resource-slot-details branch 2 times, most recently from e42dd94 to a7394f7 Compare June 19, 2024 10:50
@yomybaby yomybaby marked this pull request as ready for review June 19, 2024 10:58
@yomybaby yomybaby force-pushed the feature/use-resource-slot-details branch from a7394f7 to 5fecf76 Compare June 19, 2024 11:04
@yomybaby yomybaby changed the title feat: improve resource allocation form item labels with resource details API Refactor: update resource type and details handling Jun 19, 2024
@yomybaby yomybaby changed the title Refactor: update resource type and details handling refactor: improve resource allocation form item labels with resource details API Jun 19, 2024
Copy link
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

graphite-app bot commented Jun 24, 2024

Merge activity

…details API (#2485)

### TL;DR

Add functionality to use `resourceSlotsDetails` for better resource information display in `ResourceAllocationFormItems` and `ResourceNumber` components.

### What changed?

- Imported `useResourceSlotsDetails` from `backendai` hooks
- Added `resourceSlotsDetails` usage in `ResourceAllocationFormItems`
- Updated `ResourceNumber` component to use `resourceSlotsDetails` for better display of resources
- Adjusted stale time for `useResourceSlotsDetails` query

### How to test?

1. Ensure that the resource display reflects human-readable names and units as provided by `resourceSlotsDetails`.
2. Check the display of CPU and memory resources in the `ResourceAllocationFormItems`.
3. Verify the `ResourceNumber` component displays the updated format and units.

### Why make this change?

Enhances the clarity and accuracy of resource information displayed to the users through the `ResourceAllocationFormItems` and `ResourceNumber` components by utilizing detailed slot information.

---

<!--
Please precisely, concisely, and concretely describe what this PR changes, the rationale behind codes,
and how it affects the users and other developers.
-->

**Checklist:** (if applicable)

- [ ] Mention to the original issue
- [ ] 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
@yomybaby yomybaby force-pushed the feature/use-resource-slot-details branch from 5fecf76 to a3638bf Compare June 24, 2024 02:58
@graphite-app graphite-app bot merged commit a3638bf into main Jun 24, 2024
5 checks passed
@graphite-app graphite-app bot deleted the feature/use-resource-slot-details branch June 24, 2024 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M 30~100 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants