feat(chatwoot): import history messages to chatwoot on whatsapp connection

This commit is contained in:
nestordavalos 2024-02-05 23:56:00 -03:00
parent 529657b5ec
commit b4ccaf0971
7 changed files with 87 additions and 1 deletions

View File

@ -127,6 +127,9 @@ const defaultObj = () => ({
sign_msg: true, sign_msg: true,
reopen_conversation: true, reopen_conversation: true,
conversation_pending: false, conversation_pending: false,
import_contacts: false,
import_messages: false,
days_limit_import_messages: 0, // Set as a number
}); });
export default { export default {

View File

@ -85,7 +85,18 @@
]" ]"
/> />
</div> </div>
</div> <div class="flex-grow-1">
<v-text-field
v-model.number="chatwootData.days_limit_import_messages"
:label="$t('chatwoot.dayslimitimportmessages')"
:disabled="loading"
outlined
dense
hide-details="auto"
class="mb-3"
/>
</div>
</div>
<div class="d-flex align-center gap-4 flex-wrap"> <div class="d-flex align-center gap-4 flex-wrap">
<v-checkbox <v-checkbox
class="flex-grow-0 flex-shrink-0" class="flex-grow-0 flex-shrink-0"
@ -150,6 +161,39 @@
</template> </template>
</v-checkbox> </v-checkbox>
</div> </div>
<div>
<v-checkbox
v-model="chatwootData.import_contacts"
:disabled="loading"
hide-details
class="mb-3"
density="compact"
>
<template v-slot:label>
<span>{{ $t("chatwoot.importcontacts") }}</span>
<HelpTooltip>
{{ $t("chatwoot.importcontactsHelp") }}
</HelpTooltip>
</template>
</v-checkbox>
</div>
<div>
<v-checkbox
v-model="chatwootData.import_messages"
:disabled="loading"
hide-details
class="mb-3"
density="compact"
>
<template v-slot:label>
<span>{{ $t("chatwoot.importmessages") }}</span>
<HelpTooltip>
{{ $t("chatwoot.importmessagesHelp") }}
</HelpTooltip>
</template>
</v-checkbox>
</div>
<div> <div>
<v-checkbox <v-checkbox
@ -217,6 +261,9 @@ const defaultObj = () => ({
reopen_conversation: true, reopen_conversation: true,
conversation_pending: false, conversation_pending: false,
auto_create: undefined, auto_create: undefined,
import_contacts: false,
import_messages: false,
days_limit_import_messages: 0,
}); });
export default { export default {
@ -242,6 +289,9 @@ export default {
sign_delimiter: "\n", sign_delimiter: "\n",
reopen_conversation: true, reopen_conversation: true,
conversation_pending: false, conversation_pending: false,
import_contacts: false,
import_messages: false,
days_limit_import_messages: 0,
}, },
defaultChatwootData: { defaultChatwootData: {
enabled: false, enabled: false,
@ -252,6 +302,9 @@ export default {
sign_delimiter: "\n", sign_delimiter: "\n",
reopen_conversation: true, reopen_conversation: true,
conversation_pending: false, conversation_pending: false,
import_contacts: false,
import_messages: false,
days_limit_import_messages: 0,
}, },
}), }),
methods: { methods: {

View File

@ -81,6 +81,14 @@
hide-details hide-details
density="compact" density="compact"
></v-checkbox> ></v-checkbox>
<v-checkbox
class="flex-grow-0"
v-model="optionsData.sync_full_history"
:disabled="loading"
:label="$t('options.syncfullhistory')"
hide-details
density="compact"
></v-checkbox>
</div> </div>
</v-form> </v-form>
</v-card-text> </v-card-text>
@ -112,6 +120,7 @@ const defaultOptions = () => ({
always_online: false, always_online: false,
read_messages: false, read_messages: false,
read_status: false, read_status: false,
sync_full_history: false,
}); });
export default { export default {
@ -134,6 +143,7 @@ export default {
always_online: false, always_online: false,
read_messages: false, read_messages: false,
read_status: false, read_status: false,
sync_full_history: false,
}, },
defaultOptionsData: { defaultOptionsData: {
reject_call: false, reject_call: false,
@ -142,6 +152,7 @@ export default {
always_online: false, always_online: false,
read_messages: false, read_messages: false,
read_status: false, read_status: false,
sync_full_history: false,
}, },
}), }),

View File

