MY QUALITY - First iteration

This commit is contained in:
2026-06-11 15:43:35 +01:00
parent 4f8996712e
commit 1fdb9536fa
31 changed files with 1965 additions and 98 deletions
@@ -1,7 +1,7 @@
'use client';
import { useState, useEffect, useRef } from 'react';
import { CheckCircle2, Clock, Loader2, Wrench, BarChart2 } from 'lucide-react';
import { CheckCircle2, Clock, Loader2, Wrench, BarChart2, ClipboardList } from 'lucide-react';
import Link from 'next/link';
import { useTranslations } from 'next-intl';
import { trpc } from '@/lib/trpc/client';
@@ -275,6 +275,13 @@ export function MaintenanceQueue() {
</h1>
</div>
<div className="flex items-center gap-2 text-sm">
<Link
href="/quality"
className="flex items-center gap-1.5 rounded-full bg-muted px-3 py-1 text-xs font-medium text-muted-foreground hover:bg-accent"
>
<ClipboardList className="h-3 w-3" />
{t('qualityLink')}
</Link>
<Link
href="/maintenance/report"
className="flex items-center gap-1.5 rounded-full bg-muted px-3 py-1 text-xs font-medium text-muted-foreground hover:bg-accent"
+8 -1
View File
@@ -1,5 +1,12 @@
import { redirect } from 'next/navigation';
import { resolveUser } from '@/lib/auth';
import { MaintenanceQueue } from './maintenance-queue';
export default function MaintenancePage() {
export default async function MaintenancePage() {
// QCP users have no business in the maintenance queue (and the queue
// procedure would 403 them) — send them to their quality console.
const user = await resolveUser();
if (user?.role === 'QUALITY') redirect('/quality');
return <MaintenanceQueue />;
}