-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve error handling and edge cases of UnitInputSelection #119
Conversation
We use binary representation for host resources like memory and disk space. However, the UI shows "GB" instead of "GiB" which is actually used.
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.
diff in webpack/components/ResourceQuotaForm/ResourceQuotaFormConstants.js LGTM; I cannot really comment on the rest. Handing over to Thorben.
Feel free to ping me again once you have it running on nightly if you need someone to test this.
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.
The React component 'UnitInputField' prints an error if a user wants to type a value which is a float in the corresponding base unit, for example 5.5 MiB for the memory limit. Instead of showing an error, we introduce a warning which says that the value is rounded to the next lower value (5.0 MiB).
b1808a5
to
96af3f1
Compare
* Add snapshots covering default params and disabled view * Add interactive tests to verify onChange and input validation functions are called
96af3f1
to
e149671
Compare
@maximiliankolb @Thorben-D thanks a lot for your review! 🐧 @Thorben-D I've attached some tests, could you have another look and let me know if you think anything might be missing? |
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.
Thank you for adding some tests! Test-code looks good as well.
Thanks @Thorben-D! 🐠 |
This PR resolves three issues with the React component
UnitInputField
which is used when typing the resource limits of a Resource Quota.From error to floor warning
The UnitInputField prints an error if a user wants to type a value which is a float in the corresponding base unit, for example 5.5 MiB for the memory limit.
Instead of showing an error, we introduce a warning which says that the value is rounded to the next lower value (5.0 MiB):
Before
New
No more natural
Moreover, we introduce a more generic error message if no number is given (removing the word 'natural' as it is quite mathematical/technical):
Before
New
Actually, it's Mebi
We are internally using MebiBytes (MiB) for memory and disk space. However, the UI stated "MB" and others.
Before
New