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;
|
||||
|
||||
return (
|
||||
<Link to="/messages" className="block" data-testid="messages-tile">
|
||||
<Card className="transition-colors hover:bg-accent/50">
|
||||
<Link to="/messages" className="block h-full" data-testid="messages-tile">
|
||||
<Card className="h-full transition-colors hover:bg-accent/50">
|
||||
<CardHeader className="flex-row items-center justify-between space-y-0">
|
||||
<CardTitle>{t('contact.title')}</CardTitle>
|
||||
<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(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');
|
||||
});
|
||||
|
||||
|
||||
@@ -22,48 +22,49 @@ export function DashboardPage() {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t('availability.title')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{isLoading && (
|
||||
<div
|
||||
data-testid="availability-skeleton"
|
||||
className="h-8 w-32 animate-pulse rounded-full bg-muted"
|
||||
/>
|
||||
)}
|
||||
<div className="grid gap-4 md:grid-cols-2" data-testid="dashboard-tiles">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t('availability.title')}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{isLoading && (
|
||||
<div
|
||||
data-testid="availability-skeleton"
|
||||
className="h-8 w-32 animate-pulse rounded-full bg-muted"
|
||||
/>
|
||||
)}
|
||||
|
||||
{!isLoading && data && (
|
||||
<AvailabilityStatusBadge
|
||||
status={data.status}
|
||||
message={data.message}
|
||||
stale={isError}
|
||||
/>
|
||||
)}
|
||||
{!isLoading && data && (
|
||||
<AvailabilityStatusBadge
|
||||
status={data.status}
|
||||
message={data.message}
|
||||
stale={isError}
|
||||
/>
|
||||
)}
|
||||
|
||||
{isError && (
|
||||
<div
|
||||
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"
|
||||
>
|
||||
<span>{t('availability.errorTitle')}</span>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
data-testid="availability-retry"
|
||||
onClick={() => void refetch()}
|
||||
{isError && (
|
||||
<div
|
||||
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"
|
||||
>
|
||||
{t('availability.retry')}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
<span>{t('availability.errorTitle')}</span>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
data-testid="availability-retry"
|
||||
onClick={() => void refetch()}
|
||||
>
|
||||
{t('availability.retry')}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!isLoading && !data && !isError && null}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<MessagesTile />
|
||||
{!isLoading && !data && !isError && null}
|
||||
</CardContent>
|
||||
</Card>
|
||||
<MessagesTile />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user