feat: improve reports filters and ticket flows
This commit is contained in:
parent
9c74e10675
commit
15d11b6b12
29 changed files with 437 additions and 140 deletions
|
|
@ -104,7 +104,6 @@ const NO_COMPANY_VALUE = "__no_company__"
|
|||
|
||||
const schema = z.object({
|
||||
subject: z.string().default(""),
|
||||
summary: z.string().optional(),
|
||||
description: z.string().default(""),
|
||||
priority: z.enum(["LOW", "MEDIUM", "HIGH", "URGENT"]).default("MEDIUM"),
|
||||
channel: z.enum(["EMAIL", "WHATSAPP", "CHAT", "PHONE", "API", "MANUAL"]).default("MANUAL"),
|
||||
|
|
@ -131,7 +130,6 @@ export function NewTicketDialog({
|
|||
resolver: zodResolver(schema),
|
||||
defaultValues: {
|
||||
subject: "",
|
||||
summary: "",
|
||||
description: "",
|
||||
priority: "MEDIUM",
|
||||
channel: "MANUAL",
|
||||
|
|
@ -551,7 +549,6 @@ export function NewTicketDialog({
|
|||
actorId: convexUserId as Id<"users">,
|
||||
tenantId: DEFAULT_TENANT_ID,
|
||||
subject: subjectTrimmed,
|
||||
summary: values.summary?.trim() || undefined,
|
||||
priority: values.priority,
|
||||
channel: values.channel,
|
||||
queueId: sel?.id as Id<"queues"> | undefined,
|
||||
|
|
@ -563,8 +560,8 @@ export function NewTicketDialog({
|
|||
customFields: customFieldsPayload.length > 0 ? customFieldsPayload : undefined,
|
||||
visitDate: visitDateTimestamp,
|
||||
})
|
||||
const summaryFallback = values.summary?.trim() ?? ""
|
||||
const bodyHtml = plainDescription.length > 0 ? sanitizedDescription : summaryFallback
|
||||
const summaryFallback = subjectTrimmed
|
||||
const bodyHtml = plainDescription.length > 0 ? sanitizedDescription : toHtml(summaryFallback)
|
||||
const MAX_COMMENT_CHARS = 20000
|
||||
const plainForLimit = (plainDescription.length > 0 ? plainDescription : summaryFallback).trim()
|
||||
if (plainForLimit.length > MAX_COMMENT_CHARS) {
|
||||
|
|
@ -585,7 +582,6 @@ export function NewTicketDialog({
|
|||
setOpen(false)
|
||||
form.reset({
|
||||
subject: "",
|
||||
summary: "",
|
||||
description: "",
|
||||
priority: "MEDIUM",
|
||||
channel: "MANUAL",
|
||||
|
|
@ -704,21 +700,6 @@ export function NewTicketDialog({
|
|||
<Input id="subject" {...form.register("subject")} placeholder="Ex.: Erro 500 no portal" />
|
||||
<FieldError errors={form.formState.errors.subject ? [{ message: form.formState.errors.subject.message }] : []} />
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel htmlFor="summary">Resumo</FieldLabel>
|
||||
<textarea
|
||||
id="summary"
|
||||
className="min-h-[96px] w-full resize-none overflow-hidden rounded-lg border border-slate-300 bg-background p-3 text-sm shadow-sm focus-visible:border-[#00d6eb] focus-visible:outline-none"
|
||||
maxLength={600}
|
||||
{...form.register("summary")}
|
||||
placeholder="Explique em poucas linhas o contexto do chamado."
|
||||
onInput={(e) => {
|
||||
const el = e.currentTarget
|
||||
el.style.height = 'auto'
|
||||
el.style.height = `${el.scrollHeight}px`
|
||||
}}
|
||||
/>
|
||||
</Field>
|
||||
<Field>
|
||||
<FieldLabel className="flex items-center gap-1">
|
||||
Descrição <span className="text-destructive">*</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue