Repository navigation
Save all of a room edit or none of it - #186
Merged
Merged
Conversation
When the new seats fail validation, roll back so the new name and start time aren't saved either, and keep the form up with what was entered so the seats can be fixed. Say when an edit was saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🚀 Staging Preview Deployed! URL: https://preview-seating-pr-186-137456085712.us-west1.run.app |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #186 +/- ##
==========================================
+ Coverage 92.97% 93.12% +0.15%
==========================================
Files 36 36
Lines 2774 2807 +33
==========================================
+ Hits 2579 2614 +35
+ Misses 195 193 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Deleting, importing offerings and students, assigning and emailing already said when they worked; creating, editing and toggling exams and importing rooms didn't. Toggling says nothing when the exam stays as it was (deactivating the only active exam leaves it active). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A room edit whose new start time clashes with another room now keeps the form up with what was entered, as a seat error does, instead of going back to the exam page and losing the edit. - Showing the form again loads the room first, and goes back to the exam page if it can't (deleted meanwhile, or the database is down); the rollback after a seat error no longer raises if it fails. - Importing rooms from the master sheet says how many were imported in one message, rather than one per room: flashes are kept in the session cookie, which is small. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A save that broke a constraint rolled back unguarded, and so did the rollback after looking for the clash failed: if the database went down then, the rollback's error escaped and staff got an error page instead of a message. Both now go through one helper that rolls back and says whether it could, as do the room form's error paths; when even the rollback fails, the clash isn't looked for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #184
Editing a room set its new name and start time on the room, then updated the seats. If the seats failed validation, the error was flashed but the commit still went ahead, so the new name and time were saved while the page said the edit failed.
The edit form only makes movable seats with whole-number counts, so its seats can't fail validation today. This keeps a failed seat edit from saving the name and time if that changes (e.g. editing fixed seats).
Now:
Success messages
Deleting, importing offerings and students, assigning and emailing already said when they worked; creating, editing and toggling exams, and importing or editing rooms, didn't. They now do:
Tests
🤖 Generated with Claude Code