From c954f0fab448e762a37259b681f74c13f111940d Mon Sep 17 00:00:00 2001 From: Rodribm10 Date: Sat, 2 May 2026 22:04:14 -0300 Subject: [PATCH] feat(profile): UI pra ligar/desligar alerta de conversa parada MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nova seção em Configurações → Perfil "Alerta de conversa parada" com: - Checkbox principal "Ativar alerta de conversa parada" (OFF salva ui_settings.aggressive_alert_inbox_ids = []). - Sub-checkbox "Aplicar em todas as caixas" (ON salva null = todas). - Lista de inboxes (visível quando não é "todas") pra selecionar caso por caso (salva [id, id, ...]). - Persiste a cada change via updateUISettings (sem botão "salvar"). Antes só dava pra mexer via Rails runner. Cada admin agora controla sozinho sem mexer em DB. i18n: PROFILE_SETTINGS.FORM.AGGRESSIVE_ALERT_SECTION.* em pt_BR e en. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../dashboard/i18n/locale/en/settings.json | 9 + .../dashboard/i18n/locale/pt_BR/settings.json | 9 + .../profile/AggressiveAlertSettings.vue | 233 ++++++++++++++++++ .../dashboard/settings/profile/Index.vue | 18 ++ 4 files changed, 269 insertions(+) create mode 100644 app/javascript/dashboard/routes/dashboard/settings/profile/AggressiveAlertSettings.vue diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index d4bcc4ce5..061d7ebbf 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -121,6 +121,15 @@ "RESET_SUCCESS": "Access token regenerated successfully", "RESET_ERROR": "Unable to regenerate access token. Please try again" }, + "AGGRESSIVE_ALERT_SECTION": { + "TITLE": "Stalled conversation alert", + "NOTE": "Red banner that appears at the top of the panel when a conversation has been waiting for a reply for 5+ minutes.", + "DESCRIPTION": "Red banner shown when a conversation has no reply for 5+ minutes. Useful to avoid losing customers, but can be intrusive if you don't handle every inbox.", + "ENABLED": "Enable stalled conversation alert", + "APPLY_TO_ALL": "Apply to all inboxes", + "INBOX_HINT": "Pick the inboxes where you want to receive the alert:", + "NO_INBOXES": "No inboxes registered." + }, "AUDIO_NOTIFICATIONS_SECTION": { "TITLE": "Audio Alerts", "NOTE": "Enable audio alerts in dashboard for new messages and conversations.", diff --git a/app/javascript/dashboard/i18n/locale/pt_BR/settings.json b/app/javascript/dashboard/i18n/locale/pt_BR/settings.json index aab1b7116..a14801150 100644 --- a/app/javascript/dashboard/i18n/locale/pt_BR/settings.json +++ b/app/javascript/dashboard/i18n/locale/pt_BR/settings.json @@ -121,6 +121,15 @@ "RESET_SUCCESS": "Token de acesso gerado novamente com sucesso", "RESET_ERROR": "Não foi possível regerar o token de acesso. Por favor, tente novamente" }, + "AGGRESSIVE_ALERT_SECTION": { + "TITLE": "Alerta de conversa parada", + "NOTE": "Banner vermelho que aparece no topo do painel quando uma conversa fica sem resposta há 5+ minutos.", + "DESCRIPTION": "Banner vermelho que aparece quando uma conversa fica sem resposta há 5+ minutos. Útil pra não perder cliente, mas pode ser intrusivo se você não atende todas as inboxes.", + "ENABLED": "Ativar alerta de conversa parada", + "APPLY_TO_ALL": "Aplicar em todas as caixas de entrada", + "INBOX_HINT": "Selecione as caixas onde você quer receber o alerta:", + "NO_INBOXES": "Nenhuma caixa de entrada cadastrada." + }, "AUDIO_NOTIFICATIONS_SECTION": { "TITLE": "Alertas de áudio", "NOTE": "Habilitar notificações de áudio no painel para novas mensagens e conversas.", diff --git a/app/javascript/dashboard/routes/dashboard/settings/profile/AggressiveAlertSettings.vue b/app/javascript/dashboard/routes/dashboard/settings/profile/AggressiveAlertSettings.vue new file mode 100644 index 000000000..c4bb57cf2 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/profile/AggressiveAlertSettings.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/profile/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/profile/Index.vue index 98491800a..ee3751267 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/profile/Index.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/profile/Index.vue @@ -17,6 +17,7 @@ import HotKeyCard from './HotKeyCard.vue'; import ChangePassword from './ChangePassword.vue'; import NotificationPreferences from './NotificationPreferences.vue'; import AudioNotifications from './AudioNotifications.vue'; +import AggressiveAlertSettings from './AggressiveAlertSettings.vue'; import FormSection from 'dashboard/components/FormSection.vue'; import AccessToken from './AccessToken.vue'; import MfaSettingsCard from './MfaSettingsCard.vue'; @@ -40,6 +41,7 @@ export default { ChangePassword, NotificationPreferences, AudioNotifications, + AggressiveAlertSettings, AccessToken, MfaSettingsCard, AggressiveAlertProfileSetting, @@ -336,6 +338,22 @@ export default { + + +