feat(filters): ticket company filter + column; reports: company filter in CSVs; dashboard: queue summary; docs: agents.md and roadmap updates
This commit is contained in:
parent
70f91f5bbd
commit
2cf399dcb1
9 changed files with 100 additions and 31 deletions
|
|
@ -39,6 +39,14 @@ export function TicketsView() {
|
|||
)
|
||||
|
||||
const tickets = useMemo(() => mapTicketsFromServerList((ticketsRaw ?? []) as unknown[]), [ticketsRaw])
|
||||
const companies = useMemo(() => {
|
||||
const set = new Set<string>()
|
||||
for (const t of tickets) {
|
||||
const name = (t as any).company?.name as string | undefined
|
||||
if (name) set.add(name)
|
||||
}
|
||||
return Array.from(set).sort((a, b) => a.localeCompare(b, "pt-BR"))
|
||||
}, [tickets])
|
||||
|
||||
const filteredTickets = useMemo(() => {
|
||||
const completedStatuses = new Set<Ticket["status"]>(["RESOLVED"])
|
||||
|
|
@ -55,13 +63,16 @@ export function TicketsView() {
|
|||
if (filters.queue) {
|
||||
working = working.filter((t) => t.queue === filters.queue)
|
||||
}
|
||||
if (filters.company) {
|
||||
working = working.filter((t) => ((t as any).company?.name ?? null) === filters.company)
|
||||
}
|
||||
|
||||
return working
|
||||
}, [tickets, filters.queue, filters.status, filters.view])
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-6 px-4 lg:px-6">
|
||||
<TicketsFilters onChange={setFilters} queues={(queues ?? []).map((q) => q.name)} />
|
||||
<TicketsFilters onChange={setFilters} queues={(queues ?? []).map((q) => q.name)} companies={companies} />
|
||||
{ticketsRaw === undefined ? (
|
||||
<div className="rounded-2xl border border-slate-200 bg-white p-4 shadow-sm">
|
||||
<div className="grid gap-3">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue