Skip to content

Fix admin activities charts showing no data#1360

Open
maebeale wants to merge 4 commits intomainfrom
maebeale/fix-workshop-card-ui
Open

Fix admin activities charts showing no data#1360
maebeale wants to merge 4 commits intomainfrom
maebeale/fix-workshop-card-ui

Conversation

@maebeale
Copy link
Collaborator

@maebeale maebeale commented Mar 7, 2026

Summary

  • Fix 3 bugs causing "No data" in admin activity charts in production:
    • Param name mismatch: filter forms send categories/sectors/windows_types but tracker looked for category_ids/sector_ids/windows_type_ids
    • Windows type ID format: chart reader expected plain integer IDs but enrich_filter_names stores {id, name} hashes
    • Missing query key: zero-result search events lacked the top-level query property the "No Results" chart reads
  • Add chart_card helper so chart titles are always visible even when Chartkick shows "No data"
  • Add Ahoy visit/event seeds for dev environment chart data
  • Add integration and unit tests for chart data population and tracker param handling

Test plan

  • Run bundle exec rspec spec/requests/admin/ahoy_activities_spec.rb — chart title and data tests pass
  • Run bundle exec rspec spec/services/analytics/ahoy_tracker_spec.rb — tracker param fix tests pass
  • Visit admin activities charts page — all charts show titles, no blank cards
  • Use workshop index category/sector/windows type filters, then check charts page — filter data now appears
  • Search workshops with zero results, then check "No Results" chart — query appears

🤖 Generated with Claude Code

maebeale and others added 4 commits March 7, 2026 06:54
…zero-result query

Filter forms send params as `categories`, `sectors`, `windows_types` but the
tracker looked for `category_ids`, `sector_ids`, `windows_type_ids` — so filter
detail properties were never recorded. Also fix windows type chart reader to
handle hash objects from enrich_filter_names, and add top-level `query` key
to search_zero events so the "No Results" chart can read them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Chartkick hides the title when there's no data, replacing the entire chart
with "No data" text. Add a chart_card helper that renders an HTML heading
outside the canvas so admins always know which chart they're looking at.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Seed visits and events covering view, print, download, filter, search,
search_zero, browse.taggings, and create actions so all admin activity
charts have data in the dev environment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Integration tests verify chart titles render with no data and that seeded
event data populates all previously-empty charts. Unit tests validate the
extract_search_params fix handles both filter form and edit form param names,
and that search_zero events include the top-level query key.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant