feat: show applicant's current round instead of assignments in members table
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
For APPLICANT users in the admin members list, the Assignments column now shows the project's current round name and state badge (Active, Pending, Rejected, etc.) instead of "0 assigned". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -426,7 +426,29 @@ export function MembersContent() {
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<div>
|
||||
{user.role === 'MENTOR' ? (
|
||||
{user.role === 'APPLICANT' ? (
|
||||
(() => {
|
||||
const info = (user as unknown as { applicantRoundInfo?: { roundName: string; state: string } | null }).applicantRoundInfo
|
||||
if (!info) return <span className="text-sm text-muted-foreground">-</span>
|
||||
const stateColor = info.state === 'REJECTED' ? 'destructive' as const
|
||||
: info.state === 'WITHDRAWN' ? 'secondary' as const
|
||||
: info.state === 'PASSED' ? 'success' as const
|
||||
: 'default' as const
|
||||
const stateLabel = info.state === 'IN_PROGRESS' ? 'Active'
|
||||
: info.state === 'PENDING' ? 'Pending'
|
||||
: info.state === 'COMPLETED' ? 'Completed'
|
||||
: info.state === 'PASSED' ? 'Passed'
|
||||
: info.state
|
||||
return (
|
||||
<div className="flex flex-col gap-0.5">
|
||||
<span className="text-sm">{info.roundName}</span>
|
||||
<Badge variant={stateColor} className="w-fit text-[10px] px-1.5 py-0">
|
||||
{stateLabel}
|
||||
</Badge>
|
||||
</div>
|
||||
)
|
||||
})()
|
||||
) : user.role === 'MENTOR' ? (
|
||||
<p>{(user as unknown as { _count: { mentorAssignments: number; assignments: number } })._count.mentorAssignments} mentored</p>
|
||||
) : (
|
||||
<p>{(user as unknown as { _count: { mentorAssignments: number; assignments: number } })._count.assignments} assigned</p>
|
||||
@@ -520,9 +542,33 @@ export function MembersContent() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center justify-between text-sm">
|
||||
<span className="text-muted-foreground">Assignments</span>
|
||||
<span className="text-muted-foreground">
|
||||
{user.role === 'APPLICANT' ? 'Current Round' : 'Assignments'}
|
||||
</span>
|
||||
<span>
|
||||
{user.role === 'MENTOR'
|
||||
{user.role === 'APPLICANT' ? (
|
||||
(() => {
|
||||
const info = (user as unknown as { applicantRoundInfo?: { roundName: string; state: string } | null }).applicantRoundInfo
|
||||
if (!info) return <span className="text-muted-foreground">-</span>
|
||||
const stateColor = info.state === 'REJECTED' ? 'destructive' as const
|
||||
: info.state === 'WITHDRAWN' ? 'secondary' as const
|
||||
: info.state === 'PASSED' ? 'success' as const
|
||||
: 'default' as const
|
||||
const stateLabel = info.state === 'IN_PROGRESS' ? 'Active'
|
||||
: info.state === 'PENDING' ? 'Pending'
|
||||
: info.state === 'COMPLETED' ? 'Completed'
|
||||
: info.state === 'PASSED' ? 'Passed'
|
||||
: info.state
|
||||
return (
|
||||
<span className="flex items-center gap-1.5">
|
||||
<span>{info.roundName}</span>
|
||||
<Badge variant={stateColor} className="text-[10px] px-1.5 py-0">
|
||||
{stateLabel}
|
||||
</Badge>
|
||||
</span>
|
||||
)
|
||||
})()
|
||||
) : user.role === 'MENTOR'
|
||||
? `${(user as unknown as { _count: { mentorAssignments: number; assignments: number } })._count.mentorAssignments} mentored`
|
||||
: `${(user as unknown as { _count: { mentorAssignments: number; assignments: number } })._count.assignments} assigned`}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user