Commit Graph

9 Commits

Author SHA1 Message Date
hikari 1f62d64ace fix: improve dropdown option contrast for readability
Add explicit background and text color styling to select option
elements to fix poor contrast that made dropdown options illegible.

Changes:
- Add option styling to settings component select dropdown
- Add option styling to admin reports component select dropdown
- Set background to match form background color
- Set text color to match standard text color
- Ensures dropdown options are readable on all backgrounds
2026-02-19 20:42:06 -08:00
hikari 6e93ea140f fix: hide all badges when no primary badge is selected
Update the badge display logic so that if a user hasn't selected
a primary badge, no badges are shown at all (instead of showing
all badges).

Changes:
- Remove else clause from profile badge section (only show badges-section div if primaryBadge is set)
- Remove else clause from comment badge display
- Update help text from "show all" to "hide all" in settings
- Update help text in admin profile edit modal to match
- Clarify that badge selection applies to both profile and comments
2026-02-19 20:36:42 -08:00
hikari 9d965808a7 feat: add primary badge selection for user profiles
Implements #49 - Allow users to select one primary badge to display
on their profile instead of showing all badges at once.

Changes:
- Add PrimaryBadge enum to Prisma schema and shared types (STAFF, MOD, VIP, DISCORD)
- Add primaryBadge field to User model and all user interfaces
- Update settings component with badge selection dropdown
- Only show badges the user actually has in the dropdown
- Update profile component to display only selected badge (or all if none selected)
- Add primaryBadge to admin profile edit modal
- Update API routes and services to handle primaryBadge
- Export PrimaryBadge enum from shared-types (not just as type)

Additional fixes:
- Fix Angular output naming: rename onEdit/onDelete to edit/delete
- Update all parent components using comment-display outputs
- Add type casting for Prisma PrimaryBadge enum to shared-types enum
2026-02-19 20:28:23 -08:00
hikari bbc3b040d0 feat: add comprehensive profile editing modal for admins
Replaced the simple prompt-based profile editing with a full-featured modal
that allows admins to edit all profile fields:

Profile Information:
- Display Name
- Profile URL Slug (with uniqueness validation)
- Bio (with character counter)

Social Links:
- Website
- Discord Server
- GitHub username
- Bluesky handle
- LinkedIn username
- Twitch username
- YouTube handle/channel

All fields include:
- Proper validation patterns
- Help text explaining format requirements
- Styled form sections for organization
- Loading states during submission
- Success/error toast notifications

The modal opens when clicking "Edit Profile" on a profile report, loads
the current profile data, and saves all changes via the admin API endpoint.
2026-02-19 20:15:03 -08:00
hikari c154ef1897 feat: add admin profile editing capability
Added admin endpoint and functionality for editing user profiles from the
report management interface:

Backend Changes:
- Added PUT /api/users/:id endpoint for admin-only profile editing
- Reuses existing updateUserSettings logic with slug uniqueness validation
- Protected with adminGuard and csrfProtection
- Proper audit logging for admin profile edits

Frontend Changes:
- Added adminUpdateUser() method to UserService
- Updated editProfile() in admin-reports to load profile and allow bio editing
- Uses prompt for quick bio editing (can be expanded to full form later)
- Shows success/error toasts and refreshes report list after edit

Admins can now quickly edit reported user profiles directly from the
report management interface.
2026-02-19 20:05:57 -08:00
hikari 6e884b9ae8 feat: implement admin action APIs for comment and profile moderation
Added full API implementation for admin action buttons in the report
management interface:

Backend Changes:
- Created new /api/comments routes for admin-only comment operations
- Added PUT /api/comments/:id for admin comment editing
- Added DELETE /api/comments/:id for admin comment deletion
- Added POST /api/users/:id/make-private for admin profile privacy control
- All endpoints protected with adminGuard and csrfProtection
- Proper audit logging for all admin actions
- Added onDelete: Cascade to CommentReport relation for safe comment deletion

Frontend Changes:
- Added adminUpdateComment() and adminDeleteComment() to CommentsService
- Added makeProfilePrivate() to UserService
- Integrated API calls into admin-reports component methods
- editComment() now updates comment via API and refreshes report list
- deleteComment() now deletes comment via API and refreshes report list
- makeProfilePrivate() now updates profile privacy via API
- editProfile() navigates using ObjectId instead of Discord username
- All actions show success/error toasts and close modals on completion

The admin interface now has full working moderation capabilities for both
comment and profile reports.
2026-02-19 19:58:13 -08:00
naomi 8837055e97 feat: add admin action buttons to report review modals
Added admin-specific action buttons in the report review modals:
- Comment reports: Edit Comment and Delete Comment buttons
- Profile reports: Edit Profile and Make Private buttons

Admin actions include:
- Edit comment content directly from the modal
- Delete reported comments with confirmation
- Navigate to profile edit page
- Make reported profiles private

Methods are stubbed with TODOs for full API integration.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-19 19:37:19 -08:00
naomi e728968fc9 feat: add comment report management to admin interface
Updated the admin-reports component to handle both profile and comment reports:
- Added report type toggle to switch between profile and comment reports
- Duplicated report display logic for comment reports
- Comment reports show the comment content with truncation
- Added separate review modals for profile and comment reports
- Comment reports display comment author instead of reported user
- Maintains all existing functionality for profile reports

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-19 19:32:02 -08:00
hikari d797d38ddd feat: implement profile reporting system with admin review
Added comprehensive profile reporting system to allow users to report
inappropriate profiles and admins to review reports.

Features:
- User can report profiles with predefined reasons + custom details
- Duplicate prevention (one pending report per profile per user)
- Rate limiting (5 pending reports maximum per user)
- Admin dashboard to view and filter reports (All, Pending, Reviewed, etc.)
- Admin review modal to update status and add review notes
- Report button on profile page (only visible when viewing others)
- Font Awesome icons for better UI consistency

Database changes:
- New ProfileReport model with ReportReason/ReportStatus enums
- User relations for reports (reportsMade, reportsReceived, reportsReviewed)
- Indices for efficient querying
2026-02-19 18:33:58 -08:00