Skip to content
Merged

0.5.6 #449

Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ yarn-error.log*
# Typescript build
dist

infra
infra

.cursorrules
16 changes: 0 additions & 16 deletions apps/api/src/lib/notifications/issue/status.ts
Original file line number Diff line number Diff line change
@@ -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<void>}
*/
export async function activeStatusNotification(
ticket: any,
updater: any,
Expand Down Expand Up @@ -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<void>}
*/
export async function statusUpdateNotification(
ticket: any,
updater: any,
Expand Down
27 changes: 22 additions & 5 deletions apps/api/src/lib/services/imap.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,31 @@ export class ImapService {
): Promise<void> {
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}`);
}
Expand Down Expand Up @@ -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);
});
});
Expand Down
2 changes: 1 addition & 1 deletion apps/client/components/CreateTicketModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default function CreateTicketModal({ keypress, setKeyPressDown }) {
toast({
variant: "destructive",
title: `Error`,
description: res.error,
description: res.message,
});
}
});
Expand Down
26 changes: 13 additions & 13 deletions apps/client/locales/pt/peppermint.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -49,28 +49,28 @@
"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",
"closed": "Fechado",
"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",
Expand All @@ -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"
}
2 changes: 1 addition & 1 deletion apps/client/pages/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function UserProfile() {
<option value="es">Spanish</option>
<option value="no">Norwegian</option>
<option value="fr">French</option>
<option value="pt">Tagalong</option>
<option value="tl">Tagalong</option>
<option value="da">Danish</option>
<option value="pt">Portuguese</option>
<option value="it">Italiano</option>
Expand Down
Loading