From cd7c85e9a9f2fa5bd80c135d8b4b8092aa863c09 Mon Sep 17 00:00:00 2001 From: RitvikSardana Date: Thu, 28 Nov 2024 11:50:26 +0530 Subject: [PATCH 1/2] fix: create communication if description is available --- helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py b/helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py index daf302688..89e79aca6 100644 --- a/helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py +++ b/helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py @@ -157,7 +157,7 @@ def by_priority(query: Query, direction: Order): } def publish_update(self): - publish_event("helpdesk:ticket-update", {"name": self.name}) + publish_event("helpdesk:ticket-update", self.name) capture_event("ticket_updated") def autoname(self): @@ -192,6 +192,9 @@ def after_insert(self): capture_event("ticket_created") publish_event("helpdesk:new-ticket", {"name": self.name}) + if self.get("description"): + self.create_communication_via_contact(self.description) + def on_update(self): # flake8: noqa if self.status == "Open": From f3097b70913d9ed2ac1100572d11e60f337f137a Mon Sep 17 00:00:00 2001 From: RitvikSardana Date: Thu, 28 Nov 2024 11:51:52 +0530 Subject: [PATCH 2/2] fix: sockets in ticket view and list view --- desk/src/pages/TicketAgent.vue | 10 +++++++++- desk/src/pages/TicketCustomer.vue | 17 ++++++++++++++++- desk/src/pages/Tickets.vue | 11 ++++++++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/desk/src/pages/TicketAgent.vue b/desk/src/pages/TicketAgent.vue index a40d9b1a0..c207ed9ed 100644 --- a/desk/src/pages/TicketAgent.vue +++ b/desk/src/pages/TicketAgent.vue @@ -46,7 +46,7 @@
-
+
{ document.title = props.ticketId; + socket.on("helpdesk:ticket-update", (ticketID) => { + if (ticketID === Number(props.ticketId)) { + ticket.reload(); + } + }); }); onUnmounted(() => { document.title = "Helpdesk"; + socket.off("helpdesk:ticket-update"); }); diff --git a/desk/src/pages/TicketCustomer.vue b/desk/src/pages/TicketCustomer.vue index e61d96cac..8980ddbc1 100644 --- a/desk/src/pages/TicketCustomer.vue +++ b/desk/src/pages/TicketCustomer.vue @@ -56,7 +56,7 @@ diff --git a/desk/src/pages/Tickets.vue b/desk/src/pages/Tickets.vue index eca75fcec..410be5d8f 100644 --- a/desk/src/pages/Tickets.vue +++ b/desk/src/pages/Tickets.vue @@ -50,13 +50,14 @@