Add unit field for sensor data upload form
Description
This PR introduces a new field to the form for uploading data to a sensor, followed by the expansion of the backend validation to cover this new field.
Look & Feel
Before
After
How to test
- Visit a sensor page. (any sensor is fine)
- Navigate to the bottom left to find the form to upload data to the sensor
- confirm that the unit field is visible
- try uploading some data with while selecting a unit which cannot be converted to the main sensor unit.
- Observe the error message toast that comes up talks about th eunit being not convertable
Further Improvements
None
Related Items
This PR closes #1781
Sign-off
- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures
To Do
- [x] Add unit field to "upload data" form
- [x] Add validation for new unit field
- [x] Data conversion integration
- [x] Fix bug with error messages tied to this form. (Toast messages are broken here)
- [x] New test case
- [x] Add changelog
Documentation build overview
📚 flexmeasures | 🛠️ Build #30793351 | 📁 Comparing 7591a407c0f3b1a55f9bb0497fa8cf2043d99ca4 against latest (75e05d40de5f87930caaf0e8cda99907bbdc8691)
Show files changed (7 files in total): 📝 7 modified | ➕ 0 added | ➖ 0 deleted
| File | Status |
|---|---|
| changelog.html | 📝 modified |
| genindex.html | 📝 modified |
| _autosummary/flexmeasures.api.v3_0.sensors.html | 📝 modified |
| _autosummary/flexmeasures.data.models.forecasting.pipelines.base.html | 📝 modified |
| _autosummary/flexmeasures.data.models.forecasting.pipelines.predict.html | 📝 modified |
| _autosummary/flexmeasures.data.schemas.sensors.html | 📝 modified |
| api/v3_0.html | 📝 modified |
@nhoening you can review this now, these new failing test are not from this PR casue they also fail on main
I also believe the dialogue is not looking very clean. It did not look clean before, and our new field is not helping, no matter how we style it.
If I understand you correctly, that means i should let the headings and content stack rather than be side by side.
I also believe the dialogue is not looking very clean. It did not look clean before, and our new field is not helping, no matter how we style it.
If I understand you correctly, that means i should let the headings and content stack rather than be side by side.
Yes, I believe that is the best way for now, without taking too much time.