diff --git a/web/convex/tickets.ts b/web/convex/tickets.ts index ee7cec6..d2b88aa 100644 --- a/web/convex/tickets.ts +++ b/web/convex/tickets.ts @@ -217,10 +217,11 @@ export const create = mutation({ slaPolicyId: undefined, dueAt: undefined, }); + const requester = await ctx.db.get(args.requesterId); await ctx.db.insert("ticketEvents", { ticketId: id, type: "CREATED", - payload: { requesterId: args.requesterId }, + payload: { requesterId: args.requesterId, requesterName: requester?.name, requesterAvatar: requester?.avatarUrl }, createdAt: now, }); return id; diff --git a/web/src/components/tickets/new-ticket-dialog.tsx b/web/src/components/tickets/new-ticket-dialog.tsx index 60ded3d..0083356 100644 --- a/web/src/components/tickets/new-ticket-dialog.tsx +++ b/web/src/components/tickets/new-ticket-dialog.tsx @@ -125,18 +125,24 @@ export function NewTicketDialog() { - - Fila - - + + Fila + {(() => { + const NONE = "NONE"; + const current = form.watch("queueName") ?? NONE; + return ( + + ) + })()} + diff --git a/web/src/components/tickets/recent-tickets-panel.tsx b/web/src/components/tickets/recent-tickets-panel.tsx index 08e9961..055c952 100644 --- a/web/src/components/tickets/recent-tickets-panel.tsx +++ b/web/src/components/tickets/recent-tickets-panel.tsx @@ -12,8 +12,15 @@ export function RecentTicketsPanel() { const ticketsRaw = useQuery(api.tickets.list, { tenantId: DEFAULT_TENANT_ID, limit: 10 }); if (ticketsRaw === undefined) { return ( -
- Carregando tickets… +
+
+ {Array.from({ length: 4 }).map((_, i) => ( +
+
+
+
+ ))} +
); } diff --git a/web/src/components/tickets/ticket-comments.tsx b/web/src/components/tickets/ticket-comments.tsx index 04d1c31..49f3b0d 100644 --- a/web/src/components/tickets/ticket-comments.tsx +++ b/web/src/components/tickets/ticket-comments.tsx @@ -105,7 +105,7 @@ export function TicketComments({ ticket }: TicketCommentsProps) { {comment.body}
{comment.attachments?.length ? ( -
+
{comment.attachments.map((a) => { const att = a as any const isImg = (att?.url ?? "").match(/\.(png|jpe?g|gif|webp|svg)$/i) diff --git a/web/src/components/tickets/ticket-timeline.tsx b/web/src/components/tickets/ticket-timeline.tsx index 6103932..db69225 100644 --- a/web/src/components/tickets/ticket-timeline.tsx +++ b/web/src/components/tickets/ticket-timeline.tsx @@ -10,7 +10,8 @@ import { import type { TicketWithDetails } from "@/lib/schemas/ticket" import { cn } from "@/lib/utils" -import { Card, CardContent } from "@/components/ui/card" +import { Card, CardContent } from "@/components/ui/card" +import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Separator } from "@/components/ui/separator" const timelineIcons: Record> = { @@ -48,20 +49,32 @@ export function TicketTimeline({ ticket }: TicketTimelineProps) {
-
+
{timelineLabels[entry.type] ?? entry.type} - - {format(entry.createdAt, "dd MMM yyyy HH:mm", { locale: ptBR })} - -
+ {entry.payload?.actorName ? ( + + + + + {entry.payload.actorName.split(' ').slice(0,2).map((p:string)=>p[0]).join('').toUpperCase()} + + + por {entry.payload.actorName} + + ) : null} + + {format(entry.createdAt, "dd MMM yyyy HH:mm", { locale: ptBR })} + +
{(() => { const p: any = entry.payload || {} let message: string | null = null if (entry.type === "STATUS_CHANGED" && (p.toLabel || p.to)) message = `Status alterado para ${p.toLabel || p.to}` if (entry.type === "ASSIGNEE_CHANGED" && (p.assigneeName || p.assigneeId)) message = `Responsável alterado${p.assigneeName ? ` para ${p.assigneeName}` : ""}` if (entry.type === "QUEUE_CHANGED" && (p.queueName || p.queueId)) message = `Fila alterada${p.queueName ? ` para ${p.queueName}` : ""}` + if (entry.type === "CREATED" && (p.requesterName)) message = `Criado por ${p.requesterName}` if (!message) return null return (
diff --git a/web/src/components/tickets/tickets-view.tsx b/web/src/components/tickets/tickets-view.tsx index 74a97b8..59acb36 100644 --- a/web/src/components/tickets/tickets-view.tsx +++ b/web/src/components/tickets/tickets-view.tsx @@ -35,7 +35,16 @@ export function TicketsView() {
q.name)} /> {ticketsRaw === undefined ? ( -
Carregando tickets…
+
+
+ {Array.from({ length: 6 }).map((_, i) => ( +
+
+
+
+ ))} +
+
) : ( )}