Dashboard: Berichten-tegel naast de Systeemstatus-tegel (twee kolommen vanaf md)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,8 +25,8 @@ export function MessagesTile() {
|
|||||||
if (!available) return null;
|
if (!available) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link to="/messages" className="block" data-testid="messages-tile">
|
<Link to="/messages" className="block h-full" data-testid="messages-tile">
|
||||||
<Card className="transition-colors hover:bg-accent/50">
|
<Card className="h-full transition-colors hover:bg-accent/50">
|
||||||
<CardHeader className="flex-row items-center justify-between space-y-0">
|
<CardHeader className="flex-row items-center justify-between space-y-0">
|
||||||
<CardTitle>{t('contact.title')}</CardTitle>
|
<CardTitle>{t('contact.title')}</CardTitle>
|
||||||
<Mail className="size-5 text-muted-foreground" aria-hidden="true" />
|
<Mail className="size-5 text-muted-foreground" aria-hidden="true" />
|
||||||
|
|||||||
@@ -671,6 +671,9 @@ describe('Dashboard tile', () => {
|
|||||||
expect(screen.getByTestId('messages-tile-count')).toHaveTextContent('1'),
|
expect(screen.getByTestId('messages-tile-count')).toHaveTextContent('1'),
|
||||||
);
|
);
|
||||||
expect(tile).toHaveAttribute('href', '/messages');
|
expect(tile).toHaveAttribute('href', '/messages');
|
||||||
|
// Next to the system status tile in the same grid, not full width.
|
||||||
|
expect(tile.parentElement).toBe(screen.getByTestId('dashboard-tiles'));
|
||||||
|
expect(screen.getByTestId('availability-badge').closest('[data-testid="dashboard-tiles"]')).not.toBeNull();
|
||||||
expect(tile).toHaveTextContent('unread message');
|
expect(tile).toHaveTextContent('unread message');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -22,48 +22,49 @@ export function DashboardPage() {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Card>
|
<div className="grid gap-4 md:grid-cols-2" data-testid="dashboard-tiles">
|
||||||
<CardHeader>
|
<Card>
|
||||||
<CardTitle>{t('availability.title')}</CardTitle>
|
<CardHeader>
|
||||||
</CardHeader>
|
<CardTitle>{t('availability.title')}</CardTitle>
|
||||||
<CardContent>
|
</CardHeader>
|
||||||
{isLoading && (
|
<CardContent>
|
||||||
<div
|
{isLoading && (
|
||||||
data-testid="availability-skeleton"
|
<div
|
||||||
className="h-8 w-32 animate-pulse rounded-full bg-muted"
|
data-testid="availability-skeleton"
|
||||||
/>
|
className="h-8 w-32 animate-pulse rounded-full bg-muted"
|
||||||
)}
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{!isLoading && data && (
|
{!isLoading && data && (
|
||||||
<AvailabilityStatusBadge
|
<AvailabilityStatusBadge
|
||||||
status={data.status}
|
status={data.status}
|
||||||
message={data.message}
|
message={data.message}
|
||||||
stale={isError}
|
stale={isError}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isError && (
|
{isError && (
|
||||||
<div
|
<div
|
||||||
data-testid="availability-error"
|
data-testid="availability-error"
|
||||||
className="mt-3 flex items-center gap-3 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive"
|
className="mt-3 flex items-center gap-3 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive"
|
||||||
>
|
|
||||||
<span>{t('availability.errorTitle')}</span>
|
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
data-testid="availability-retry"
|
|
||||||
onClick={() => void refetch()}
|
|
||||||
>
|
>
|
||||||
{t('availability.retry')}
|
<span>{t('availability.errorTitle')}</span>
|
||||||
</Button>
|
<Button
|
||||||
</div>
|
variant="outline"
|
||||||
)}
|
size="sm"
|
||||||
|
data-testid="availability-retry"
|
||||||
|
onClick={() => void refetch()}
|
||||||
|
>
|
||||||
|
{t('availability.retry')}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{!isLoading && !data && !isError && null}
|
{!isLoading && !data && !isError && null}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
<MessagesTile />
|
||||||
<MessagesTile />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user