MY QUALITY - First iteration
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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 />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user