Amaresh: Wire event participation page to real event data - #5453
Amaresh: Wire event participation page to real event data#5453amaresh2001 wants to merge 3 commits into
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
RuthwikHM
left a comment
There was a problem hiding this comment.
Tested this out locally along with the backend PR. I do not see any events loading. The call to the events API fails with a 404.
|
Thanks for testing, @RuthwikHM! I checked the route directly against the current branch; it responds successfully (200 on first load, 304 on cache revalidation), not a 404, and the page loads real data correctly on my end (192 events, working charts and tooltip). Nothing's changed in the backend PR since you tested it, so this looks like a local setup issue rather than a bug; maybe the backend was running a stale build. Could you pull latest, restart the backend with npm run dev, and re-test? Let me know if it's still failing.
|
RuthwikHM
left a comment
There was a problem hiding this comment.
@amaresh2001 , yup it was a stale backend build by the looks of it. Got it working now. Mostly everything works as intended. Just a small bug to address.
In dark mode it seems like the widgets for drop off rate and no show rate do not indicate the loss or gain via color. The text color seems to just be white. Light mode works fine though. Events are also being used from the backend API as expected.


|
@RuthwikHM Thanks for catching that! Fixed and pushed; the +/-% values weren't wired to a real color class, so dark mode's global text override was washing them out to white. Now shows correctly in both themes. |
|
DeMoliT1on
left a comment
There was a problem hiding this comment.
Hi @amaresh2001,
Tested locally for frontend PR changes branch amaresh/fix-event-participation-static-metrics-and-nav-links with related backend PR branch amaresh/wire-event-participation-real-events-api and observed the following things.
Issue 1 - Uneven Page Edge Spacing Between Light and Dark Modes
Observed:
- The outer container margins/padding on the left and right edges differ between light mode and dark mode, creating inconsistent layout alignment across themes.
Expected Behavior
- Container margin and padding should be consistent across both light and dark modes.
Screenshots
Issue 2 - Main Metric Card Attached Directly to Navigation Bar
Observed:
- The main
Event Participation Analyticsheader banner lacks top padding/margin and is directly flush against the main navigation bar.
Expected Behavior
- Adequate top margin/padding should exist between the navbar and the main header card to match standard page spacing across the app.
Screenshots
Issue 3 - Event Category Badge Text Low Contrast / Invisible in Dark Mode
Observed:
- In the "Upcoming Events" card, the event category badge text ("Workshop") turns white in dark mode against the light green badge background, making it unreadable.
Expected Behavior
- Badge text and background colors should adjust dynamically in dark mode to maintain accessible contrast and legibility.
Screenshots
Issue 4 - Back to Participation button still reloads the whole page
Observed:
- After opening any of the "Detailed Analytics" link pages, when the
Back to Participationbutton is clicked it reloads the whole page.
Expected Behavior
- The button should also use React Router to navigate and avoid the reload.
Overall Assessment
Verified Working
- Successfully restored real API data across summary metric cards, pie chart, bar chart, and upcoming events list.
- Recharts implementation loads event data with interactive tooltips working properly on hover.
Requesting Changes
Please resolve the following layout and dark mode contrast issues before approval:
- Adjust page edge spacing/padding to ensure light and dark mode layouts match.
- Add top spacing/margin to separate the main header metric card from the top navbar.
- Update dark mode CSS styles for the event category tag/badge in the Upcoming Events card so text remains readable.
- Update the navigation logic for
Back to Participationbutton to prevent unnecessary reloads.




Description
Restores real data to the Event Participation Analytics page (
/communityportal/reports/participation) and fixes several dark-mode bugs. This work grew out of reviewing PR #5029. While auditing it, I founddevelopmentalready has an independently built, more complete version of this same page, so this PR fixes and completes that existing version instead of merging #5029's older implementation.Related PRS (if any):
Supersedes #5029; that PR duplicates this exact feature with an older, less complete implementation (no chart tooltips, hardcoded fake data, unfixed dark-mode bugs).
This frontend PR is related to the backend PR #2311 (
amaresh/wire-event-participation-real-events-apirestores a real Events API that was silently dropped fromroutes.jsin an unrelated merge).Main changes explained:
EventParticipation.jsxfor fetching real events once via the (now-restored) events API and passing them down to the header, event list, and both charts, instead of each component using its own hardcoded/mock data.EventParticipationHeader.jsxfor computing summary metrics (Total Events, Avg Attendance, Top Event Type, Total Participants) from real data instead of hardcoded numbers, and switching internal nav links from<a href>to React Router<Link>(the old links caused full-page reloads).AnalyticsNavigation.jsxfor the same<a href>to<Link>fix on the "Detailed Analytics" cards.MyCases.jsxfor rendering real events in the "Upcoming Events" list instead of mock data.EventTypePieChart.jsxandEngagementBarChart.jsxfor rewriting both withrecharts, wired to real event data, with working hover tooltips (the pie chart previously had none at all) and an explicit dark-mode-aware tooltip style (fixes the "tooltip invisible in dark mode" bug reported on #5029).Participation.module.cssfor adding targeted dark-mode color overrides on the no-show/drop-off rate table and insights percentages, since a globalbody.dark-mode * { color: #fff !important }rule elsewhere in the app was silently overriding correctly-coded green/red semantic colors.How to test:
amaresh/wire-event-participation-real-events-api).npm installand run both locally.localhost:5173/communityportal/reports/participation.Screenshots or videos of changes:
Note: