fix(desktop): corrige tela de desativacao e adiciona botao Verificar novamente
All checks were successful
All checks were successful
- Corrige erro gramatical: "Dispositivo desativada" -> "Dispositivo desativado" - Adiciona botao "Verificar novamente" na tela de desativacao - Adiciona callback onReactivated no MachineStateMonitor - Corrige fundo escuro para cobrir toda a tela quando desativado - Corrige acentuacoes faltantes no historico de automacoes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
70cba99424
commit
a5bab2cc33
4 changed files with 119 additions and 46 deletions
|
|
@ -61,16 +61,16 @@ const ACTION_TYPE_LABELS: Record<string, { label: string; icon: typeof Mail }> =
|
|||
SEND_EMAIL: { label: "Enviar e-mail", icon: Mail },
|
||||
SET_PRIORITY: { label: "Alterar prioridade", icon: ArrowRight },
|
||||
MOVE_QUEUE: { label: "Mover para fila", icon: ArrowRight },
|
||||
ASSIGN_TO: { label: "Atribuir responsavel", icon: UserCheck },
|
||||
ADD_INTERNAL_COMMENT: { label: "Comentario interno", icon: MessageSquare },
|
||||
ASSIGN_TO: { label: "Atribuir responsável", icon: UserCheck },
|
||||
ADD_INTERNAL_COMMENT: { label: "Comentário interno", icon: MessageSquare },
|
||||
APPLY_CHECKLIST_TEMPLATE: { label: "Aplicar checklist", icon: ListChecks },
|
||||
SET_CHAT_ENABLED: { label: "Chat habilitado", icon: ToggleRight },
|
||||
SET_FORM_TEMPLATE: { label: "Aplicar formulario", icon: FileText },
|
||||
SET_FORM_TEMPLATE: { label: "Aplicar formulário", icon: FileText },
|
||||
}
|
||||
|
||||
const PRIORITY_LABELS: Record<string, string> = {
|
||||
LOW: "Baixa",
|
||||
MEDIUM: "Media",
|
||||
MEDIUM: "Média",
|
||||
HIGH: "Alta",
|
||||
URGENT: "Urgente",
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ function ActionDetails({ action }: { action: ActionApplied }) {
|
|||
<div className="space-y-2 text-sm">
|
||||
{details.recipients && Array.isArray(details.recipients) && (
|
||||
<div>
|
||||
<span className="text-slate-500">Destinatarios:</span>
|
||||
<span className="text-slate-500">Destinatários:</span>
|
||||
<div className="mt-1 flex flex-wrap gap-1">
|
||||
{(details.recipients as string[]).map((email, i) => (
|
||||
<Badge key={i} variant="outline" className="text-xs font-mono">
|
||||
|
|
@ -147,14 +147,14 @@ function ActionDetails({ action }: { action: ActionApplied }) {
|
|||
|
||||
{action.type === "ASSIGN_TO" && (
|
||||
<div className="text-sm">
|
||||
<span className="text-slate-500">Responsavel:</span>{" "}
|
||||
<span className="text-slate-500">Responsável:</span>{" "}
|
||||
<span className="text-slate-900 font-medium">{String(details.assigneeName ?? "—")}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{action.type === "SET_FORM_TEMPLATE" && (
|
||||
<div className="text-sm">
|
||||
<span className="text-slate-500">Formulario:</span>{" "}
|
||||
<span className="text-slate-500">Formulário:</span>{" "}
|
||||
<span className="text-slate-900">{String(details.formTemplateLabel ?? details.formTemplate ?? "—")}</span>
|
||||
</div>
|
||||
)}
|
||||
|
|
@ -170,7 +170,7 @@ function ActionDetails({ action }: { action: ActionApplied }) {
|
|||
|
||||
{action.type === "ADD_INTERNAL_COMMENT" && (
|
||||
<div className="text-sm text-slate-600">
|
||||
Comentario interno adicionado ao ticket
|
||||
Comentário interno adicionado ao ticket
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
|
@ -199,7 +199,7 @@ function ExpandedDetails({ run }: { run: AutomationRunRow }) {
|
|||
{run.ticket ? (
|
||||
<div className="text-sm space-y-1">
|
||||
<div>
|
||||
<span className="text-slate-500">Referencia:</span>{" "}
|
||||
<span className="text-slate-500">Referência:</span>{" "}
|
||||
<span className="font-mono font-semibold">#{run.ticket.reference}</span>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -208,22 +208,22 @@ function ExpandedDetails({ run }: { run: AutomationRunRow }) {
|
|||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-sm text-slate-400">Ticket nao disponivel</p>
|
||||
<p className="text-sm text-slate-400">Ticket não disponível</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Info da Execucao */}
|
||||
{/* Info da Execução */}
|
||||
<div className="space-y-2">
|
||||
<h4 className="text-xs font-semibold uppercase tracking-wide text-slate-500">Execucao</h4>
|
||||
<h4 className="text-xs font-semibold uppercase tracking-wide text-slate-500">Execução</h4>
|
||||
<div className="text-sm space-y-1">
|
||||
<div>
|
||||
<span className="text-slate-500">Evento:</span>{" "}
|
||||
<span className="text-slate-900">{EVENT_LABELS[run.eventType] ?? run.eventType}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span className="text-slate-500">Condicoes:</span>{" "}
|
||||
<span className="text-slate-500">Condições:</span>{" "}
|
||||
<Badge variant={run.matched ? "secondary" : "outline"}>
|
||||
{run.matched ? "Atendidas" : "Nao atendidas"}
|
||||
{run.matched ? "Atendidas" : "Não atendidas"}
|
||||
</Badge>
|
||||
</div>
|
||||
{run.error && (
|
||||
|
|
@ -236,11 +236,11 @@ function ExpandedDetails({ run }: { run: AutomationRunRow }) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{/* Acoes Aplicadas */}
|
||||
{/* Ações Aplicadas */}
|
||||
{hasActions && (
|
||||
<div className="mt-4 space-y-2">
|
||||
<h4 className="text-xs font-semibold uppercase tracking-wide text-slate-500">
|
||||
Acoes aplicadas ({run.actionsApplied!.length})
|
||||
Ações aplicadas ({run.actionsApplied!.length})
|
||||
</h4>
|
||||
<div className="grid gap-2 md:grid-cols-2">
|
||||
{run.actionsApplied!.map((action, i) => (
|
||||
|
|
@ -252,7 +252,7 @@ function ExpandedDetails({ run }: { run: AutomationRunRow }) {
|
|||
|
||||
{!hasActions && run.status === "SUCCESS" && (
|
||||
<div className="mt-4">
|
||||
<p className="text-sm text-slate-500">Nenhuma acao foi aplicada nesta execucao.</p>
|
||||
<p className="text-sm text-slate-500">Nenhuma ação foi aplicada nesta execução.</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -389,7 +389,7 @@ export function AutomationRunsDialog({
|
|||
const eventLabel = EVENT_LABELS[run.eventType] ?? run.eventType
|
||||
const actionsCount = run.actionsApplied?.length ?? 0
|
||||
const actionsLabel =
|
||||
actionsCount === 1 ? "Aplicou 1 acao" : `Aplicou ${actionsCount} acoes`
|
||||
actionsCount === 1 ? "Aplicou 1 ação" : `Aplicou ${actionsCount} ações`
|
||||
const createdAtLabel = formatDateTime(run.createdAt)
|
||||
const details =
|
||||
run.status === "ERROR"
|
||||
|
|
@ -397,10 +397,10 @@ export function AutomationRunsDialog({
|
|||
: run.status === "SKIPPED"
|
||||
? run.matched
|
||||
? "Ignorada"
|
||||
: "Condicoes nao atendidas"
|
||||
: "Condições não atendidas"
|
||||
: actionsCount > 0
|
||||
? actionsLabel
|
||||
: "Sem alteracoes"
|
||||
: "Sem alterações"
|
||||
|
||||
const isExpanded = expandedId === run.id
|
||||
const toggleExpand = () => setExpandedId(isExpanded ? null : run.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue