Add admin activity management: delete, create, and category awards#239
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Admin delete activity: adds delete button with confirmation dialog to flagged activity detail view, with backend mutation that soft-deletes and reverses all points/streaks/category scores - Admin log activity: new page at /admin/log-activity for creating activities on behalf of participants, with user/type selectors and optional points override - Category leaders: show 4th and 5th place entries in admin preview with muted styling and no bonus points awarded (only top 3 receive awards) https://claude.ai/code/session_01FeKkPoze9PtGE659HyhKjA
72e4dcc to
cf8c5e7
Compare
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.
Summary
Adds three admin activity management features:
Admin Delete Activity — New
adminDeleteActivitymutation that soft-deletes activities and reverses all associated points, streaks, and category metrics. Added delete button with confirmation dialog to the flagged activity detail view.Admin Create Activity Page — New admin page at
/challenges/[id]/admin/log-activitywithadminLogActivityForUsermutation. Allows admins to manually log activities on behalf of participants with optional points override and notes.Category Leaders 4th/5th Place — Extended
previewWeeklyAwardsquery to return top 5 placements instead of top 3. Updated category leaders page to display 4th and 5th place with muted styling and zero bonus points.Changes
Backend mutations (
packages/backend/mutations/admin.ts):adminDeleteActivity: Soft-deletes activity, reverses points/streaks/category metrics, adds history entryadminLogActivityForUser: Creates activity for user with auto-calculated or overridden pointsBackend queries (
packages/backend/queries/categoryLeaderAwards.ts):previewWeeklyAwards: Returns top 5 placements (was top 3)Frontend pages:
/challenges/[id]/admin/log-activity/page.tsxwith form for creating activities/challenges/[id]/admin/layout.tsxto add "Log Activity" nav itemFrontend components (
apps/web/components/admin/flagged-activity-actions.tsx):adminDeleteActivitymutationAdmin category leaders (
apps/web/app/challenges/[id]/admin/category-leaders/page.tsx):Testing
Notes
activityFlagHistoryhttps://claude.ai/code/session_01FeKkPoze9PtGE659HyhKjA