Skip to content

Render the printable reports in the SPA instead of on the Rails server #12322

Open

Description

@nbudin

Drafted by Claude (Anthropic's AI model) at @nbudin's request.

Follow-up to #12219 (framework mode migration), found while planning #12260.

Why

The six printable reports (ReportsController: events by time, per event, per room, per user, a single user's printable, volunteer events; about 260 lines of ERB) are rendered by Rails, and they are the last server-rendered pages that depend on the frontend build:

  • The print_reports layout loads /packs/application-styles.js, which only the data-mode build produces. The Staged cutover and rollback plan #12260 cutover keeps them working by reading the stylesheet link from the framework shell's index.html, but that is a stopgap.
  • PrintableReportLink works around the OIDC sign-in giving Rails no cookie session: it fetches the report HTML with a bearer token, adds a <base href>, and opens the result as a blob: URL.

What

Render the reports as routes in the SPA, with a print-only layout (no navigation bar), opened in a new tab like any other route and authenticated like any other GraphQL request.

  • One component and query per report; the /reports/* Rails routes and views go away.
  • Check what GraphQL already exposes. Runs, rooms, signups_paginated and the grouped and waitlist counts exist; available_slots_by_bucket_id, a convention-wide per-user signup list and the bucket and waitlist wording (SignupCountPresenter) may not.
  • per_user covers every attendee with a ticket, so page the data in rather than loading it in one payload, and compare it against the Rails version on a large convention.
  • Times should format the same as the Rails helpers (format_run_time, format_run_day_and_time) in the convention's time zone.

Acceptance

  • All six reports are available from the reports menu and the user admin page, and print the same content and page breaks as before
  • PrintableReportLink's fetch, blob and <base> handling, ReportsController's print actions, app/views/reports and the print_reports layout are removed
  • Remove the pre-framework-mode shell code #12261 can then drop the application-styles entry

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions