HOLD: Uniform public form lanes: /events/:id/forms/:role with standalone scholarship/CE/general#1599
HOLD: Uniform public form lanes: /events/:id/forms/:role with standalone scholarship/CE/general#1599maebeale wants to merge 11 commits into
Conversation
|
|
||
| def form_variant | ||
| VARIANTS.include?(params[:form_variant]) ? params[:form_variant] : "registration" | ||
| end |
There was a problem hiding this comment.
🤖 From Claude: form_variant is whitelisted against VARIANTS and falls back to "registration", so an unknown variant in the URL degrades to the default flow rather than blowing up the path helpers below.
| params[:scholarship_requested] != "false" | ||
| else | ||
| params[:scholarship_requested] == "true" | ||
| end |
There was a problem hiding this comment.
🤖 From Claude: Scholarship default differs by variant: the scholarship_form flow opts in unless scholarship_requested=false, while other flows opt in only when explicitly =true. This preserves the existing query-param behavior for the registration flow.
| @@ -130,7 +130,15 @@ | |||
| post :send_reminder | |||
| end | |||
| resource :registrations, only: %i[ create destroy ], module: :events, as: :registrant_registration | |||
There was a problem hiding this comment.
🤖 From Claude: The registrant_registration resource stays separate from the three new public *_form resources — the routing spec asserts POST /events/:id/registrations still hits events/registrations#create and does not collide.
77281d5 to
8690d67
Compare
| end | ||
| resource :registrations, only: %i[ create destroy ], module: :events, as: :registrant_registration | ||
| resource :public_registration, only: [ :new, :create, :show ], module: :events | ||
| resource :bulk_payment, only: [ :new, :create, :show ], module: :events |
There was a problem hiding this comment.
🤖 From Claude: Kept main's dedicated bulk_payment resource (→ Events::BulkPaymentsController, the real multi-attendee flow) alongside the role loop. The loop also generates a bulk_payment_form lane through public_forms, but that's a registration-form-backed placeholder at a different path — the two coexist and the admin menu surfaces the real one.
8ed614d to
9217f36
Compare
The single public_registration resource conflated three distinct public-facing flows (registration, scholarship application, bulk payment). Splitting it into registration_form/scholarship_form/ bulk_payment_form resources that share one PublicFormsController lets each flow have its own URL while a form_variant default drives the heading, paths, and scholarship behavior — making the variant explicit in the URL instead of inferred from query params alone. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add bulk_payment and ce_credit as event-form roles and drive the public form endpoints, controller variant whitelist, and Event#*_form accessors off EventForm::ROLES so the role list lives in exactly one place. Routes and per-role scopes/accessors are now generated from ROLES, and the controller's "form_variant" concept is renamed to "form_role" to match the model's vocabulary. No behavior change to the existing registration and scholarship flows. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ce_credit is now a first-class EventForm role, so surface its preview link alongside the other lanes and cover its heading/endpoint in the system spec for parity with the registration/scholarship/bulk_payment lanes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The rebase onto main resolved a modify/delete on the old public registration system spec; port main's scholarship-form-header test into the public_forms spec so that coverage isn't lost. Rename the public registration request spec to match the renamed Events::PublicForms controller. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… lanes Collapse the per-role *_form resources into one uniform route set — /events/:id/forms/:form_role/new — served by Events::PublicFormsController, so every public form lane shares the same simplest URL. Bulk payment lives under the same forms/ path but keeps its own BulkPaymentsController. A LANES config drives each lane's presentation + behavior: - registration: registration form - scholarship: registration + scholarship combined (the primary scholarship link) - scholarship_questions / ce_questions: standalone questions that attach to the person's existing registration (via ?reg=slug or their active registration), setting scholarship_requested / ce_credit_requested - general: standalone form recorded as a FormSubmission This gives scholarship (and CE) forms a direct entry point instead of only riding on a registration, and adds a general public form lane. EventForm::ROLES gains "general"; route helpers move to new_event_form_path(event, role). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add request specs verifying the addon lane attaches answers to an existing registration, sets scholarship_requested without creating a new registration, redirects to the ticket, requires a registration to attach to, and re-renders on validation errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The registration submission view was reachable through an events route (/events/:id/forms/registration?reg=SLUG). Since the registration slug is globally unique and already identifies its event, expose the view as a clean top-level /submission/:slug route, parallel to the existing /registration/:slug ticket. Drops the event-nested public_forms#show route and the person_id fallback (every registration gets a slug on create); admin "view submission" links now use submission_path(slug). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Only registration links were shared before the public-form routes moved, so keep those old URLs working with redirects: - /events/:id/public_registration?reg=SLUG -> /submission/SLUG - /events/:id/public_registration/new -> /events/:id/forms/registration/new (query preserved) - /events/:id/public_registration (no slug) -> the registration form A POST shim keeps any stale registration form able to submit. Scholarship and bulk-payment legacy routes aren't needed (no such links went out). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A test added on main (#1641) exercised the public form via the old new_event_public_registration_path helper; update it to the new new_event_form_path(event, "registration") after the rebase. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CI scan_ruby failed on newly-published advisories CVE-2026-47240/47241/ 47242 (Net::IMAP command injection / DoS) in net-imap 0.6.4. Conservative bump to the patched 0.6.4.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The #1621 stripe-link tests came in via rebase still using the removed multiple_choice_radio enum value, the old event_public_registration_path helper, and the pre-move /bulk_payment location. Update them to single_select_radio, event_form_path(event, "registration"), and the /forms/bulk_payment path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8f7fd93 to
35165b7
Compare
What is the goal of this PR and why is this important?
/events/:id/forms/<role>/new. The lane is visible in the path, so each entry point is unambiguous (clean analytics) and links are easy to share.URL scheme
registration/events/:id/forms/registration/newscholarship/events/:id/forms/scholarship/newscholarship_questions/events/:id/forms/scholarship_questions/new?reg=SLUGscholarship_requestedce_questions/events/:id/forms/ce_questions/new?reg=SLUGce_credit_requestedgeneral/events/:id/forms/general/newFormSubmissionbulk_payment/events/:id/forms/bulk_payment/newBulkPaymentsController(uniform URL, own controller)How
forms/:form_rolenew/create/show) →Events::PublicFormsController. ALANESconfig maps each lane to its form(s), heading, and behavior mode (:register/:addon/:submission).:addonlanes (scholarship_questions, ce_questions) resolve the existing registration by slug (?reg=) or the signed-in person's active registration; no registration → redirect with a "register first" notice.forms/bulk_paymentpath but still routes to its own shipped controller — no change to that flow.EventForm::ROLESgainsgeneral; route helpers are nownew_event_form_path(event, role)/event_form_path(event, role); all call sites + the admin Form-actions menu updated.Verification
ai/lintclean. Green: public_forms routing/system/request, bulk_payments, events, event_registrations, scholarships, event/event_form models, page_bg view spec, events_show.🤖 Generated with Claude Code