@ -80,6 +80,7 @@ export default {
alwaysOnline: "Always online", alwaysOnline: "Always online",
readMessages: "Mark messages as read", readMessages: "Mark messages as read",
readStatus: "Mark status as seen", readStatus: "Mark status as seen",
syncfullhistory: "sync full history",
}, },
webhook: { webhook: {
byEvents: "Webhook by events", byEvents: "Webhook by events",
@ -91,6 +92,7 @@ export default {
chatwoot: { chatwoot: {
account_id: "Account ID", account_id: "Account ID",
token: "Account Token", token: "Account Token",
dayslimitimportmessages: "Days limit to import messages",
signMsg: "Sign messages", signMsg: "Sign messages",
signMsgHelp: "Adds the agent name at the first line of the message", signMsgHelp: "Adds the agent name at the first line of the message",
signDelimiter: "Signature delimiter", signDelimiter: "Signature delimiter",
@ -101,6 +103,10 @@ export default {
conversationPendingHelp: "Starts the conversation as pending instead of open", conversationPendingHelp: "Starts the conversation as pending instead of open",
autoCreate: "Create Inbox", autoCreate: "Create Inbox",
autoCreateHelp: "Creates the inbox in Chatwoot if it doesn't exist", autoCreateHelp: "Creates the inbox in Chatwoot if it doesn't exist",
importcontacts: "Import contacts",
importcontactsHelp: "Import contacts to Chatwoot",
importmessages: "Import messages",
importmessagesHelp: "Import message history messages to Chatwoot",
config: { config: {
btn: "How to configure Chatwoot?", btn: "How to configure Chatwoot?",
title: "How to configure Chatwoot inbox?", title: "How to configure Chatwoot inbox?",

View File

@ -80,6 +80,7 @@ export default {
alwaysOnline: "Siempre en línea", alwaysOnline: "Siempre en línea",
readMessages: "Marcar mensajes como leídos", readMessages: "Marcar mensajes como leídos",
readStatus: "Marcar estado de lectura", readStatus: "Marcar estado de lectura",
syncfullhistory: "Sincronizar el historial completo",
}, },
webhook: { webhook: {
byEvents: "Webhook por eventos", byEvents: "Webhook por eventos",
@ -91,6 +92,7 @@ export default {
chatwoot: { chatwoot: {
account_id: "ID de Cuenta", account_id: "ID de Cuenta",
token: "Token de Cuenta", token: "Token de Cuenta",
dayslimitimportmessages: "Límite de días para importar mensajes",
signMsg: "Firmar en mensajes", signMsg: "Firmar en mensajes",
signMsgHelp: "Agrega el nombre del agente en la primera línea del mensaje.", signMsgHelp: "Agrega el nombre del agente en la primera línea del mensaje.",
signDelimiter: "Delimitador de firma", signDelimiter: "Delimitador de firma",
@ -101,6 +103,10 @@ export default {
conversationPendingHelp: "Inicia la conversación como pendiente en lugar de abierta", conversationPendingHelp: "Inicia la conversación como pendiente en lugar de abierta",
autoCreate: "Crear bandeja de entrada", autoCreate: "Crear bandeja de entrada",
autoCreateHelp: "Crea la bandeja de entrada en Chatwoot si no existe", autoCreateHelp: "Crea la bandeja de entrada en Chatwoot si no existe",
importcontacts: "Importar contactos",
importcontactsHelp: "Importa contactos a Chatwoot",
importmessages: "Importar mensajes",
importmessagesHelp: "Importa mensajes historioco de mensajes a Chatwoot",
config: { config: {
btn: "Cómo configurar Chatwoot?", btn: "Cómo configurar Chatwoot?",
title: "Cómo configurar la bandeja de entrada de Chatwoot?", title: "Cómo configurar la bandeja de entrada de Chatwoot?",

View File

@ -82,6 +82,7 @@ export default {
alwaysOnline: "Sempre online", alwaysOnline: "Sempre online",
readMessages: "Marcar mensagens como lidas", readMessages: "Marcar mensagens como lidas",
readStatus: "Marcar status como visto", readStatus: "Marcar status como visto",
syncfullhistory: "Sincronizar el historial completo",
}, },
webhook: { webhook: {
byEvents: "Webhook por eventos", byEvents: "Webhook por eventos",
@ -93,6 +94,7 @@ export default {
chatwoot: { chatwoot: {
account_id: "ID da conta", account_id: "ID da conta",
token: "Token da conta", token: "Token da conta",
dayslimitimportmessages: "Limite de dias para importar mensagens",
signMsg: "Assinar mensagens", signMsg: "Assinar mensagens",
signMsgHelp: "Adiciona o nome do atendente na primeira linha da mensagem", signMsgHelp: "Adiciona o nome do atendente na primeira linha da mensagem",
signDelimiter: "Separador da assinatura da mensagem", signDelimiter: "Separador da assinatura da mensagem",
@ -103,6 +105,10 @@ export default {
conversationPendingHelp: "Inicia a conversa como pendente ao invés de aberta", conversationPendingHelp: "Inicia a conversa como pendente ao invés de aberta",
autoCreate: "Criar Caixa de Entrada", autoCreate: "Criar Caixa de Entrada",
autoCreateHelp: "Cria a caixa de entrada no Chatwoot caso ela não exista", autoCreateHelp: "Cria a caixa de entrada no Chatwoot caso ela não exista",
importcontacts: "Importar contatos",
importcontactsHelp: "Importar contatos para o Chatwoot",
importmessages: "Importar mensagens",
importmessagesHelp: "Importar mensagens do histórico de mensagens para o Chatwoot",
config: { config: {
btn: "Como configurar o chatwoot?", btn: "Como configurar o chatwoot?",
title: "Como configurar a caixa de entrada do Chatwoot?", title: "Como configurar a caixa de entrada do Chatwoot?",

View File

@ -52,6 +52,7 @@ export default {
lang_list: [ lang_list: [
{ title: "Português", value: "pt_br" }, { title: "Português", value: "pt_br" },
{ title: "English", value: "en" }, { title: "English", value: "en" },
{ title: "Español", value: "es" },
], ],
DocStore: useDocStore(), DocStore: useDocStore(),
}), }),