Repository navigation
Build the statistics editor (W7-05) - #175
Open
matthewchung5377 wants to merge 1 commit into
Open
matthewchung5377 wants to merge 1 commit into
matthewchung5377 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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