-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix(integer validation): limit range to the accepted range of the dhis2-core #364
Conversation
🚀 Deployed on https://pr-364--dhis2-data-entry.netlify.app |
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.
Approach looks good. I'm not sure the check is working totally as intended (see comments).
Two other things I noticed (not related to your changes):
- I tried testing with an existing data element of type
INTEGER
(BCG Doses Given, which is on Child Health data set) (https://debug.dhis2.org/dev/api/dataElements/s46m5MS0hxu), and there it seemed like any negative values were being rejected by the backend 🤔 - it seems all validations are rerunning any time any value in the form changes. I guess the validation checks aren't very intensive, but that seems like we wouldn't want that?
Note that this touches code that was changed in: #357 |
@Birkbjo interesting! I assume min-max limits are also constrained by the BE's integer validation, but that's just an uneducated guess. Do you know @stian-sandvold? |
I don't think we validate those numbers anywhere, but we do store them as ints. |
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.
looks good!
@Birkbjo: confirmed by @stian-sandvold: We can assume that min-max limits also adhere to the integer range restrictions |
## [100.3.9](v100.3.8...v100.3.9) (2023-12-14) ### Bug Fixes * **integer validation:** limit range to the accepted range of the dhis2-core ([#364](#364)) ([0d3d41c](0d3d41c))
🎉 This PR is included in version 100.3.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes DHIS2-14075
Doc comment from
is-integer.js
: