Skip to content

Commit

Permalink
feat: kanban & command (#448)
Browse files Browse the repository at this point in the history
* Fix locale for Portuguese (#419)

* wrong value for Tagalong locale

* improve pt locale

---------

Co-authored-by: Jack Andrews <japotts16@gmail.com>

* chore: cleanup

* fix: imap email comments not pulling through (#447)

* feat: init kanban view

* chore: kanban ui improvements

* chore: move settings to the right

* chore: refactor

* feat: more ui improvements to ticket view

* fix: some issues

* feat: command menu

---------

Co-authored-by: Pedro Ramon <pedroramon@users.noreply.github.com>
  • Loading branch information
potts99 and pedroramon authored Feb 15, 2025
1 parent eec566e commit f4b4616
Show file tree
Hide file tree
Showing 22 changed files with 1,627 additions and 759 deletions.
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
Loading

0 comments on commit f4b4616

Please sign in to comment.