Add 'new' status as default, in_transit becomes branch state
New tickets start as 'new' (just created, not yet examined). In Transit is now a branch status off New for school pickups and shipped instruments. Intake means the instrument has been physically received and documented. Status progress bar, labels, filters, and default status all updated. Removed debug logging from file upload endpoint.
This commit is contained in:
@@ -39,6 +39,7 @@ export const Route = createFileRoute('/_authenticated/repairs/$ticketId')({
|
||||
})
|
||||
|
||||
const STATUS_LABELS: Record<string, string> = {
|
||||
new: 'New',
|
||||
in_transit: 'In Transit',
|
||||
intake: 'Intake',
|
||||
diagnosing: 'Diagnosing',
|
||||
@@ -52,7 +53,7 @@ const STATUS_LABELS: Record<string, string> = {
|
||||
cancelled: 'Cancelled',
|
||||
}
|
||||
|
||||
const STATUS_FLOW = ['in_transit', 'intake', 'diagnosing', 'pending_approval', 'approved', 'in_progress', 'ready', 'picked_up']
|
||||
const STATUS_FLOW = ['new', 'intake', 'diagnosing', 'pending_approval', 'approved', 'in_progress', 'ready', 'picked_up']
|
||||
|
||||
const TABS = [
|
||||
{ key: 'details', label: 'Details' },
|
||||
@@ -217,6 +218,11 @@ function RepairTicketDetailPage() {
|
||||
Move to {STATUS_LABELS[nextStatus]}
|
||||
</Button>
|
||||
)}
|
||||
{ticket.status === 'new' && (
|
||||
<Button variant="secondary" onClick={() => statusMutation.mutate('in_transit')} disabled={statusMutation.isPending}>
|
||||
In Transit
|
||||
</Button>
|
||||
)}
|
||||
{ticket.status === 'in_progress' && (
|
||||
<Button variant="secondary" onClick={() => statusMutation.mutate('pending_parts')} disabled={statusMutation.isPending}>
|
||||
Pending Parts
|
||||
@@ -235,7 +241,7 @@ function RepairTicketDetailPage() {
|
||||
</>
|
||||
)}
|
||||
{ticket.status === 'cancelled' && hasPermission('repairs.admin') && (
|
||||
<Button variant="outline" onClick={() => statusMutation.mutate('intake')} disabled={statusMutation.isPending}>
|
||||
<Button variant="outline" onClick={() => statusMutation.mutate('new')} disabled={statusMutation.isPending}>
|
||||
<RotateCcw className="mr-2 h-4 w-4" />Reopen
|
||||
</Button>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user