From a4144dd39e0284d0582100832a074861680f86fe Mon Sep 17 00:00:00 2001 From: esdrasrenan Date: Sat, 13 Dec 2025 23:49:38 -0300 Subject: [PATCH] feat(automations): redesign da acao de enviar e-mail com UX melhorada MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Cria componente EmailActionConfig dedicado para configuracao de e-mail - Layout expandido (full-width) para melhor aproveitamento do espaco - Variaveis como badges clicaveis que inserem no campo ativo - Editor TipTap para mensagem com suporte a variaveis inline - Autocomplete de variaveis ao digitar {{ - Organizacao visual melhorada com secoes claras 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../automations/automation-editor-dialog.tsx | 156 +---- .../automations/email-action-config.tsx | 614 ++++++++++++++++++ 2 files changed, 630 insertions(+), 140 deletions(-) create mode 100644 src/components/automations/email-action-config.tsx diff --git a/src/components/automations/automation-editor-dialog.tsx b/src/components/automations/automation-editor-dialog.tsx index 383f2bf..0c03a39 100644 --- a/src/components/automations/automation-editor-dialog.tsx +++ b/src/components/automations/automation-editor-dialog.tsx @@ -19,6 +19,7 @@ import { Select, SelectContent, SelectEmptyState, SelectItem, SelectTrigger, Sel import { Separator } from "@/components/ui/separator" import { Switch } from "@/components/ui/switch" import { Textarea } from "@/components/ui/textarea" +import { EmailActionConfig } from "@/components/automations/email-action-config" type AutomationRow = { id: Id<"ticketAutomations"> @@ -848,7 +849,19 @@ export function AutomationEditorDialog({
- {actions.map((a) => ( + {actions.map((a) => + a.type === "SEND_EMAIL" ? ( +
+ + setActions((prev) => prev.map((item) => (item.id === a.id ? updated : item))) + } + onRemove={() => handleRemoveAction(a.id)} + agents={(agents ?? []).map((u) => ({ _id: String(u._id), name: u.name }))} + /> +
+ ) : (
@@ -1043,144 +1056,6 @@ export function AutomationEditorDialog({ )} - ) : a.type === "SEND_EMAIL" ? ( -
-
- - - setActions((prev) => prev.map((item) => (item.id === a.id ? { ...item, subject: e.target.value } : item))) - } - placeholder="Ex.: Atualização do chamado #{{ticket.reference}}" - /> -
-
- -