Theme event dashboard cards and count only allocated scholarships#1578
Conversation
| # above the full-price total_cents. | ||
| def grand_total_cents | ||
| registration_subtotal_cents + scholarship_total_cents + cont_ed_total_cents | ||
| registration_subtotal_cents + completed_scholarship_cents + cont_ed_total_cents |
There was a problem hiding this comment.
🤖 From Claude: Grand total counts completed scholarships only. Incomplete ones aren't applied to allocations, so their share is already captured as outstanding registration fees — including scholarship_total_cents here would double-count and push the total above total_cents.
There was a problem hiding this comment.
Pull request overview
Adjusts the event dashboard’s money equation so the grand total reflects only scholarship dollars that are actually applied (completed), while centralizing dashboard card theming through DomainTheme to prevent palette drift.
Changes:
- Update
EventDashboard#grand_total_centsto sum completed scholarship dollars (avoids double-counting pending scholarship awards). - Refactor event dashboard card styling to use
DomainTheme(borders/backgrounds/text) and align headcount icon sizing. - Expand
EventDashboardspecs to cover completed-only grand total while still reporting the full scholarship award total.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/services/event_dashboard_spec.rb | Updates expectations to use completed_scholarship_cents for grand total and adds coverage for the “full awarded vs completed” split. |
| lib/domain_theme.rb | Adds theme keys used by the event dashboard cards so colors come from the shared palette. |
| app/views/events/dashboard.html.erb | Switches hardcoded Tailwind color classes to DomainTheme helpers; updates scholarship display to show total awarded plus completed (“issued”) amount. |
| app/services/event_dashboard.rb | Changes grand total computation to include only completed scholarships; adds completed/outstanding scholarship helper methods. |
| app/frontend/stylesheets/application.tailwind.css | Expands Tailwind inline source patterns to include hover: variants for dynamically generated border/text theme classes. |
| <span class="text-2xl sm:text-3xl font-bold <%= DomainTheme.text_class_for(:scholarships, intensity: 700) %> tabular-nums"><%= number_to_currency(@dashboard.scholarship_total_cents / 100.0) %></span> | ||
| <span class="text-xs text-gray-500">potentially issued</span> | ||
| </p> |
| <p class="text-xs text-gray-500 mt-0.5"> | ||
| <span class="font-semibold <%= DomainTheme.text_class_for(:scholarships, intensity: 700) %> tabular-nums"><%= number_to_currency(@dashboard.completed_scholarship_cents / 100.0) %></span> issued | ||
| </p> |
There was a problem hiding this comment.
🤖 From Claude: Done — the label now reads "awarded" (sentence case) instead of "issued". The card shows the full "$X potentially awarded" with the allocated "$X awarded" portion below.
| it "still reports the full scholarship amount issued, including incomplete" do | ||
| expect(dashboard.scholarship_total_cents).to eq(20_000) |
Wire every dashboard money/headcount card color through DomainTheme instead
of hard-coded Tailwind utilities, so the dashboard stays in step with the
app-wide palette. Adds the missing keys (payments, scholarships,
continuing_education, event_dashboard, addresses) and extends the Tailwind
safelist with the hover border/text variants the helpers now generate.
Clarify the scholarship card: the headline is the full amount "potentially
awarded", with the allocated portion ("awarded", tasks complete) surfaced
separately since only that flows into the grand total. Registration fees and
cont ed headlines gain an "including due" caveat so the figures aren't read as
cash-collected.
Grand total counts allocated_scholarship_cents (renamed from
completed_scholarship_cents) rather than #1580's raw applied-allocation sum:
the awarded amount of allocated scholarships is the meaningful figure and
matches the "Completed & allocated" amount the dashboard shows, keeping the
equation internally consistent.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8403d72 to
508bb33
Compare
- Collapse each money card (Registration fees / Scholarships / Continuing
education fees) into a chevron-expandable details: it shows just the total
by default and expands to Paid/Due (or Completed & allocated / Incomplete &
unallocated) sub-rows, which in turn expand to per-registrant lists with
per-person amounts.
- Add a Collected / Due / Monies cash summary beside the grand total
(collected + due = monies; scholarships are excluded since they're awarded,
not collected).
- Clarify scholarship copy ("including unallocated"; "Completed & allocated" /
"Incomplete & unallocated") and rename "Cont ed fees" to "Continuing
education fees".
- Registrant names now jump to the manage list filtered to that one person,
with a name + organization tooltip, instead of the profile page.
- "<n> inactive" links to the matching manage list with a jump icon.
- Wrap the addend cards on smaller screens.
Backed by EventDashboard methods (collected/due/monies_made_cents,
inactive_registrant_ids, organization_names_by_registrant, and the per-recipient
/ per-registrant breakdown maps) with specs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- New db/seeds/dev/scholarships.rb seeds scholarships across the paid dev events, mixing completed (allocation funded) and pending ($0 allocation) so the dashboard shows allocated vs unallocated scholarship dollars. Only funds registrations with no allocations yet, so a full or partial award fits within the event cost (the allocation validation rejects over-allocation). - Wire db:seed:scholarships into dev.rake (run order after payments, plus a standalone task). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make AWBW Facilitator Training a $1,500 event with a 15-registrant cohort so the scholarship seeds have room to award 10 full/partial scholarships across allocation-free registrations. Keep cost in sync on re-seed (find_or_create_by! only sets it on create), and top up generated cohort registrants idempotently. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The dashboard now labels the card "Continuing education fees" (was "Cont ed fees"); update the request-spec assertion to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What is the goal of this PR and why is this important?
How did you approach the change?
allocated_scholarship_cents), so it reconciles tototal_cents(the full-price value of active registrations). This uses the awarded amount of scholarships whose tasks are complete, matching the "Completed & allocated" figure shown on the card — superseding the raw applied-allocation sum from Exclude unapplied scholarships from the event grand total #1580 with the more meaningful figure.DomainTheme(addedpayments,scholarships,continuing_education,event_dashboard,addressesmappings) so the palette lives in one place; extended the Tailwind safelist with the hover border/text variants the helpers generate.text-xsto match the money-card header icons.EventDashboardspecs to cover the allocated-only grand total and the still-full "potentially awarded" amount.UI Testing Checklist
Anything else to add?
Rebased onto
mainafter #1580 (which fixed the same grand-total bug); this branch keeps that fix but switches it toallocated_scholarship_centsand layers the theming + label clarifications on top.