Skip to content

Build the statistics editor (W7-05) - #175

Open
matthewchung5377 wants to merge 1 commit into
mainfrom
158/statistics-editor
Open

matthewchung5377 wants to merge 1 commit into
mainfrom
158/statistics-editor

Conversation

@matthewchung5377

Copy link
Copy Markdown
Contributor

Motivation
The impact numbers on the Home page (#99) are coordinator-managed statistics (TDD 4.6.8). The API is done (#71), but /portal/admin/statistics is a placeholder.

Changes:

  • frontend/src/components/admin/StatisticsManager.tsx, used by frontend/src/app/portal/admin/statistics/page.tsx

  • A list showing each statistic's value and label (e.g. "120+" / "students trained"), with a published or draft badge

  • Create and edit in a dialog: label (200 characters max), value (50 characters max, free text so "120+" works), and published

  • Delete with a confirmation

  • Reorder with SortableList via PUT /api/admin/statistics/reorder

  • A preview of the published statistics in their current order, reusing ImpactStats

  • Tests:
    create and edit send the right body
    drafts don't appear in the preview
    reordering sends ids in the new order
    deleting asks first

Closes #158

@github-actions

Copy link
Copy Markdown

Backend Test Results

713 tests  ±0   713 ✅ ±0   25s ⏱️ +7s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 5222c7a. ± Comparison against base commit f435caa.

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.

Build the statistics editor (W7-05)

2 participants