Fix multi-click submit bug and add draft submit indicator on juror dashboard
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m24s
All checks were successful
Build and Push Docker Image / build (push) Successful in 8m24s
- Initialize slider values to midpoint so visual matches stored value (root cause: sliders appeared filled but criteriaValues was undefined) - Use mutateAsync for submit to properly await and prevent double-clicks - Add startMutation.isPending to submit button disabled state - Add error toast in evaluation-form.tsx catch block (was silent) - Show "Ready to submit" badge and "Review & Submit" button for drafts on juror dashboard Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
Zap,
|
||||
BarChart3,
|
||||
Waves,
|
||||
Send,
|
||||
} from 'lucide-react'
|
||||
import { formatDateOnly } from '@/lib/utils'
|
||||
import { CountdownTimer } from '@/components/shared/countdown-timer'
|
||||
@@ -390,6 +391,11 @@ async function JuryDashboardContent() {
|
||||
<CheckCircle2 className="mr-1 h-3 w-3" />
|
||||
Done
|
||||
</Badge>
|
||||
) : isDraft && isVotingOpen ? (
|
||||
<Badge className="text-xs bg-amber-100 text-amber-800 border-amber-300 dark:bg-amber-950 dark:text-amber-300 dark:border-amber-700 animate-pulse">
|
||||
<Send className="mr-1 h-3 w-3" />
|
||||
Ready to submit
|
||||
</Badge>
|
||||
) : isDraft ? (
|
||||
<Badge variant="warning" className="text-xs">
|
||||
<Clock className="mr-1 h-3 w-3" />
|
||||
@@ -404,10 +410,17 @@ async function JuryDashboardContent() {
|
||||
View
|
||||
</Link>
|
||||
</Button>
|
||||
) : isVotingOpen && isDraft ? (
|
||||
<Button size="sm" asChild className="h-7 px-3 bg-amber-600 hover:bg-amber-700 text-white shadow-sm">
|
||||
<Link href={`/jury/competitions/${assignment.round.id}/projects/${assignment.project.id}/evaluate`}>
|
||||
<Send className="mr-1 h-3 w-3" />
|
||||
Review & Submit
|
||||
</Link>
|
||||
</Button>
|
||||
) : isVotingOpen ? (
|
||||
<Button size="sm" asChild className="h-7 px-3 bg-brand-blue hover:bg-brand-blue-light shadow-sm">
|
||||
<Link href={`/jury/competitions/${assignment.round.id}/projects/${assignment.project.id}/evaluate`}>
|
||||
{isDraft ? 'Continue' : 'Evaluate'}
|
||||
Evaluate
|
||||
</Link>
|
||||
</Button>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user