fix: impersonation, dashboard counter, logo lightbox, submission config, auth logs
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m12s

- Fix impersonation by bypassing useSession().update() loading gate with direct session POST
- Fix dashboard account counter defaulting to latest round with PASSED projects
- Add clickToEnlarge lightbox for project logos on admin detail page
- Remove submission eligibility config (all passed projects must upload)
- Suppress CredentialsSignin auth errors in production (minified name check)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 15:40:08 +01:00
parent fd2624f198
commit b7905a82e1
10 changed files with 117 additions and 102 deletions

View File

@@ -3,6 +3,12 @@
import { useState, useEffect } from 'react'
import { cn, getInitials } from '@/lib/utils'
import { ClipboardList } from 'lucide-react'
import {
Dialog,
DialogContent,
DialogTitle,
} from '@/components/ui/dialog'
import { VisuallyHidden } from '@radix-ui/react-visually-hidden'
type ProjectLogoProps = {
project: {
@@ -13,6 +19,8 @@ type ProjectLogoProps = {
size?: 'sm' | 'md' | 'lg'
fallback?: 'icon' | 'initials'
className?: string
/** When true, clicking the logo opens a lightbox */
clickToEnlarge?: boolean
}
const sizeClasses = {
@@ -39,8 +47,10 @@ export function ProjectLogo({
size = 'md',
fallback = 'icon',
className,
clickToEnlarge,
}: ProjectLogoProps) {
const [imageError, setImageError] = useState(false)
const [lightboxOpen, setLightboxOpen] = useState(false)
const initials = getInitials(project.title)
// Reset error state when logoUrl changes
@@ -49,28 +59,26 @@ export function ProjectLogo({
}, [logoUrl])
const showImage = logoUrl && !imageError
const canEnlarge = clickToEnlarge && showImage
if (showImage) {
return (
<div
className={cn(
'relative overflow-hidden rounded-lg bg-muted',
sizeClasses[size],
className
)}
>
<img
src={logoUrl}
alt={`${project.title} logo`}
className="h-full w-full object-cover"
onError={() => setImageError(true)}
/>
</div>
)
}
// Fallback
return (
const logoElement = showImage ? (
<div
className={cn(
'relative overflow-hidden rounded-lg bg-muted',
sizeClasses[size],
canEnlarge && 'cursor-pointer ring-offset-background transition-all hover:ring-2 hover:ring-primary/30',
className
)}
onClick={canEnlarge ? () => setLightboxOpen(true) : undefined}
>
<img
src={logoUrl}
alt={`${project.title} logo`}
className="h-full w-full object-cover"
onError={() => setImageError(true)}
/>
</div>
) : (
<div
className={cn(
'flex items-center justify-center rounded-lg bg-muted',
@@ -87,4 +95,22 @@ export function ProjectLogo({
)}
</div>
)
return (
<>
{logoElement}
{canEnlarge && (
<Dialog open={lightboxOpen} onOpenChange={setLightboxOpen}>
<DialogContent className="max-w-lg p-2">
<VisuallyHidden><DialogTitle>{project.title} logo</DialogTitle></VisuallyHidden>
<img
src={logoUrl!}
alt={`${project.title} logo`}
className="w-full rounded-lg object-contain"
/>
</DialogContent>
</Dialog>
)}
</>
)
}