JM: Surface onboarding day-attendance checkmarks on the registration edit form#1932
Draft
maebeale wants to merge 4 commits into
Draft
JM: Surface onboarding day-attendance checkmarks on the registration edit form#1932maebeale wants to merge 4 commits into
maebeale wants to merge 4 commits into
Conversation
maebeale
commented
Jul 4, 2026
| // Recompute the status from how many day checkboxes are checked, then reflect it | ||
| // in the dropdown (which re-renders the icon and the unsaved hint via update()). | ||
| deriveFromDays() { | ||
| if (!this.activeStatusesValue.includes(this.selectTarget.value)) return |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: Guards the days→status derivation to active statuses so a deliberate cancelled/no_show/transferred_out isn't silently rolled back by toggling a day — mirrors the server-side sync_attendance_status_to_days!.
Contributor
There was a problem hiding this comment.
Pull request overview
Surfaces per-day attendance checkmarks (Day 1…N) on the single EventRegistration edit form, reusing the same day-count semantics as the Onboarding matrix and keeping the attendance status dropdown in sync via the existing attendance-status Stimulus controller.
Changes:
- Add per-day attendance checkbox UI to
event_registrations/_form, saving via already-permittedDAY_FIELDS. - Extend
attendance-statusStimulus controller to derive an active attendance status (registered→incomplete_attendance→attended) from checked days, while leaving inactive/manual statuses untouched. - Add system specs covering rendering, persistence, status derivation, and the inactive-status guard.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| spec/system/event_registration_edit_spec.rb | Adds system coverage for day checkbox rendering/persistence and status-derivation behavior. |
| app/views/event_registrations/_form.html.erb | Renders per-day attendance checkboxes and wires them into the Stimulus controller with day count + active statuses. |
| app/frontend/javascript/controllers/attendance_status_controller.js | Adds day targets/values and deriveFromDays() to keep the status dropdown consistent with day checkboxes. |
32beabd to
fd6d743
Compare
9ab1d7d to
2bd2f52
Compare
… form The per-day attendance checkboxes only lived on the Onboarding matrix, so an admin editing a single registration couldn't mark days without leaving the page. Surface the same checkmarks beside the status dropdown, and mirror onboarding's behavior so toggling a day rolls the attendance status forward/back (client-side, respecting deliberate inactive states). DAY_FIELDS were already permitted params, so the boxes save with the form. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Group them inline with the "View ticket" / "View submission" links instead of under the status dropdown. The attendance-status controller now spans the whole card so the checkmarks still drive the status select. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Push it to the right edge of the meta strip and stack the label over the day chips, per the requested layout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The derivation spec reloaded the record immediately after clicking Save, racing the submit round-trip and occasionally reading the pre-save status. Assert the redirect landed first, matching the sibling persistence spec. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2bd2f52 to
67e272f
Compare
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.
🤖 suggested review level: 3 Read 📖 small view + Stimulus change; day fields already permitted, status derivation mirrors existing model logic
What is the goal of this PR and why is this important?
How did you approach the change?
event_registrations/_form.html.erb.DAY_FIELDSwere already permitted params, so they save with the form.attendance-statusStimulus controller: toggling a day derives the status the same way onboarding does (registered → incomplete_attendance → attended), and never overrides a deliberate inactive state (cancelled/no_show/transferred_out) — mirrorsEventRegistration#sync_attendance_status_to_days!.Anything else to add?
edit?→manage?), matching the admin-only day-field params.