Skip to content

Migrate the admin dashboard and reports to Tailwind #2284

Open

Description

@trillium

Trillium Firstmate 🤖

Overview

Convert the admin statistics page: tabs, charts' containers, the loading placeholder, and the reports tab.

Dependencies

Action Items

  • Migrate these files to the shared components from client/src/components/ui/ and Tailwind classes. Keep the same text, props, routes and behavior:
    • client/src/components/admin/dashboard/index.jsx (475 lines; Box, Typography) and index.scss
    • client/src/components/admin/donutChartContainer.jsx and donutChartLoading.jsx (Box, Typography, Container, CircularProgress)
    • client/src/components/admin/donutChart.jsx (d3 drawing code; only touch the class names if SCSS is removed)
    • client/src/components/admin/eventOverview.jsx (raw <button>)
    • client/src/components/admin/reports/index.jsx and index.scss (keep react-datepicker here; see the optional ticket)
    • client/src/common/tabs/index.jsx, tab.jsx, index.scss
  • Keep sass/Dashboard.scss (369 lines): the leader dashboard still imports it. Remove only the rules these files used; Migrate the project leader dashboard to Tailwind #2285 deletes the file.
  • Keep common/datepicker/index.scss; it styles react-datepicker.
  • Take before/after screenshots (desktop about 1280 px, phone 390 px) of each state listed in the Acceptance Criteria.
  • Add Vitest checks: the tabs switch with click and arrow keys and show the right panel; the loading placeholder shows while data loads (mock the fetch); the chart containers render a title and the chart element; the reports page renders its filters.
  • Delete the .scss files or rules that become unused, and remove their imports.

Acceptance Criteria

  • None of the files listed above imports from @mui/* or @emotion/*, and none still contains sx= or styled(.
  • The screen looks the same as before (pixel parity). The PR shows before/after screenshots at desktop width (about 1280 px) and phone width (390 px), including each state named in the Action Items (empty, loading, error, open dialog, and so on). The PR template has sections for these.
  • New Vitest checks are included (see Action Items) and yarn test passes.
  • yarn typecheck and yarn build pass in client/.
  • Any .scss file (or part of one) that this change makes unused is deleted, and nothing outside the listed files is left depending on it.
  • Keyboard-only pass done and noted in the PR: Tab order is sensible, every control can be used without a mouse, and dialogs/menus close with Escape.
  • The behavior is unchanged: same requests, same validation messages, same routes and redirects.
  • States in the screenshots: each tab, loading placeholder, loaded charts.

Resources/Instructions

Additional Notes

  • Charts are drawn with d3 and measure their container; check them at both widths for size changes.
  • Decided for the whole epic: every screen keeps pixel parity with today. This is a change of tooling, not a redesign. Fonts, colors, spacing, sizes, and breakpoints must look the same after the change.
  • The temporary Tailwind important flag is on while MUI is still in the app (decided). That is what lets a Tailwind class beat MUI/emotion and the old global SCSS. It is removed in Final cleanup: remove the Tailwind 'important' flag and the old global SCSS #2288.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: Design systemmilestone: missingp-feature: Dashboardrole: Front Endsize: 5pt

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions