Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add merge_brazil_contacts and name_inbox option to chatwoot settings #13

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/instance/profile/Privacy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ const defaultObj = () => ({
url: "",
account_id: "",
token: "",
name_inbox: "",
sign_msg: true,
reopen_conversation: true,
conversation_pending: false,
merge_brazil_contacts: false,
import_contacts: false,
import_messages: false,
days_limit_import_messages: 0, // Set as a number
Expand Down
45 changes: 45 additions & 0 deletions src/components/instance/settings/Chatwoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,25 @@
/>
</div>
</div>
<div class="d-flex align-center gap-4 flex-wrap">
<v-text-field
class="flex-grow-1 flex-shrink-0 mb-3"
v-model="chatwootData.name_inbox"
:disabled="
loading ||
!AppStore.versionSatisfies('>=1.7.4')
"
:label="$t('chatwoot.nameInbox')"
:hint="
!AppStore.versionSatisfies('>=1.7.4')
? $t('version.availableFrom', { version: '1.7.4' })
: $t('chatwoot.nameInboxHelp')
"
:persistent-hint="!AppStore.versionSatisfies('>=1.7.4')"
hide-details="auto"
style="min-width: 200px"
></v-text-field>
</div>
<div class="d-flex align-center gap-4 flex-wrap">
<v-checkbox
class="flex-grow-0 flex-shrink-0"
Expand Down Expand Up @@ -231,6 +250,26 @@
</template>
</v-checkbox>
</div>
<div>
<v-checkbox
v-model="chatwootData.merge_brazil_contacts"
:disabled="loading || !AppStore.versionSatisfies('>=1.7.5')"
:hint="
!AppStore.versionSatisfies('>=1.7.5')
? $t('version.availableFrom', { version: '1.7.5' })
: undefined
"
:persistent-hint="!AppStore.versionSatisfies('>=1.7.5')"
hide-details="auto"
class="mb-3"
density="compact"
>
<template v-slot:label>
<span>{{ $t("chatwoot.mergeBrasilianContacts") }}</span>
<HelpTooltip>{{ $t("chatwoot.mergeBrasilianContactsHelp") }}</HelpTooltip>
</template>
</v-checkbox>
</div>
</div>
</v-form>
</v-card-text>
Expand Down Expand Up @@ -272,10 +311,12 @@ const defaultObj = () => ({
url: "",
account_id: "",
token: "",
name_inbox: "",
sign_msg: true,
sign_delimiter: "\n",
reopen_conversation: true,
conversation_pending: false,
merge_brazil_contacts: false,
auto_create: undefined,
import_contacts: false,
import_messages: false,
Expand All @@ -301,10 +342,12 @@ export default {
url: "",
account_id: "",
token: "",
name_inbox: "",
sign_msg: true,
sign_delimiter: "\n",
reopen_conversation: true,
conversation_pending: false,
merge_brazil_contacts: false,
import_contacts: false,
import_messages: false,
days_limit_import_messages: 0,
Expand All @@ -314,10 +357,12 @@ export default {
url: "",
account_id: "",
token: "",
name_inbox: "",
sign_msg: true,
sign_delimiter: "\n",
reopen_conversation: true,
conversation_pending: false,
merge_brazil_contacts: false,
import_contacts: false,
import_messages: false,
days_limit_import_messages: 0,
Expand Down
6 changes: 5 additions & 1 deletion src/i18n/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default {
title: "Phone not connected",
apiGenericError: "Could not load QR Code, if the error persists, restart the API and try again.",
qr: "QR Code",
code: "C�digo",
code: "Código",
deivisonrpg marked this conversation as resolved.
Show resolved Hide resolved
},
options: {
title: "Behavior",
Expand All @@ -97,6 +97,8 @@ export default {
account_id: "Account ID",
token: "Account Token",
dayslimitimportmessages: "Days limit to import messages",
nameInbox: "Inbox name",
nameInboxHelp: "Inbox name to be used in Chatwoot. If not provided, it will default to the session name.",
signMsg: "Sign messages",
signMsgHelp: "Adds the agent name at the first line of the message",
signDelimiter: "Signature delimiter",
Expand All @@ -107,6 +109,8 @@ export default {
conversationPendingHelp: "Starts the conversation as pending instead of open",
autoCreate: "Create Inbox",
autoCreateHelp: "Creates the inbox in Chatwoot if it doesn't exist",
mergeBrasilianContacts: "Merge Brazilian contacts",
mergeBrasilianContactsHelp: "If there are two contacts with the same number, one with the ninth digit and the other without it, they will be merged; valid only for Brazilian numbers.",
importcontacts: "Import contacts",
importcontactsHelp: "Import contacts to Chatwoot",
importmessages: "Import messages",
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ export default {
account_id: "ID de Cuenta",
token: "Token de Cuenta",
dayslimitimportmessages: "Límite de días para importar mensajes",
nameInbox: "Nombre de la bandeja de entrada",
nameInboxHelp: "Nombre de la bandeja de entrada que se utilizará en Chatwoot. Si no se proporciona, será el nombre de la sesión por defecto.",
signMsg: "Firmar en mensajes",
signMsgHelp: "Agrega el nombre del agente en la primera línea del mensaje.",
signDelimiter: "Delimitador de firma",
Expand All @@ -107,6 +109,8 @@ export default {
conversationPendingHelp: "Inicia la conversación como pendiente en lugar de abierta",
autoCreate: "Crear bandeja de entrada",
autoCreateHelp: "Crea la bandeja de entrada en Chatwoot si no existe",
mergeBrasilianContacts: "Unir contactos brasileños",
mergeBrasilianContactsHelp: "Si hay dos contactos con el mismo número, uno con el dígito nueve y otro sin él, se fusionarán; válido únicamente para números brasileños.",
importcontacts: "Importar contactos",
importcontactsHelp: "Importa contactos a Chatwoot",
importmessages: "Importar mensajes",
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ export default {
account_id: "ID da conta",
token: "Token da conta",
dayslimitimportmessages: "Limite de dias para importar mensagens",
nameInbox: "Nome da caixa de entrada",
nameInboxHelp: "Nome da caixa de entrada que será utilizado no Chatwoot. Se não for informado, será o nome da sessão.",
signMsg: "Assinar mensagens",
signMsgHelp: "Adiciona o nome do atendente na primeira linha da mensagem",
signDelimiter: "Separador da assinatura da mensagem",
Expand All @@ -116,6 +118,8 @@ export default {
"Inicia a conversa como pendente ao invés de aberta",
autoCreate: "Criar Caixa de Entrada",
autoCreateHelp: "Cria a caixa de entrada no Chatwoot caso ela não exista",
mergeBrasilianContacts: "Mesclar contatos brasileiros",
mergeBrasilianContactsHelp: "Se houver dois contatos com o mesmo número, sendo um com nono dígito e outro sem, eles serão mesclados; válido apenas para números brasileiros.",
importcontacts: "Importar contatos",
importcontactsHelp: "Importar contatos para o Chatwoot",
importmessages: "Importar mensagens",
Expand Down