-
Notifications
You must be signed in to change notification settings - Fork 307
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
Enable reading validation via admin input #989
Enable reading validation via admin input #989
Conversation
…into new_UI_setChecks
The TypeScript compiler was throwing errors because it couldn't find the properties 'min' and 'max' on the type 'BarReading'. The issue arises because TypeScript is unaware that 'min' and 'max' are only accessed when 'readings' is an array of 'LineReadings'. This commit adds a type guard to explicitly inform TypeScript about the type of 'reading', resolving the issue.
Fixed for a comment that was not clear in my review to resolve this.
I made a few minor changes to the code. I don't think there are any issues but I'll give others one day to see if there are any issues before I merge this code. |
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.
I want to thank all the developers of this code for being willing to implement additional features after the pull request was created, being so careful in finding a few things I missed and the speed with which they did all their work. The changes address all the comments and testing has found this to work well. This code is now ready to merge. Congratulations on your first contribution to OED.
Description
Currently, readings are not validated upon upload. This PR enables an admin to define default test values, which are then executed when readings are uploaded. The admin panel, meter modal (create/edit), meter object and database have been modified to accommodate these values. The conditionSet object was previously undefined, but can now be determined using these values and enable readings to be validated.
@TrongQuocLe @codehomie1
Fixes #511
Type of change
Checklist
Limitations
Written test cases need to be created.