fix(reports): remove truncation cap in range collectors to avoid dropped records
feat(calendar): migrate to react-day-picker v9 and polish UI - Update classNames and CSS import (style.css) - Custom Dropdown via shadcn Select - Nav arrows aligned with caption (around) - Today highlight with cyan tone, weekdays in sentence case - Wider layout to avoid overflow; remove inner wrapper chore(tickets): make 'Patrimônio do computador (se houver)' optional - Backend hotfix to enforce optional + label on existing tenants - Hide required asterisk for this field in portal/new-ticket refactor(new-ticket): remove channel dropdown from admin/agent flow - Keep default channel as MANUAL feat(ux): simplify requester section and enlarge combobox trigger - Remove RequesterPreview redundancy; show company badge in trigger
This commit is contained in:
parent
e0ef66555d
commit
a8333c010f
28 changed files with 1752 additions and 455 deletions
|
|
@ -1091,14 +1091,19 @@ export const getById = query({
|
|||
|
||||
export const listAlerts = query({
|
||||
args: {
|
||||
machineId: v.id("machines"),
|
||||
machineId: v.optional(v.id("machines")),
|
||||
deviceId: v.optional(v.id("machines")),
|
||||
limit: v.optional(v.number()),
|
||||
},
|
||||
handler: async (ctx, args) => {
|
||||
const machineId = args.machineId ?? args.deviceId
|
||||
if (!machineId) {
|
||||
throw new ConvexError("Identificador do dispositivo não informado")
|
||||
}
|
||||
const limit = Math.max(1, Math.min(args.limit ?? 50, 200))
|
||||
const alerts = await ctx.db
|
||||
.query("machineAlerts")
|
||||
.withIndex("by_machine_created", (q) => q.eq("machineId", args.machineId))
|
||||
.withIndex("by_machine_created", (q) => q.eq("machineId", machineId))
|
||||
.order("desc")
|
||||
.take(limit)
|
||||
|
||||
|
|
@ -1117,10 +1122,15 @@ export const listAlerts = query({
|
|||
|
||||
export const listOpenTickets = query({
|
||||
args: {
|
||||
machineId: v.id("machines"),
|
||||
machineId: v.optional(v.id("machines")),
|
||||
deviceId: v.optional(v.id("machines")),
|
||||
limit: v.optional(v.number()),
|
||||
},
|
||||
handler: async (ctx, { machineId, limit }) => {
|
||||
handler: async (ctx, { machineId: providedMachineId, deviceId, limit }) => {
|
||||
const machineId = providedMachineId ?? deviceId
|
||||
if (!machineId) {
|
||||
throw new ConvexError("Identificador do dispositivo não informado")
|
||||
}
|
||||
const machine = await ctx.db.get(machineId)
|
||||
if (!machine) {
|
||||
return { totalOpen: 0, hasMore: false, tickets: [] }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue