[ADMIN-001] Add admin moderation dashboard - #87
Open
chev0004 wants to merge 4 commits into
Open
Conversation
10 tasks
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.
Outline
Summary
Adds the admin moderation dashboard: a report queue with reporter and reported-user context, moderation actions (dismiss, warn, hide profile, suspend, ban, plus reversals), a persistent audit log, and enforcement so hidden profiles leave public surfaces and suspended or banned users lose access to protected APIs.
Changes & Enhancements
suspended_untilandbanned_atto users,hidden_by_moderationto profiles.moderation_actionsaudit table andmoderation_actionenum.warningnotification kind.src/db/moderation.tswith report queue, audit log, and moderation state helpers.getActiveUserand use it in profile, bump, report, block, saved, settings, onboarding, and notifications APIs so restricted users get 401.POST /api/admin/moderationapplying actions to a report's target and logging every action./[lang]/adminroute, guarded by the existingPOLYCORD_ADMIN_USER_IDSallowlist, with the report queue, per-report action buttons, moderation state chips, and the audit log.warningnotification; the inbox renders moderation warning copy for all users.Page / App Changes
Affected Next.js Routes (Local):
Before (Screenshot)
After (Screenshot)
Component / Storybook Changes
Affected Storybook Components (Local):
Before (Screenshot)
After (Screenshot)
Not Doing
Other (Remarks)
This PR and #86 each add a migration numbered 0012 on independent branches. Whichever merges second needs
drizzle/meta/_journal.jsonreconciled (rename one migration to 0013 and update its journal entry).Checklists
console.log,debugger).