flexmeasures icon indicating copy to clipboard operation
flexmeasures copied to clipboard

Add unit field for sensor data upload form

Open joshuaunity opened this issue 1 month ago • 4 comments

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 Screenshot from 2025-11-26 22-05-43

After Screenshot from 2025-11-26 22-06-12

How to test

  1. Visit a sensor page. (any sensor is fine)
  2. Navigate to the bottom left to find the form to upload data to the sensor
  3. confirm that the unit field is visible
  4. try uploading some data with while selecting a unit which cannot be converted to the main sensor unit.
  5. 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

joshuaunity avatar Nov 26 '25 21:11 joshuaunity

Documentation build overview

📚 flexmeasures | 🛠️ Build #30793351 | 📁 Comparing 7591a407c0f3b1a55f9bb0497fa8cf2043d99ca4 against latest (75e05d40de5f87930caaf0e8cda99907bbdc8691)


🔍 Preview build

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

joshuaunity avatar Dec 08 '25 19:12 joshuaunity

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.

joshuaunity avatar Dec 08 '25 19:12 joshuaunity

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.

nhoening avatar Dec 08 '25 21:12 nhoening