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
|
|
@ -32,10 +32,44 @@ function formatRelative(timestamp: Date | null | undefined) {
|
|||
|
||||
export function TicketCsatCard({ ticket }: TicketCsatCardProps) {
|
||||
const router = useRouter()
|
||||
const { session, convexUserId, role: authRole } = useAuth()
|
||||
const { session, convexUserId, role: authRole, machineContext } = useAuth()
|
||||
const submitCsat = useMutation(api.tickets.submitCsat)
|
||||
|
||||
const viewerRole = (authRole ?? session?.user.role ?? "").toUpperCase()
|
||||
const deriveViewerRole = () => {
|
||||
const authRoleNormalized = authRole?.toLowerCase()?.trim()
|
||||
const machinePersona = machineContext?.persona ?? session?.user.machinePersona ?? null
|
||||
const assignedRole = machineContext?.assignedUserRole ?? null
|
||||
const sessionRole = session?.user.role?.toLowerCase()?.trim()
|
||||
|
||||
if (authRoleNormalized && authRoleNormalized !== "machine") {
|
||||
return authRoleNormalized.toUpperCase()
|
||||
}
|
||||
|
||||
if (authRoleNormalized === "machine" && machinePersona) {
|
||||
return machinePersona.toUpperCase()
|
||||
}
|
||||
|
||||
if (machinePersona) {
|
||||
return machinePersona.toUpperCase()
|
||||
}
|
||||
|
||||
if (assignedRole) {
|
||||
return assignedRole.toUpperCase()
|
||||
}
|
||||
|
||||
if (sessionRole && sessionRole !== "machine") {
|
||||
return sessionRole.toUpperCase()
|
||||
}
|
||||
|
||||
if (sessionRole === "machine") {
|
||||
return "COLLABORATOR"
|
||||
}
|
||||
|
||||
return "COLLABORATOR"
|
||||
}
|
||||
|
||||
const viewerRole = deriveViewerRole()
|
||||
|
||||
const viewerEmail = session?.user.email?.trim().toLowerCase() ?? ""
|
||||
const viewerId = convexUserId as Id<"users"> | undefined
|
||||
|
||||
|
|
@ -187,6 +221,10 @@ export function TicketCsatCard({ ticket }: TicketCsatCardProps) {
|
|||
</span>
|
||||
{ratedAtRelative ? ` • ${ratedAtRelative}` : null}
|
||||
</p>
|
||||
) : viewerIsStaff ? (
|
||||
<div className="flex items-center gap-2 rounded-lg border border-dashed border-slate-200 bg-slate-50 px-3 py-2 text-xs text-neutral-600">
|
||||
Nenhuma avaliação registrada ainda.
|
||||
</div>
|
||||
) : null}
|
||||
{canSubmit ? (
|
||||
<div className="space-y-2">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue