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
This commit is contained in:
2026-02-19 20:28:23 -08:00
committed by Naomi Carrigan
parent bbc3b040d0
commit 9d965808a7
16 changed files with 155 additions and 36 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
*/
export type * from "./lib/art.types";
export * from "./lib/audit.types";
export type * from "./lib/auth.types";
export * from "./lib/auth.types";
export * from "./lib/book.types";
export type * from "./lib/comment.types";
export type * from "./lib/common.types";
+11
View File
@@ -4,6 +4,15 @@
* @author Naomi Carrigan
*/
/* eslint-disable @typescript-eslint/naming-convention -- Prisma enum values use UPPER_CASE */
enum PrimaryBadge {
STAFF = "STAFF",
MOD = "MOD",
VIP = "VIP",
DISCORD = "DISCORD",
}
/* eslint-enable @typescript-eslint/naming-convention */
interface User {
id: string;
email: string;
@@ -13,6 +22,7 @@ interface User {
displayName?: string;
bio?: string;
profilePublic: boolean;
primaryBadge?: PrimaryBadge;
website?: string;
discordServer?: string;
bluesky?: string;
@@ -47,4 +57,5 @@ interface AuthResponse {
user: User;
}
export { PrimaryBadge };
export type { AuthResponse, JwtPayload, User };