diff --git a/app/javascript/dashboard/i18n/locale/en/captain.json b/app/javascript/dashboard/i18n/locale/en/captain.json index 6d4ab1547..f499213ab 100644 --- a/app/javascript/dashboard/i18n/locale/en/captain.json +++ b/app/javascript/dashboard/i18n/locale/en/captain.json @@ -423,14 +423,6 @@ "SUCCESS_MESSAGE": "FAQ deleted successfully", "ERROR_MESSAGE": "An error occurred while deleting FAQ, please try again." } - }, - "MEMORY": { - "LOADING": "Loading…", - "EMPTY": "No memories for this contact yet.", - "CONFIRM_DELETE": "Forget this memory?", - "CONFIRM_FORGET_ALL": "Forget ALL memories for this contact? This cannot be undone after 30 days.", - "FORGET": "Forget", - "FORGET_ALL": "Forget all" } }, "CAPTAIN_REPORTS": { diff --git a/app/javascript/dashboard/i18n/locale/en/conversation.json b/app/javascript/dashboard/i18n/locale/en/conversation.json index 63c0f94f8..f382df64a 100644 --- a/app/javascript/dashboard/i18n/locale/en/conversation.json +++ b/app/javascript/dashboard/i18n/locale/en/conversation.json @@ -407,6 +407,28 @@ "PARTIALLY_FULFILLED": "Partially Fulfilled", "UNFULFILLED": "Unfulfilled" } + }, + "CONTACT_MEMORIES": { + "LOADING": "Loading memories…", + "EMPTY_TITLE": "No memories yet", + "EMPTY_HINT": "Memories appear here as the customer chats over time.", + "FORGET": "Forget", + "FORGET_ALL": "Forget all memories", + "CONFIRM_DELETE": "Forget this memory?", + "CONFIRM_FORGET_ALL": "Forget ALL memories for this customer? This cannot be undone after 30 days.", + "ERROR_LOADING": "Failed to load memories", + "CONFIDENCE": "Confidence", + "TYPE_LABELS": { + "preferencia": "Preference", + "data_comemorativa": "Date", + "vinculo_social": "Social", + "padrao_comportamental": "Pattern", + "reclamacao": "Complaint", + "feedback_positivo": "Praise", + "restricao": "Restriction", + "vinculo_comercial": "Commercial", + "contexto_pessoal": "Personal" + } } }, "SCHEDULED_MESSAGES": { diff --git a/app/javascript/dashboard/i18n/locale/pt_BR/captain.json b/app/javascript/dashboard/i18n/locale/pt_BR/captain.json index e3cbc589e..d81cb3180 100644 --- a/app/javascript/dashboard/i18n/locale/pt_BR/captain.json +++ b/app/javascript/dashboard/i18n/locale/pt_BR/captain.json @@ -425,14 +425,6 @@ "SUCCESS_MESSAGE": "FAQ excluída com sucesso", "ERROR_MESSAGE": "Ocorreu um erro ao excluir a FAQ, por favor tente novamente." } - }, - "MEMORY": { - "LOADING": "Carregando…", - "EMPTY": "Sem memórias para este contato ainda.", - "CONFIRM_DELETE": "Esquecer esta memória?", - "CONFIRM_FORGET_ALL": "Esquecer TODAS as memórias deste contato? Após 30 dias não é possível desfazer.", - "FORGET": "Esquecer", - "FORGET_ALL": "Esquecer tudo" } }, "CAPTAIN_REPORTS": { diff --git a/app/javascript/dashboard/i18n/locale/pt_BR/conversation.json b/app/javascript/dashboard/i18n/locale/pt_BR/conversation.json index 28333edc1..7ecee83e1 100644 --- a/app/javascript/dashboard/i18n/locale/pt_BR/conversation.json +++ b/app/javascript/dashboard/i18n/locale/pt_BR/conversation.json @@ -396,6 +396,28 @@ "PARTIALLY_FULFILLED": "Partially Fulfilled", "UNFULFILLED": "Unfulfilled" } + }, + "CONTACT_MEMORIES": { + "LOADING": "Carregando memórias…", + "EMPTY_TITLE": "Nenhuma memória ainda", + "EMPTY_HINT": "Memórias aparecem aqui conforme o cliente conversa.", + "FORGET": "Esquecer", + "FORGET_ALL": "Esquecer todas", + "CONFIRM_DELETE": "Esquecer esta memória?", + "CONFIRM_FORGET_ALL": "Esquecer TODAS as memórias deste cliente? Não pode ser desfeito após 30 dias.", + "ERROR_LOADING": "Falha ao carregar memórias", + "CONFIDENCE": "Confiança", + "TYPE_LABELS": { + "preferencia": "Preferência", + "data_comemorativa": "Data especial", + "vinculo_social": "Vínculo social", + "padrao_comportamental": "Padrão", + "reclamacao": "Reclamação", + "feedback_positivo": "Elogio", + "restricao": "Restrição", + "vinculo_comercial": "Vínculo comercial", + "contexto_pessoal": "Pessoal" + } } }, "SCHEDULED_MESSAGES": { diff --git a/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactMemories.vue b/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactMemories.vue index d93fa0499..6e07680e7 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactMemories.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/contact/ContactMemories.vue @@ -1,65 +1,217 @@ - - {{ t('CAPTAIN.MEMORY.LOADING') }} - {{ error }} - - {{ t('CAPTAIN.MEMORY.EMPTY') }} + + + + - - - {{ m.memory_type }} - {{ m.content }} - {{ Math.round(m.confidence * 100) }}% - - {{ t('CAPTAIN.MEMORY.FORGET') }} - - - - - {{ t('CAPTAIN.MEMORY.FORGET_ALL') }} - + + + + + {{ error }} + + + + + + + + + {{ t('CONVERSATION_SIDEBAR.CONTACT_MEMORIES.EMPTY_TITLE') }} + + + {{ t('CONVERSATION_SIDEBAR.CONTACT_MEMORIES.EMPTY_HINT') }} + + + + + + + + + + {{ typeLabel(memory.memory_type) }} + + + + + + {{ memory.content }} + + + + + + + + + {{ `${Math.round(memory.confidence * 100)}%` }} + + + {{ relativeTime(memory.created_at) }} + + + + + + + +
+ {{ t('CONVERSATION_SIDEBAR.CONTACT_MEMORIES.EMPTY_TITLE') }} +
+ {{ t('CONVERSATION_SIDEBAR.CONTACT_MEMORIES.EMPTY_HINT') }} +
+ {{ memory.content }} +