feat: add bulk delete all measurements for a device#858
Open
JerryVincent wants to merge 3 commits intodevfrom
Open
feat: add bulk delete all measurements for a device#858JerryVincent wants to merge 3 commits intodevfrom
JerryVincent wants to merge 3 commits intodevfrom
Conversation
Previously, clearing a device's measurement history required deleting each sensor's data individually. Users can now delete all measurements across all sensors at once from the device settings sidebar, with password confirmation and feedback for both success and empty states.
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Implementation
Added a new Delete Measurements page under the device settings sidebar (/device/:deviceId/edit/delete-measurements). On the backend, deleteMeasurementsForDevice was added to measurement.server.ts — it uses a Drizzle subquery to fetch all sensor IDs belonging to the device and deletes their measurements in a single database operation. The route action follows the same auth pattern as the device deletion page: session-based ownership check plus password re-verification via verifyLogin before any data is touched. The action returns the deleted row count so the UI can distinguish between a successful deletion and a no-op (device had no measurements), showing a green success banner or a yellow warning respectively. EN and DE translations are included.
Checklist
devbranchAdditional Information