As a user, I sometimes want to delete sensor data (for instance, to start over with my project).
As of now, I can only delete the sensor to get rid of data.
Add a new "Delete data" action item to the sensor page, below the "Forecast" button. It opens a small dialogue, similar to the other actions in the sidepanel:
- It should let the user choose all data (default, "All sources") or one specific data source (of the sources that are linked to this sensor's data).
- It should let the user choose a "from" and "until" time (with a datetime selection dialogue like in the forecast action)
- Clicking "Delete" asks for confirmation (like "Delete this sensor" does), then calls the
DELETE /api/v3_0/sensors/{id}/data endpoint and display a Toast "Data deletion in progress ...". On success or failure response, another Toast message is displayed.
- On success, evict a
dataDeleted event. The graph template should react to it and reload the graph.
Only display the action if the user can delete data (use {% if user_can_delete_sensor %}).
The API endpoint currently deletes all data.
- Expand it with extra parameters
source, from and until. These should be described in @use_kwargs with location json. All are optional - a missing source means all sources.
- add a test which uses each.
As a user, I sometimes want to delete sensor data (for instance, to start over with my project).
As of now, I can only delete the sensor to get rid of data.
Add a new "Delete data" action item to the sensor page, below the "Forecast" button. It opens a small dialogue, similar to the other actions in the sidepanel:
DELETE /api/v3_0/sensors/{id}/dataendpoint and display a Toast "Data deletion in progress ...". On success or failure response, another Toast message is displayed.dataDeletedevent. The graph template should react to it and reload the graph.Only display the action if the user can delete data (use
{% if user_can_delete_sensor %}).The API endpoint currently deletes all data.
source,fromanduntil. These should be described in@use_kwargswith locationjson. All are optional - a missing source means all sources.