Skip to content

Gate training-only ticket callouts to facilitator trainings#1945

Merged
maebeale merged 1 commit into
mainfrom
maebeale/opt-out-ticket-callouts
Jul 7, 2026
Merged

Gate training-only ticket callouts to facilitator trainings#1945
maebeale merged 1 commit into
mainfrom
maebeale/opt-out-ticket-callouts

Conversation

@maebeale

@maebeale maebeale commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 small, contained visibility guards on built-in ticket callouts + spec updates

What is the goal of this PR and why is this important?

  • The built-in Handouts, FAQ, and Forms ticket callouts rendered on every registration ticket, but their content is 2-Day AWBW Facilitator Training–specific (training worksheets, "2-day training" FAQ).
  • Public, non-training events — including live ones with no registration process — were surfacing these irrelevant training callouts to registrants. This is the urgent fix.

How did you approach the change?

  • Added Event#show_handouts_callout? / #show_faq_callout? (→ facilitator_training?) and #show_forms_callout? (→ facilitator_training? or paid, since paying registrants still need their invoice/receipt).
  • MagicTicketCallouts now returns those cards only when the predicate holds; the callout pages (forms/handouts/faq) redirect to the ticket when hidden.
  • No migrationfacilitator_training already partitions live data correctly, so this corrects every live event on deploy.
  • Layer 1 of 2: a follow-up PR adds per-event Auto/Show/Hide overrides in the event's callouts section.

Anything else to add?

  • Editor preview visibility labels updated ("On facilitator trainings", "On facilitator trainings and paid events").
  • The callout content is still hardcoded to the 2-day training even for trainings — out of scope here, worth revisiting.

The built-in Handouts, FAQ, and Forms callouts always rendered on every
registration ticket, but their content is written for the 2-Day AWBW
Facilitator Training (training worksheets, "2-day training" FAQ). Public,
non-training events — including live ones with no registration process —
were showing these irrelevant training callouts to registrants.

Gate them on facilitator_training? (Handouts, FAQ) plus any paid event
(Forms, whose registrants still need their invoice/receipt), and redirect
the corresponding callout pages when hidden. This corrects every live event
with no migration, since facilitator_training already partitions the data.

A follow-up PR adds per-event overrides so admins can force each callout
on or off from the event's callouts section.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 7, 2026 18:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread app/models/event.rb
facilitator_training?
end

def show_forms_callout?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: Forms is gated on facilitator_training? || paid rather than training-only: the Forms page carries the invoice and paid-in-full receipt, which any paying registrant needs. Handouts/FAQ are pure training curriculum, so those stay training-only.

# FAQ for the training, with a folded-in contact link. Only reachable when
# the event shows the FAQ callout.
def faq
redirect_to registration_ticket_path(@event_registration.slug) unless @event.show_faq_callout?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 From Claude: These pages are reachable by slug (no auth), so hiding the card is not enough — a shared/stale link would still surface training content on a non-training event. The redirect mirrors how certificate/scholarship guard their unavailable states.

@maebeale maebeale marked this pull request as ready for review July 7, 2026 18:50
@maebeale maebeale requested a review from jmilljr24 July 7, 2026 18:52
@maebeale

maebeale commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator Author

@jmilljr24 this keeps the hard-coded cards hard-coded. there's a world we might want to consider where these become populated data at time of event creation or opt-in to the event, but, this gets them turned off for rn while we talk through options.

@maebeale maebeale merged commit 0d25f40 into main Jul 7, 2026
3 checks passed
@maebeale maebeale deleted the maebeale/opt-out-ticket-callouts branch July 7, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants