diff --git a/src/components/tickets/delete-ticket-dialog.tsx b/src/components/tickets/delete-ticket-dialog.tsx index 9e0d2ce..4625816 100644 --- a/src/components/tickets/delete-ticket-dialog.tsx +++ b/src/components/tickets/delete-ticket-dialog.tsx @@ -48,9 +48,9 @@ export function DeleteTicketDialog({ ticketId }: { ticketId: Id<"tickets"> }) { diff --git a/src/components/tickets/ticket-summary-header.tsx b/src/components/tickets/ticket-summary-header.tsx index f09440b..56bfd20 100644 --- a/src/components/tickets/ticket-summary-header.tsx +++ b/src/components/tickets/ticket-summary-header.tsx @@ -3,7 +3,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react" import { format, formatDistanceToNow } from "date-fns" import { ptBR } from "date-fns/locale" -import { IconClock, IconDownload, IconInfoCircle, IconPlayerPause, IconPlayerPlay } from "@tabler/icons-react" +import { IconClock, IconDownload, IconInfoCircle, IconPlayerPause, IconPlayerPlay, IconPencil } from "@tabler/icons-react" import { useMutation, useQuery } from "convex/react" import { toast } from "sonner" import { api } from "@/convex/_generated/api" @@ -617,10 +617,16 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) { return (
-
+
{!editing ? ( - ) : null} {workSummary ? ( -
- - Tempo total: {formattedTotalWorked} - - - - - - -
- Horas internas: {formatDuration(internalWorkedMs)} - Horas externas: {formatDuration(externalWorkedMs)} -
-
-
-
+ + + + Tempo total: {formattedTotalWorked} + + + +
+ Horas internas: {formatDuration(internalWorkedMs)} + Horas externas: {formatDuration(externalWorkedMs)} +
+
+
) : null} } />
diff --git a/src/components/tickets/tickets-view.tsx b/src/components/tickets/tickets-view.tsx index 90048c2..45b7cde 100644 --- a/src/components/tickets/tickets-view.tsx +++ b/src/components/tickets/tickets-view.tsx @@ -1,6 +1,7 @@ "use client" import { useEffect, useMemo, useState } from "react" +import { toast } from "sonner" import { useQuery } from "convex/react" import { api } from "@/convex/_generated/api" import type { Id } from "@/convex/_generated/dataModel" @@ -96,6 +97,7 @@ export function TicketsView({ initialFilters }: TicketsViewProps = {}) { try { const key = `tickets:filters:${tenantId}:${String(convexUserId)}` localStorage.setItem(key, JSON.stringify(filters)) + toast.success("Filtro salvo como padrão") } catch { // ignore } @@ -106,6 +108,7 @@ export function TicketsView({ initialFilters }: TicketsViewProps = {}) { try { const key = `tickets:filters:${tenantId}:${String(convexUserId)}` localStorage.removeItem(key) + toast.success("Padrão de filtro limpo") } catch { // ignore } diff --git a/src/lib/mappers/ticket.ts b/src/lib/mappers/ticket.ts index 754d153..b7c251d 100644 --- a/src/lib/mappers/ticket.ts +++ b/src/lib/mappers/ticket.ts @@ -42,6 +42,10 @@ const serverTicketSchema = z.object({ queue: z.string().nullable(), requester: serverUserSchema, assignee: serverUserSchema.nullable(), + company: z + .object({ id: z.string(), name: z.string(), isAvulso: z.boolean().optional() }) + .optional() + .nullable(), slaPolicy: z.any().nullable().optional(), dueAt: z.number().nullable().optional(), firstResponseAt: z.number().nullable().optional(), @@ -131,6 +135,9 @@ export function mapTicketFromServer(input: unknown) { const ui = { ...s, status: normalizeTicketStatus(s.status), + company: s.company + ? { id: s.company.id, name: s.company.name, isAvulso: s.company.isAvulso ?? false } + : undefined, category: s.category ?? undefined, subcategory: s.subcategory ?? undefined, lastTimelineEntry: s.lastTimelineEntry ?? undefined,