From 51e18870b615fa5bd72c338b4bbda0671dd64b39 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 19 Feb 2026 11:11:00 +0100 Subject: [PATCH] Admin UI audit round 2: fix 28 display bugs across 23 files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HIGH fixes (broken features / wrong data): - H1: Fix roundAssignments → projectRoundStates in project router (7 occurrences) - H2: Fix deliberation results panel blank table (wrong field names) - H3: Fix deliberation participant names blank (wrong data path) - H4: Fix awards "Evaluated" stat duplicating "Eligible" count - H5: Fix cross-round comparison enabled at 1 round (backend requires 2) - H6: Fix setState during render anti-pattern (6 occurrences) - H7: Fix round detail jury member count always showing 0 - H8: Remove 4 invalid status values from observer dashboard filter - H9: Fix filtering progress bar always showing 100% MEDIUM fixes (misleading display): - M1: Filter special-award rounds from competition timeline - M2: Exclude special-award rounds from distinct project count - M3: Fix MENTORING pipeline node hardcoded "0 mentored" - M4: Fix DELIB_LOCKED badge using red for success state - M5: Add status label maps to deliberation session detail - M6: Humanize deliberation category + tie-break method displays - M8: Rename setStageId → setRoundId, "Select Stage" → "Select Round" - M9: Add missing INVITED/ACTIVE/SUSPENDED to members status labels - M10: Add ROUND_DRAFT/ACTIVE/CLOSED/ARCHIVED to StatusBadge - M11: Fix unsent messages showing "Scheduled" instead of "Draft" - M12: Rename misleading totalEvaluations → totalAssignments - M13: Rename "Stage" column to "Program" in projects page LOW fixes (cosmetic / edge-case): - L1: Use unfiltered rounds array for active round detection - L2: Use all rounds length for new round sort order - L3: Filter special-award rounds from header count - L4: Fix single-underscore replace in award status badges - L5: Fix score bucket boundary gaps (4.99 dropped between buckets) - L6: Title-case LIVE_FINAL pipeline metric status - L7: Fix roundType.replace only replacing first underscore - L8: Remove duplicate severity sort in smart-actions component Co-Authored-By: Claude Opus 4.6 --- src/app/(admin)/admin/awards/[id]/page.tsx | 6 +-- src/app/(admin)/admin/awards/page.tsx | 2 +- .../deliberation/[sessionId]/page.tsx | 36 +++++++++++--- .../[competitionId]/deliberation/page.tsx | 6 +-- .../competitions/[competitionId]/page.tsx | 4 +- src/app/(admin)/admin/messages/page.tsx | 20 ++++---- src/app/(admin)/admin/projects/page.tsx | 4 +- src/app/(admin)/admin/reports/page.tsx | 48 +++++++++++-------- .../(admin)/admin/rounds/[roundId]/page.tsx | 2 +- src/app/(admin)/admin/rounds/page.tsx | 7 +-- src/app/(observer)/observer/reports/page.tsx | 10 ++-- .../admin/deliberation/results-panel.tsx | 35 +++++++------- src/components/admin/members-content.tsx | 3 ++ .../dashboard/active-round-panel.tsx | 2 +- .../dashboard/pipeline-round-node.tsx | 8 ++-- src/components/dashboard/smart-actions.tsx | 14 +----- .../observer/observer-dashboard-content.tsx | 4 -- src/components/shared/status-badge.tsx | 4 ++ src/server/routers/analytics.ts | 14 +++--- src/server/routers/competition.ts | 2 +- src/server/routers/deliberation.ts | 19 +++++++- src/server/routers/project.ts | 16 +++---- src/server/routers/specialAward.ts | 15 ++++-- 23 files changed, 170 insertions(+), 111 deletions(-) diff --git a/src/app/(admin)/admin/awards/[id]/page.tsx b/src/app/(admin)/admin/awards/[id]/page.tsx index 474588c..0310e0e 100644 --- a/src/app/(admin)/admin/awards/[id]/page.tsx +++ b/src/app/(admin)/admin/awards/[id]/page.tsx @@ -438,7 +438,7 @@ export default function AwardDetailPage({
- {award.status.replace('_', ' ')} + {award.status.replace(/_/g, ' ')} {award.program.year} Edition @@ -594,7 +594,7 @@ export default function AwardDetailPage({

Evaluated

-

{award._count.eligibilities}

+

{(award as any).totalAssessed ?? award._count.eligibilities}

@@ -657,7 +657,7 @@ export default function AwardDetailPage({

- {award.eligibleCount} of {award._count.eligibilities} projects + {award.eligibleCount} of {(award as any).totalAssessed ?? award._count.eligibilities} projects eligible

diff --git a/src/app/(admin)/admin/awards/page.tsx b/src/app/(admin)/admin/awards/page.tsx index 6566bf1..d7b9175 100644 --- a/src/app/(admin)/admin/awards/page.tsx +++ b/src/app/(admin)/admin/awards/page.tsx @@ -171,7 +171,7 @@ export default function AwardsListPage() { {award.name} - {award.status.replace('_', ' ')} + {award.status.replace(/_/g, ' ')}
{award.description && ( diff --git a/src/app/(admin)/admin/competitions/[competitionId]/deliberation/[sessionId]/page.tsx b/src/app/(admin)/admin/competitions/[competitionId]/deliberation/[sessionId]/page.tsx index 9cb56ce..bf5db69 100644 --- a/src/app/(admin)/admin/competitions/[competitionId]/deliberation/[sessionId]/page.tsx +++ b/src/app/(admin)/admin/competitions/[competitionId]/deliberation/[sessionId]/page.tsx @@ -12,6 +12,30 @@ import { toast } from 'sonner'; import { ResultsPanel } from '@/components/admin/deliberation/results-panel'; import type { Route } from 'next'; +const STATUS_LABELS: Record = { + DELIB_OPEN: 'Open', + VOTING: 'Voting', + TALLYING: 'Tallying', + RUNOFF: 'Runoff', + DELIB_LOCKED: 'Locked', +}; +const STATUS_VARIANTS: Record = { + DELIB_OPEN: 'outline', + VOTING: 'default', + TALLYING: 'secondary', + RUNOFF: 'secondary', + DELIB_LOCKED: 'secondary', +}; +const CATEGORY_LABELS: Record = { + STARTUP: 'Startup', + BUSINESS_CONCEPT: 'Business Concept', +}; +const TIE_BREAK_LABELS: Record = { + TIE_RUNOFF: 'Runoff Vote', + TIE_ADMIN_DECIDES: 'Admin Decides', + SCORE_FALLBACK: 'Score Fallback', +}; + export default function DeliberationSessionPage({ params: paramsPromise }: { @@ -97,10 +121,10 @@ export default function DeliberationSessionPage({

Deliberation Session

- {session.status} + {STATUS_LABELS[session.status] ?? session.status}

- {session.round?.name} - {session.category} + {session.round?.name} - {CATEGORY_LABELS[session.category] ?? session.category}

@@ -128,7 +152,7 @@ export default function DeliberationSessionPage({

Tie Break Method

-

{session.tieBreakMethod}

+

{TIE_BREAK_LABELS[session.tieBreakMethod] ?? session.tieBreakMethod}

@@ -156,8 +180,8 @@ export default function DeliberationSessionPage({ className="flex items-center justify-between rounded-lg border p-3" >

-

{participant.user?.name}

-

{participant.user?.email}

+

{participant.user?.user?.name ?? 'Unknown'}

+

{participant.user?.user?.email}

{voterUserIds.has(participant.user?.user?.id) ? 'Voted' : 'Pending'} @@ -211,7 +235,7 @@ export default function DeliberationSessionPage({ key={participant.id} className="flex items-center justify-between rounded-lg border p-3" > - {participant.user?.name} + {participant.user?.user?.name ?? 'Unknown'} {voterUserIds.has(participant.user?.user?.id) ? 'Submitted' : 'Not Voted'} diff --git a/src/app/(admin)/admin/competitions/[competitionId]/deliberation/page.tsx b/src/app/(admin)/admin/competitions/[competitionId]/deliberation/page.tsx index b9f0053..b52a7b1 100644 --- a/src/app/(admin)/admin/competitions/[competitionId]/deliberation/page.tsx +++ b/src/app/(admin)/admin/competitions/[competitionId]/deliberation/page.tsx @@ -109,7 +109,7 @@ export default function DeliberationListPage({ VOTING: 'default', TALLYING: 'secondary', RUNOFF: 'secondary', - DELIB_LOCKED: 'destructive', + DELIB_LOCKED: 'secondary', }; const labels: Record = { DELIB_OPEN: 'Open', @@ -173,7 +173,7 @@ export default function DeliberationListPage({
- {session.round?.name} - {session.category} + {session.round?.name} - {session.category === 'BUSINESS_CONCEPT' ? 'Business Concept' : session.category === 'STARTUP' ? 'Startup' : session.category} {session.mode === 'SINGLE_WINNER_VOTE' ? 'Single Winner Vote' : 'Full Ranking'} @@ -186,7 +186,7 @@ export default function DeliberationListPage({
{session.participants?.length || 0} participants - Tie break: {session.tieBreakMethod} + Tie break: {session.tieBreakMethod === 'TIE_RUNOFF' ? 'Runoff Vote' : session.tieBreakMethod === 'TIE_ADMIN_DECIDES' ? 'Admin Decides' : session.tieBreakMethod === 'SCORE_FALLBACK' ? 'Score Fallback' : session.tieBreakMethod}
diff --git a/src/app/(admin)/admin/competitions/[competitionId]/page.tsx b/src/app/(admin)/admin/competitions/[competitionId]/page.tsx index a1af298..db09ecb 100644 --- a/src/app/(admin)/admin/competitions/[competitionId]/page.tsx +++ b/src/app/(admin)/admin/competitions/[competitionId]/page.tsx @@ -332,7 +332,7 @@ export default function CompetitionDetailPage() { !r.specialAwardId)} /> @@ -386,7 +386,7 @@ export default function CompetitionDetailPage() { roundTypeColors[round.roundType] ?? 'bg-gray-100 text-gray-700' )} > - {round.roundType.replace('_', ' ')} + {round.roundType.replace(/_/g, ' ')} ('ALL') const [selectedRole, setSelectedRole] = useState('') - const [roundId, setStageId] = useState('') + const [roundId, setRoundId] = useState('') const [selectedProgramId, setSelectedProgramId] = useState('') const [selectedUserId, setSelectedUserId] = useState('') const [subject, setSubject] = useState('') @@ -125,7 +125,7 @@ export default function MessagesPage() { setBody('') setSelectedTemplateId('') setSelectedRole('') - setStageId('') + setRoundId('') setSelectedProgramId('') setSelectedUserId('') setIsScheduled(false) @@ -219,7 +219,7 @@ export default function MessagesPage() { return } if (recipientType === 'ROUND_JURY' && !roundId) { - toast.error('Please select a stage') + toast.error('Please select a round') return } if (recipientType === 'PROGRAM_TEAM' && !selectedProgramId) { @@ -296,7 +296,7 @@ export default function MessagesPage() { onValueChange={(v) => { setRecipientType(v as RecipientType) setSelectedRole('') - setStageId('') + setRoundId('') setSelectedProgramId('') setSelectedUserId('') }} @@ -335,10 +335,10 @@ export default function MessagesPage() { {recipientType === 'ROUND_JURY' && (
- - - + {rounds?.map((round) => ( @@ -616,11 +616,15 @@ export default function MessagesPage() { Sent - ) : ( + ) : msg.scheduledAt ? ( Scheduled + ) : ( + + Draft + )} diff --git a/src/app/(admin)/admin/projects/page.tsx b/src/app/(admin)/admin/projects/page.tsx index 778fc9d..da03b7c 100644 --- a/src/app/(admin)/admin/projects/page.tsx +++ b/src/app/(admin)/admin/projects/page.tsx @@ -864,7 +864,7 @@ export default function ProjectsPage() { Project Category - Stage + Program Tags Assignments Status @@ -1065,7 +1065,7 @@ export default function ProjectsPage() {
- Stage + Program {project.program?.name ?? 'Unassigned'}
{project.competitionCategory && ( diff --git a/src/app/(admin)/admin/reports/page.tsx b/src/app/(admin)/admin/reports/page.tsx index 945f05b..7d18f12 100644 --- a/src/app/(admin)/admin/reports/page.tsx +++ b/src/app/(admin)/admin/reports/page.tsx @@ -1,6 +1,6 @@ 'use client' -import { useState } from 'react' +import { useState, useEffect } from 'react' import Link from 'next/link' import { trpc } from '@/lib/trpc/client' import { @@ -71,9 +71,11 @@ function ReportsOverview() { // Project reporting scope (default: latest program, all rounds) const [selectedValue, setSelectedValue] = useState(null) - if (programs?.length && !selectedValue) { - setSelectedValue(`all:${programs[0].id}`) - } + useEffect(() => { + if (programs?.length && !selectedValue) { + setSelectedValue(`all:${programs[0].id}`) + } + }, [programs, selectedValue]) const scopeInput = parseSelection(selectedValue) const hasScope = !!scopeInput.roundId || !!scopeInput.programId @@ -109,7 +111,7 @@ function ReportsOverview() { const activeRounds = dashStats?.activeRoundCount ?? rounds.filter((r: { status: string }) => r.status === 'ROUND_ACTIVE').length const jurorCount = dashStats?.jurorCount ?? 0 const submittedEvaluations = dashStats?.submittedEvaluations ?? 0 - const totalEvaluations = dashStats?.totalEvaluations ?? 0 + const totalAssignments = dashStats?.totalAssignments ?? 0 const completionRate = dashStats?.completionRate ?? 0 return ( @@ -177,7 +179,7 @@ function ReportsOverview() {

Evaluations

{submittedEvaluations}

- {totalEvaluations > 0 + {totalAssignments > 0 ? `${completionRate}% completion rate` : 'No assignments yet'}

@@ -417,9 +419,11 @@ function StageAnalytics() { ) || [] // Set default selected stage - if (rounds.length && !selectedValue) { - setSelectedValue(rounds[0].id) - } + useEffect(() => { + if (rounds.length && !selectedValue) { + setSelectedValue(rounds[0].id) + } + }, [rounds.length, selectedValue]) const queryInput = parseSelection(selectedValue) const hasSelection = !!queryInput.roundId || !!queryInput.programId @@ -701,9 +705,11 @@ function JurorConsistencyTab() { ((p.stages ?? []) as Array<{ id: string; name: string }>).map((s: { id: string; name: string }) => ({ id: s.id, name: s.name, programId: p.id, programName: `${p.year} Edition` })) ) || [] - if (stages.length && !selectedValue) { - setSelectedValue(stages[0].id) - } + useEffect(() => { + if (stages.length && !selectedValue) { + setSelectedValue(stages[0].id) + } + }, [stages.length, selectedValue]) const queryInput = parseSelection(selectedValue) const hasSelection = !!queryInput.roundId || !!queryInput.programId @@ -773,9 +779,11 @@ function DiversityTab() { ((p.stages ?? []) as Array<{ id: string; name: string }>).map((s: { id: string; name: string }) => ({ id: s.id, name: s.name, programId: p.id, programName: `${p.year} Edition` })) ) || [] - if (stages.length && !selectedValue) { - setSelectedValue(stages[0].id) - } + useEffect(() => { + if (stages.length && !selectedValue) { + setSelectedValue(stages[0].id) + } + }, [stages.length, selectedValue]) const queryInput = parseSelection(selectedValue) const hasSelection = !!queryInput.roundId || !!queryInput.programId @@ -846,7 +854,7 @@ function RoundPipelineTab() { const { data: comparison, isLoading: comparisonLoading } = trpc.analytics.getCrossRoundComparison.useQuery( { roundIds }, - { enabled: roundIds.length >= 1 } + { enabled: roundIds.length >= 2 } ) if (isLoading || comparisonLoading) { @@ -929,9 +937,11 @@ export default function ReportsPage() { ((p.stages ?? []) as Array<{ id: string; name: string }>).map((s: { id: string; name: string }) => ({ id: s.id, name: s.name, programName: `${p.year} Edition` })) ) || [] - if (pdfStages.length && !pdfStageId) { - setPdfStageId(pdfStages[0].id) - } + useEffect(() => { + if (pdfStages.length && !pdfStageId) { + setPdfStageId(pdfStages[0].id) + } + }, [pdfStages.length, pdfStageId]) const selectedPdfStage = pdfStages.find((r) => r.id === pdfStageId) diff --git a/src/app/(admin)/admin/rounds/[roundId]/page.tsx b/src/app/(admin)/admin/rounds/[roundId]/page.tsx index a7c848e..2e12351 100644 --- a/src/app/(admin)/admin/rounds/[roundId]/page.tsx +++ b/src/app/(admin)/admin/rounds/[roundId]/page.tsx @@ -450,7 +450,7 @@ export default function RoundDetailPage() { [projectStates]) const passedCount = stateCounts['PASSED'] ?? 0 const juryGroup = round?.juryGroup - const juryMemberCount = juryGroup?.members?.length ?? 0 + const juryMemberCount = juryGroupDetail?.members?.length ?? 0 const isFiltering = round?.roundType === 'FILTERING' const isEvaluation = round?.roundType === 'EVALUATION' diff --git a/src/app/(admin)/admin/rounds/page.tsx b/src/app/(admin)/admin/rounds/page.tsx index 4a6e856..210735f 100644 --- a/src/app/(admin)/admin/rounds/page.tsx +++ b/src/app/(admin)/admin/rounds/page.tsx @@ -95,6 +95,7 @@ type RoundWithStats = { sortOrder: number windowOpenAt: string | null windowCloseAt: string | null + specialAwardId: string | null juryGroup: { id: string; name: string } | null _count: { projectRoundStates: number; assignments: number } } @@ -193,7 +194,7 @@ export default function RoundsPage() { return } const slug = roundForm.name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') - const nextOrder = rounds.length + const nextOrder = (compDetail?.rounds ?? []).length createRoundMutation.mutate({ competitionId: comp.id, name: roundForm.name.trim(), @@ -286,7 +287,7 @@ export default function RoundsPage() { const totalProjects = (compDetail as any)?.distinctProjectCount ?? 0 const allRounds = (compDetail?.rounds ?? []) as RoundWithStats[] const totalAssignments = allRounds.reduce((s, r) => s + r._count.assignments, 0) - const activeRound = rounds.find((r) => r.status === 'ROUND_ACTIVE') + const activeRound = allRounds.find((r) => r.status === 'ROUND_ACTIVE') return ( @@ -327,7 +328,7 @@ export default function RoundsPage() {
- {allRounds.length} rounds + {allRounds.filter((r) => !r.specialAwardId).length} rounds | {totalProjects} projects | diff --git a/src/app/(observer)/observer/reports/page.tsx b/src/app/(observer)/observer/reports/page.tsx index 1834e8f..6fdb59e 100644 --- a/src/app/(observer)/observer/reports/page.tsx +++ b/src/app/(observer)/observer/reports/page.tsx @@ -1,6 +1,6 @@ 'use client' -import { useState } from 'react' +import { useState, useEffect } from 'react' import { trpc } from '@/lib/trpc/client' import { Card, @@ -591,9 +591,11 @@ export default function ObserverReportsPage() { ) || [] // Set default selected stage - if (stages.length && !selectedValue) { - setSelectedValue(stages[0].id) - } + useEffect(() => { + if (stages.length && !selectedValue) { + setSelectedValue(stages[0].id) + } + }, [stages.length, selectedValue]) const hasSelection = !!selectedValue const selectedRound = stages.find((s) => s.id === selectedValue) diff --git a/src/components/admin/deliberation/results-panel.tsx b/src/components/admin/deliberation/results-panel.tsx index cc687da..b2e9dce 100644 --- a/src/components/admin/deliberation/results-panel.tsx +++ b/src/components/admin/deliberation/results-panel.tsx @@ -24,7 +24,10 @@ export function ResultsPanel({ sessionId }: ResultsPanelProps) { ); const { data: aggregatedResults } = trpc.deliberation.aggregate.useQuery( { sessionId }, - { refetchInterval: 10_000 } + { + refetchInterval: 10_000, + enabled: session?.status === 'TALLYING' || session?.status === 'RUNOFF' || session?.status === 'DELIB_LOCKED', + } ); const initRunoffMutation = trpc.deliberation.initRunoff.useMutation({ @@ -52,34 +55,32 @@ export function ResultsPanel({ sessionId }: ResultsPanelProps) { return ( -

No voting results yet

+

+ {session?.status === 'DELIB_OPEN' || session?.status === 'VOTING' + ? 'Voting has not been tallied yet' + : 'No voting results yet'} +

); } - // Detect ties: check if two or more top-ranked candidates share the same totalScore - const hasTie = (() => { - const rankings = aggregatedResults.rankings as Array<{ totalScore?: number; projectId: string }> | undefined; + // Detect ties using the backend-computed flag, with client-side fallback + const hasTie = aggregatedResults.hasTies ?? (() => { + const rankings = aggregatedResults.rankings as Array<{ score?: number; projectId: string }> | undefined; if (!rankings || rankings.length < 2) return false; - // Group projects by totalScore const scoreGroups = new Map(); for (const r of rankings) { - const score = r.totalScore ?? 0; + const score = r.score ?? 0; const group = scoreGroups.get(score) || []; group.push(r.projectId); scoreGroups.set(score, group); } - // A tie exists if the highest score is shared by 2+ projects const topScore = Math.max(...scoreGroups.keys()); const topGroup = scoreGroups.get(topScore); return (topGroup?.length ?? 0) >= 2; })(); - const tiedProjectIds = hasTie - ? (aggregatedResults.rankings as Array<{ totalScore?: number; projectId: string }>) - .filter((r) => r.totalScore === (aggregatedResults.rankings as Array<{ totalScore?: number }>)[0]?.totalScore) - .map((r) => r.projectId) - : []; + const tiedProjectIds = aggregatedResults.tiedProjectIds ?? []; const canFinalize = session?.status === 'TALLYING' && !hasTie; return ( @@ -101,17 +102,17 @@ export function ResultsPanel({ sessionId }: ResultsPanelProps) { >
- #{index + 1} + #{result.rank ?? index + 1}
-

{result.projectTitle}

+

{result.projectTitle ?? result.projectId}

- {result.votes} votes • {result.averageRank?.toFixed(2)} avg rank + {result.voteCount} votes

- {result.totalScore?.toFixed(1) || 0} + {result.score?.toFixed?.(1) ?? 0}
))} diff --git a/src/components/admin/members-content.tsx b/src/components/admin/members-content.tsx index e79220b..b51bfb0 100644 --- a/src/components/admin/members-content.tsx +++ b/src/components/admin/members-content.tsx @@ -53,6 +53,9 @@ const statusColors: Record = { NONE: 'Not Invited', + INVITED: 'Invited', + ACTIVE: 'Active', + SUSPENDED: 'Suspended', } const roleColors: Record = { diff --git a/src/components/dashboard/active-round-panel.tsx b/src/components/dashboard/active-round-panel.tsx index fc20549..d400da9 100644 --- a/src/components/dashboard/active-round-panel.tsx +++ b/src/components/dashboard/active-round-panel.tsx @@ -169,7 +169,7 @@ function RoundTypeContent({ round }: { round: PipelineRound }) { case 'FILTERING': { const processed = round.filteringPassed + round.filteringRejected + round.filteringFlagged - const total = round.filteringTotal + const total = round.projectStates.total || round.filteringTotal const pct = total > 0 ? Math.round((processed / total) * 100) : 0 return ( diff --git a/src/components/dashboard/pipeline-round-node.tsx b/src/components/dashboard/pipeline-round-node.tsx index a25c5cd..af4dee9 100644 --- a/src/components/dashboard/pipeline-round-node.tsx +++ b/src/components/dashboard/pipeline-round-node.tsx @@ -133,9 +133,11 @@ function getMetric(round: PipelineRound): string { case 'SUBMISSION': return `${projectStates.COMPLETED} submitted` case 'MENTORING': - return '0 mentored' - case 'LIVE_FINAL': - return liveSessionStatus || `${projectStates.total} finalists` + return `${projectStates.COMPLETED ?? 0} mentored` + case 'LIVE_FINAL': { + const status = liveSessionStatus + return status ? status.charAt(0) + status.slice(1).toLowerCase() : `${projectStates.total} finalists` + } case 'DELIBERATION': return deliberationCount > 0 ? `${deliberationCount} sessions` diff --git a/src/components/dashboard/smart-actions.tsx b/src/components/dashboard/smart-actions.tsx index f896f63..3c92de1 100644 --- a/src/components/dashboard/smart-actions.tsx +++ b/src/components/dashboard/smart-actions.tsx @@ -29,12 +29,6 @@ type SmartActionsProps = { actions: DashboardAction[] } -const severityOrder: Record = { - critical: 0, - warning: 1, - info: 2, -} - const severityConfig = { critical: { icon: AlertTriangle, @@ -57,10 +51,6 @@ const severityConfig = { } export function SmartActions({ actions }: SmartActionsProps) { - const sorted = [...actions].sort( - (a, b) => severityOrder[a.severity] - severityOrder[b.severity] - ) - return ( @@ -73,7 +63,7 @@ export function SmartActions({ actions }: SmartActionsProps) { )} - {sorted.length === 0 ? ( + {actions.length === 0 ? (
@@ -84,7 +74,7 @@ export function SmartActions({ actions }: SmartActionsProps) {
) : (
- {sorted.map((action) => { + {actions.map((action) => { const config = severityConfig[action.severity] const Icon = config.icon diff --git a/src/components/observer/observer-dashboard-content.tsx b/src/components/observer/observer-dashboard-content.tsx index 61dd160..d6a7a1b 100644 --- a/src/components/observer/observer-dashboard-content.tsx +++ b/src/components/observer/observer-dashboard-content.tsx @@ -290,13 +290,9 @@ export function ObserverDashboardContent({ userName }: { userName?: string }) { Submitted Eligible Assigned - Under Review - Shortlisted Semi-finalist Finalist - Winner Rejected - Withdrawn