style: rename support queues and align category badges
This commit is contained in:
parent
fcac720f83
commit
dee31117d3
5 changed files with 23 additions and 28 deletions
|
|
@ -10,8 +10,8 @@ export const ensureDefaults = mutation({
|
||||||
.collect();
|
.collect();
|
||||||
if (existing.length === 0) {
|
if (existing.length === 0) {
|
||||||
const queues = [
|
const queues = [
|
||||||
{ name: "Suporte N1", slug: "suporte-n1" },
|
{ name: "Chamados", slug: "chamados" },
|
||||||
{ name: "Suporte N2", slug: "suporte-n2" },
|
{ name: "Laboratório", slug: "laboratorio" },
|
||||||
{ name: "Field Services", slug: "field-services" },
|
{ name: "Field Services", slug: "field-services" },
|
||||||
];
|
];
|
||||||
for (const q of queues) {
|
for (const q of queues) {
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ export const seedDemo = mutation({
|
||||||
? existingQueues
|
? existingQueues
|
||||||
: await Promise.all(
|
: await Promise.all(
|
||||||
[
|
[
|
||||||
{ name: "Suporte N1", slug: "suporte-n1" },
|
{ name: "Chamados", slug: "chamados" },
|
||||||
{ name: "Suporte N2", slug: "suporte-n2" },
|
{ name: "Laboratório", slug: "laboratorio" },
|
||||||
].map((q) => ctx.db.insert("queues", { tenantId, name: q.name, slug: q.slug, teamId: undefined }))
|
].map((q) => ctx.db.insert("queues", { tenantId, name: q.name, slug: q.slug, teamId: undefined }))
|
||||||
).then((ids) => Promise.all(ids.map((id) => ctx.db.get(id))))
|
).then((ids) => Promise.all(ids.map((id) => ctx.db.get(id))))
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ const channelLabel: Record<string, string> = {
|
||||||
const cellClass = "px-6 py-5 align-top text-sm text-neutral-700 first:pl-8 last:pr-8"
|
const cellClass = "px-6 py-5 align-top text-sm text-neutral-700 first:pl-8 last:pr-8"
|
||||||
const queueBadgeClass = "inline-flex items-center rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-xs font-semibold text-neutral-700"
|
const queueBadgeClass = "inline-flex items-center rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-xs font-semibold text-neutral-700"
|
||||||
const channelBadgeClass = "inline-flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-xs font-semibold text-neutral-700"
|
const channelBadgeClass = "inline-flex items-center gap-2 rounded-full border border-slate-200 bg-slate-50 px-3 py-1 text-xs font-semibold text-neutral-700"
|
||||||
const tagBadgeClass = "inline-flex items-center rounded-full border border-slate-200 bg-slate-50 px-2.5 py-0.5 text-[11px] font-medium text-neutral-600"
|
|
||||||
const categoryBadgeClass = "inline-flex items-center gap-1 rounded-full border border-[#00e8ff]/50 bg-[#00e8ff]/10 px-2.5 py-0.5 text-[11px] font-semibold text-[#02414d]"
|
const categoryBadgeClass = "inline-flex items-center gap-1 rounded-full border border-[#00e8ff]/50 bg-[#00e8ff]/10 px-2.5 py-0.5 text-[11px] font-semibold text-[#02414d]"
|
||||||
const tableRowClass = "group border-b border-slate-100 text-sm transition-colors hover:bg-slate-100/70 last:border-none"
|
const tableRowClass = "group border-b border-slate-100 text-sm transition-colors hover:bg-slate-100/70 last:border-none"
|
||||||
|
|
||||||
|
|
@ -170,17 +169,13 @@ export function TicketsTable({ tickets = ticketsMock }: TicketsTableProps) {
|
||||||
</span>
|
</span>
|
||||||
<div className="flex flex-wrap items-center gap-2 text-xs text-neutral-500">
|
<div className="flex flex-wrap items-center gap-2 text-xs text-neutral-500">
|
||||||
<span className="font-semibold text-neutral-700">{ticket.requester.name}</span>
|
<span className="font-semibold text-neutral-700">{ticket.requester.name}</span>
|
||||||
{ticket.category ? (
|
<Badge
|
||||||
<Badge className={categoryBadgeClass}>
|
className={categoryBadgeClass}
|
||||||
{ticket.category.name}
|
>
|
||||||
{ticket.subcategory ? ` • ${ticket.subcategory.name}` : ""}
|
{ticket.category
|
||||||
|
? `${ticket.category.name}${ticket.subcategory ? ` • ${ticket.subcategory.name}` : ""}`
|
||||||
|
: "Sem categoria"}
|
||||||
</Badge>
|
</Badge>
|
||||||
) : null}
|
|
||||||
{ticket.tags?.map((tag) => (
|
|
||||||
<Badge key={tag} className={tagBadgeClass}>
|
|
||||||
{tag}
|
|
||||||
</Badge>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ describe("ticket mappers", () => {
|
||||||
status: "OPEN",
|
status: "OPEN",
|
||||||
priority: "MEDIUM",
|
priority: "MEDIUM",
|
||||||
channel: "EMAIL",
|
channel: "EMAIL",
|
||||||
queue: "Suporte N1",
|
queue: "Chamados",
|
||||||
requester: { id: "u1", name: "Ana", email: "a@a.com", teams: [] },
|
requester: { id: "u1", name: "Ana", email: "a@a.com", teams: [] },
|
||||||
assignee: { id: "u2", name: "Bruno", email: "b@b.com", teams: [] },
|
assignee: { id: "u2", name: "Bruno", email: "b@b.com", teams: [] },
|
||||||
updatedAt: now,
|
updatedAt: now,
|
||||||
|
|
|
||||||
|
|
@ -22,21 +22,21 @@ const users: Record<string, UserRecord> = {
|
||||||
name: "Ana Souza",
|
name: "Ana Souza",
|
||||||
email: "ana.souza@example.com",
|
email: "ana.souza@example.com",
|
||||||
avatarUrl: "https://avatar.vercel.sh/ana",
|
avatarUrl: "https://avatar.vercel.sh/ana",
|
||||||
teams: ["Suporte N1"],
|
teams: ["Chamados"],
|
||||||
},
|
},
|
||||||
bruno: {
|
bruno: {
|
||||||
id: "user-bruno",
|
id: "user-bruno",
|
||||||
name: "Bruno Lima",
|
name: "Bruno Lima",
|
||||||
email: "bruno.lima@example.com",
|
email: "bruno.lima@example.com",
|
||||||
avatarUrl: "https://avatar.vercel.sh/bruno",
|
avatarUrl: "https://avatar.vercel.sh/bruno",
|
||||||
teams: ["Suporte N1"],
|
teams: ["Chamados"],
|
||||||
},
|
},
|
||||||
carla: {
|
carla: {
|
||||||
id: "user-carla",
|
id: "user-carla",
|
||||||
name: "Carla Menezes",
|
name: "Carla Menezes",
|
||||||
email: "carla.menezes@example.com",
|
email: "carla.menezes@example.com",
|
||||||
avatarUrl: "https://avatar.vercel.sh/carla",
|
avatarUrl: "https://avatar.vercel.sh/carla",
|
||||||
teams: ["Suporte N2"],
|
teams: ["Laboratório"],
|
||||||
},
|
},
|
||||||
diego: {
|
diego: {
|
||||||
id: "user-diego",
|
id: "user-diego",
|
||||||
|
|
@ -55,8 +55,8 @@ const users: Record<string, UserRecord> = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const queues = [
|
const queues = [
|
||||||
{ id: "queue-suporte-n1", name: "Suporte N1", pending: 18, waiting: 4, breached: 2 },
|
{ id: "queue-chamados", name: "Chamados", pending: 18, waiting: 4, breached: 2 },
|
||||||
{ id: "queue-suporte-n2", name: "Suporte N2", pending: 9, waiting: 3, breached: 1 },
|
{ id: "queue-laboratorio", name: "Laboratório", pending: 9, waiting: 3, breached: 1 },
|
||||||
{ id: "queue-field", name: "Field Services", pending: 5, waiting: 2, breached: 0 },
|
{ id: "queue-field", name: "Field Services", pending: 5, waiting: 2, breached: 0 },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -70,7 +70,7 @@ const baseTickets = [
|
||||||
status: ticketStatusSchema.enum.OPEN,
|
status: ticketStatusSchema.enum.OPEN,
|
||||||
priority: ticketPrioritySchema.enum.URGENT,
|
priority: ticketPrioritySchema.enum.URGENT,
|
||||||
channel: ticketChannelSchema.enum.EMAIL,
|
channel: ticketChannelSchema.enum.EMAIL,
|
||||||
queue: "Suporte N1",
|
queue: "Chamados",
|
||||||
requester: users.eduarda,
|
requester: users.eduarda,
|
||||||
assignee: users.ana,
|
assignee: users.ana,
|
||||||
slaPolicy: {
|
slaPolicy: {
|
||||||
|
|
@ -100,7 +100,7 @@ const baseTickets = [
|
||||||
status: ticketStatusSchema.enum.PENDING,
|
status: ticketStatusSchema.enum.PENDING,
|
||||||
priority: ticketPrioritySchema.enum.HIGH,
|
priority: ticketPrioritySchema.enum.HIGH,
|
||||||
channel: ticketChannelSchema.enum.WHATSAPP,
|
channel: ticketChannelSchema.enum.WHATSAPP,
|
||||||
queue: "Suporte N2",
|
queue: "Laboratório",
|
||||||
requester: users.eduarda,
|
requester: users.eduarda,
|
||||||
assignee: users.carla,
|
assignee: users.carla,
|
||||||
slaPolicy: {
|
slaPolicy: {
|
||||||
|
|
@ -151,7 +151,7 @@ const baseTickets = [
|
||||||
status: ticketStatusSchema.enum.ON_HOLD,
|
status: ticketStatusSchema.enum.ON_HOLD,
|
||||||
priority: ticketPrioritySchema.enum.HIGH,
|
priority: ticketPrioritySchema.enum.HIGH,
|
||||||
channel: ticketChannelSchema.enum.CHAT,
|
channel: ticketChannelSchema.enum.CHAT,
|
||||||
queue: "Suporte N2",
|
queue: "Laboratório",
|
||||||
requester: users.eduarda,
|
requester: users.eduarda,
|
||||||
assignee: users.carla,
|
assignee: users.carla,
|
||||||
slaPolicy: {
|
slaPolicy: {
|
||||||
|
|
@ -181,7 +181,7 @@ const baseTickets = [
|
||||||
status: ticketStatusSchema.enum.RESOLVED,
|
status: ticketStatusSchema.enum.RESOLVED,
|
||||||
priority: ticketPrioritySchema.enum.MEDIUM,
|
priority: ticketPrioritySchema.enum.MEDIUM,
|
||||||
channel: ticketChannelSchema.enum.EMAIL,
|
channel: ticketChannelSchema.enum.EMAIL,
|
||||||
queue: "Suporte N1",
|
queue: "Chamados",
|
||||||
requester: users.eduarda,
|
requester: users.eduarda,
|
||||||
assignee: users.bruno,
|
assignee: users.bruno,
|
||||||
slaPolicy: {
|
slaPolicy: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue