feat(tickets): adiciona menu dedicado para Visitas na sidebar
All checks were successful
All checks were successful
- Adiciona item "Visitas" no submenu de Tickets com icone MapPin - Cria pagina /tickets/visits que filtra apenas tickets da fila Visitas - Corrige teste de automacao para usar emailProps ao inves de html 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b8170d0225
commit
0a36ed049f
4 changed files with 52 additions and 1 deletions
7
src/app/tickets/visits/page.tsx
Normal file
7
src/app/tickets/visits/page.tsx
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
import { TicketsVisitsPageClient } from "./tickets-visits-page-client"
|
||||||
|
import { requireAuthenticatedSession } from "@/lib/auth-server"
|
||||||
|
|
||||||
|
export default async function TicketsVisitsPage() {
|
||||||
|
await requireAuthenticatedSession()
|
||||||
|
return <TicketsVisitsPageClient />
|
||||||
|
}
|
||||||
31
src/app/tickets/visits/tickets-visits-page-client.tsx
Normal file
31
src/app/tickets/visits/tickets-visits-page-client.tsx
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
"use client"
|
||||||
|
|
||||||
|
import dynamic from "next/dynamic"
|
||||||
|
|
||||||
|
import { AppShell } from "@/components/app-shell"
|
||||||
|
import { SiteHeader } from "@/components/site-header"
|
||||||
|
|
||||||
|
const TicketsView = dynamic(
|
||||||
|
() =>
|
||||||
|
import("@/components/tickets/tickets-view").then((module) => ({
|
||||||
|
default: module.TicketsView,
|
||||||
|
})),
|
||||||
|
{ ssr: false }
|
||||||
|
)
|
||||||
|
|
||||||
|
export function TicketsVisitsPageClient() {
|
||||||
|
return (
|
||||||
|
<AppShell
|
||||||
|
header={
|
||||||
|
<SiteHeader
|
||||||
|
title="Visitas"
|
||||||
|
lead="Chamados agendados para visitas in loco. Pesquise ou filtre por empresa, responsável e status."
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className="flex flex-col gap-6">
|
||||||
|
<TicketsView initialFilters={{ focusVisits: true }} />
|
||||||
|
</div>
|
||||||
|
</AppShell>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -14,6 +14,7 @@ import {
|
||||||
Layers3,
|
Layers3,
|
||||||
LayoutTemplate,
|
LayoutTemplate,
|
||||||
LifeBuoy,
|
LifeBuoy,
|
||||||
|
MapPin,
|
||||||
MonitorCog,
|
MonitorCog,
|
||||||
Package,
|
Package,
|
||||||
PlayCircle,
|
PlayCircle,
|
||||||
|
|
@ -81,6 +82,7 @@ const navigation: NavigationGroup[] = [
|
||||||
requiredRole: "staff",
|
requiredRole: "staff",
|
||||||
children: [
|
children: [
|
||||||
{ title: "Todos os tickets", url: "/tickets", icon: ClipboardList, requiredRole: "staff" },
|
{ title: "Todos os tickets", url: "/tickets", icon: ClipboardList, requiredRole: "staff" },
|
||||||
|
{ title: "Visitas", url: "/tickets/visits", icon: MapPin, requiredRole: "staff" },
|
||||||
{ title: "Resolvidos", url: "/tickets/resolved", icon: ShieldCheck, requiredRole: "staff" },
|
{ title: "Resolvidos", url: "/tickets/resolved", icon: ShieldCheck, requiredRole: "staff" },
|
||||||
{ title: "Modo Play", url: "/play", icon: PlayCircle, requiredRole: "staff" },
|
{ title: "Modo Play", url: "/play", icon: PlayCircle, requiredRole: "staff" },
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,18 @@ describe("automations.runTicketAutomationsForEvent", () => {
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
to: ["cliente@empresa.com"],
|
to: ["cliente@empresa.com"],
|
||||||
subject: "Atualização do chamado #123",
|
subject: "Atualização do chamado #123",
|
||||||
html: expect.any(String),
|
emailProps: expect.objectContaining({
|
||||||
|
title: "Atualização do chamado #123",
|
||||||
|
message: "Olá Renan, recebemos seu chamado: Teste de automação",
|
||||||
|
ticket: expect.objectContaining({
|
||||||
|
reference: 123,
|
||||||
|
subject: "Teste de automação",
|
||||||
|
status: "PENDING",
|
||||||
|
priority: "MEDIUM",
|
||||||
|
requesterName: "Renan",
|
||||||
|
}),
|
||||||
|
ctaLabel: "Abrir chamado",
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue