From 01e9adf0c506baec958968cfa0448d1cfb4e03ed Mon Sep 17 00:00:00 2001 From: Pedro Ramon Date: Tue, 19 Nov 2024 22:29:30 -0300 Subject: [PATCH 1/3] Fix locale for Portuguese (#419) * wrong value for Tagalong locale * improve pt locale --------- Co-authored-by: Jack Andrews --- apps/client/locales/pt/peppermint.json | 26 +++++++++++++------------- apps/client/pages/profile.tsx | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/client/locales/pt/peppermint.json b/apps/client/locales/pt/peppermint.json index 10488c54c..21b6962a6 100644 --- a/apps/client/locales/pt/peppermint.json +++ b/apps/client/locales/pt/peppermint.json @@ -1,11 +1,11 @@ { "hello_good": "Bom", - "hello_morning": "Manhã", + "hello_morning": "Dia", "hello_afternoon": "Tarde", "sl_dashboard": "Painel", "sl_tickets": "Tickets", "sl_history": "Histórico", - "sl_notebook": "Caderno Pessoal", + "sl_notebook": "Bloco de Notas", "sl_users": "Usuários", "sl_clients": "Clientes", "sl_settings": "Configurações", @@ -20,7 +20,7 @@ "ticket_email_here": "E-mail", "ticket_details": "Título", "ticket_select_client": "Selecionar um Cliente", - "ticket_select_eng": "Selecionar um Engenheiro", + "ticket_select_eng": "Selecionar um Responsável", "ticket_extra_details": "Insira detalhes adicionais aqui... suporte para markdown", "cancel": "Cancelar", "create": "Criar", @@ -35,7 +35,7 @@ "new_client": "Novo Cliente", "previous": "Anterior", "next": "Próximo", - "show": "Mostrar", + "show": "Exibir", "name": "Nome", "email": "E-mail", "settings": "Configurações", @@ -49,9 +49,9 @@ "created": "Criado", "assigned_to": "Atribuído a", "enter_todo": "Inserir Tarefa", - "notebooks": "Cadernos", - "notebooks_description": "Este é um caderno pessoal. Aqui você pode salvar notas, links, trechos de código, etc.", - "create_notebook": "Criar Caderno", + "notebooks": "Blocos de Notas", + "notebooks_description": "Este é um bloco de notas. Aqui você pode salvar notas, links, trechos de código, etc.", + "create_notebook": "Criar bloco de notas", "open": "Abrir", "assigned_to_me": "Atribuído a Mim", "unassigned": "Não Atribuído", @@ -59,18 +59,18 @@ "description": "Descrição", "comments": "Comentários", "leave_comment": "Deixar um Comentário", - "close_issue": "Fechar Problema", + "close_issue": "Fechar Ticket", "comment": "Comentário", "save": "Salvar", - "labels": "Etiquetas", + "labels": "Tags", "created_at": "Criado em", "updated_at": "Atualizado em", "hide_ticket": "Ocultar Ticket", "show_ticket": "Mostrar Global", - "open_issue": "Abrir Problema", - "closed_issue": "Problema Fechado", + "open_issue": "Abrir Ticket", + "closed_issue": "Ticket Fechado", "recent_tickets": "Tickets Recentes", - "notebook_title": "Título do Caderno", + "notebook_title": "Título do Bloco de Notas", "admin_settings": "Configurações de Admin", "profile": "Perfil", "logout": "Sair", @@ -80,7 +80,7 @@ "notifications": "Notificações", "save_and_reload": "Salvar e Recarregar", "select_a_client": "Selecionar um Cliente", - "select_an_engineer": "Selecionar um Engenheiro", + "select_an_engineer": "Selecionar um Responsável", "ticket_create": "Criar Ticket", "internallycommented_at": "Comentado Internamente às" } diff --git a/apps/client/pages/profile.tsx b/apps/client/pages/profile.tsx index 549c5ae7f..d396ddc32 100644 --- a/apps/client/pages/profile.tsx +++ b/apps/client/pages/profile.tsx @@ -108,7 +108,7 @@ export default function UserProfile() { - + From 54e932e35fd0c9580545fc782bb195c049b7e2a4 Mon Sep 17 00:00:00 2001 From: Jack Andrews Date: Sat, 15 Feb 2025 13:22:24 +0000 Subject: [PATCH 2/3] chore: cleanup --- .gitignore | 4 +++- apps/api/src/lib/notifications/issue/status.ts | 16 ---------------- .../components/CreateTicketModal/index.tsx | 2 +- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 46e5a0fd8..0dad47dee 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,6 @@ yarn-error.log* # Typescript build dist -infra \ No newline at end of file +infra + +.cursorrules \ No newline at end of file diff --git a/apps/api/src/lib/notifications/issue/status.ts b/apps/api/src/lib/notifications/issue/status.ts index 169f601d1..60944f1fc 100644 --- a/apps/api/src/lib/notifications/issue/status.ts +++ b/apps/api/src/lib/notifications/issue/status.ts @@ -1,13 +1,5 @@ import { prisma } from "../../../prisma"; -/** - * Creates status change notifications for all ticket followers. - * - * @param {object} ticket - The ticket object - * @param {object} updater - The username of the person who updated the status - * @param {string} newStatus - The new status of the ticket - * @returns {Promise} - */ export async function activeStatusNotification( ticket: any, updater: any, @@ -41,14 +33,6 @@ export async function activeStatusNotification( } } -/** - * Creates status change notifications for all ticket followers. - * - * @param {object} ticket - The ticket object - * @param {object} updater - The username of the person who updated the status - * @param {string} newStatus - The new status of the ticket - * @returns {Promise} - */ export async function statusUpdateNotification( ticket: any, updater: any, diff --git a/apps/client/components/CreateTicketModal/index.tsx b/apps/client/components/CreateTicketModal/index.tsx index 332739122..0e45e332d 100644 --- a/apps/client/components/CreateTicketModal/index.tsx +++ b/apps/client/components/CreateTicketModal/index.tsx @@ -124,7 +124,7 @@ export default function CreateTicketModal({ keypress, setKeyPressDown }) { toast({ variant: "destructive", title: `Error`, - description: res.error, + description: res.message, }); } }); From 80324aee199a89032d575f962cb55674e2d59c39 Mon Sep 17 00:00:00 2001 From: Jack Andrews Date: Sat, 15 Feb 2025 15:05:59 +0000 Subject: [PATCH 3/3] fix: imap email comments not pulling through (#447) --- apps/api/src/lib/services/imap.service.ts | 27 ++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/api/src/lib/services/imap.service.ts b/apps/api/src/lib/services/imap.service.ts index 631bb205e..a3d793af6 100644 --- a/apps/api/src/lib/services/imap.service.ts +++ b/apps/api/src/lib/services/imap.service.ts @@ -61,17 +61,31 @@ export class ImapService { ): Promise { const { from, subject, text, html, textAsHtml } = parsed; + console.log("isReply", isReply); + if (isReply) { - const ticketIdMatch = subject.match(/#(\d+)/); - if (!ticketIdMatch) { + // First try to match UUID format + const uuidMatch = subject.match( + /(?:ref:|#)([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i + ); + console.log("UUID MATCH", uuidMatch); + + const ticketId = uuidMatch?.[1]; + + console.log("TICKET ID", ticketId); + + if (!ticketId) { throw new Error(`Could not extract ticket ID from subject: ${subject}`); } - const ticketId = ticketIdMatch[1]; const ticket = await prisma.ticket.findFirst({ - where: { Number: Number(ticketId) }, + where: { + id: ticketId, + }, }); + console.log("TICKET", ticket); + if (!ticket) { throw new Error(`Ticket not found: ${ticketId}`); } @@ -152,7 +166,10 @@ export class ImapService { msg.on("body", (stream) => { simpleParser(stream, async (err, parsed) => { if (err) throw err; - const isReply = parsed.subject?.includes("Re:"); + const subjectLower = parsed.subject?.toLowerCase() || ""; + const isReply = + subjectLower.includes("re:") || + subjectLower.includes("ref:"); await this.processEmail(parsed, isReply || false); }); });