-
Notifications
You must be signed in to change notification settings - Fork 75
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: percent calcuation and typescript deifinition in agent list #2690
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This stack of pull requests is managed by Graphite. Learn more about stacking. |
d38375d
to
9302462
Compare
ironAiken2
approved these changes
Sep 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
lizable
approved these changes
Sep 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Merge activity
|
…#2690) ### TL;DR Refactored the AgentList component to improve type safety and code readability. ### What changed? - Improved type safety by explicitly defining types for `parsedOccupiedSlots` and `parsedAvailableSlots`. - Refactored the rendering logic for resource allocation to use a more consistent approach across different resource types. - Simplified calculations for percentage values and improved variable naming. - Consolidated duplicate code into reusable logic for CPU, memory, and other resource types. ### How to test? 1. Navigate to the Agent List view in the application. 2. Verify that the allocation information for CPU, memory, and other resources is displayed correctly. 3. Check that the progress bars accurately reflect the resource usage percentages. 4. Ensure that the color coding (red for high usage, green for normal usage) is working as expected. ### Why make this change? This refactoring improves code maintainability and reduces the likelihood of bugs by: 1. Enhancing type safety, which helps catch potential errors at compile-time. 2. Reducing code duplication, making it easier to update and maintain the component. 3. Improving readability, making it easier for developers to understand and work with the code. 4. Ensuring consistent handling of different resource types, which can simplify future additions or modifications to resource allocation display.
92df5b7
to
d52c682
Compare
9302462
to
b49b666
Compare
Base automatically changed from
refactor/remove-hard-coded-resource-name
to
main
September 5, 2024 02:56
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL;DR
Refactored the AgentList component to improve type safety and code readability.
What changed?
parsedOccupiedSlots
andparsedAvailableSlots
.How to test?
Why make this change?
This refactoring improves code maintainability and reduces the likelihood of bugs by: