Skip to content

Hide the scholarship card on free-event registrations#1974

Merged
maebeale merged 5 commits into
mainfrom
maebeale/hide-scholarship-box-when-not-offered
Jul 14, 2026
Merged

Hide the scholarship card on free-event registrations#1974
maebeale merged 5 commits into
mainfrom
maebeale/hide-scholarship-box-when-not-offered

Conversation

@maebeale

@maebeale maebeale commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

🤖 PR, suggested 👤 review level: 📖 Read — small, contained view/logic change gated by a new predicate

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

  • On the registration edit form, the Scholarship card rendered for every event, even free ones — where a scholarship (which offsets a fee) has nothing to do.
  • The neighboring CE credits card already hides itself when the event grants no CE hours (event.ce_eligible?); scholarship had no equivalent gate.

How did you approach the change?

  • Added Event#scholarship_eligible?, mirroring the existing #ce_eligible? predicate: true when the event has a cost (a scholarship offsets a fee) or offers a scholarship form (it invites applications even when free).
  • Gated the Scholarship card on it, plus the registration's own scholarships — so an award made before the event became free/formless stays visible instead of vanishing.
  • The Organizations card absorbs whatever columns the hidden cards leave behind (sm:col-span-1/2/3), so the row never has a gap:
    • paid + CE hours → Orgs (1) · Scholarship · CE
    • paid, no CE hours → Orgs (2) · Scholarship
    • free + CE hours → Orgs (2) · CE
    • free, no CE hours, no form → Orgs (3, full width)

UI Testing Checklist

  • Paid event: Scholarship card shows
  • Free event with no scholarship form: Scholarship card hidden, Organizations widens
  • Free event that offers a scholarship form: card still shows
  • Free event that already has an awarded scholarship: card still shows
  • Row never leaves an empty column in any paid/free × CE combination

Anything else to add?

🤖 Generated with Claude Code

A scholarship offsets a registration fee, so the card has nothing to do on a
free event — but the registration form rendered it unconditionally, next to the
CE card (which already hides itself when the event grants no CE hours).

Add Event#scholarship_eligible? (true when the event has a cost), mirroring the
existing #ce_eligible? predicate, and gate the scholarship card on it. The
Organizations card now absorbs whatever columns the hidden scholarship/CE cards
leave behind, so the row never has a gap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 10:40

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
# A scholarship offsets a registration fee, so it only applies to paid events —
# a free event has nothing to subsidize. Mirrors #ce_eligible? as a named
# "does this apply" predicate, derived from the cost rather than a stored flag.
def scholarship_eligible?

@maebeale maebeale Jul 14, 2026

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: Final definition: eligible when the event has a cost or offers a scholarship form (there's no scholarship_form_id column — the form links through event_forms by role). The view additionally keeps the card when this registration already has an award, so an award that predates the event going free/formless isn't hidden.

@maebeale
maebeale marked this pull request as ready for review July 14, 2026 14:20
maebeale and others added 2 commits July 14, 2026 10:28
Gate on the registration's own scholarships too, so a scholarship awarded
before the event was made free stays visible instead of being hidden.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 14:29

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.

An event can invite scholarship applications even when free, so key
eligibility off a cost or an attached scholarship form.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 14:33

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.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 15:11

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.

@maebeale
maebeale merged commit 8db4ca8 into main Jul 14, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/hide-scholarship-box-when-not-offered branch July 14, 2026 15:25
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.

2 participants