From 37955620a4b39632076228384e5300a183e75c2f Mon Sep 17 00:00:00 2001 From: RitvikSardana Date: Thu, 12 Dec 2024 00:35:47 +0530 Subject: [PATCH 01/35] feat(customisation): update field value from custom actions --- desk/src/pages/TicketAgent.vue | 5 ++ desk/src/pages/TicketCustomer.vue | 50 +++++++++++++++++++ .../hd_form_script/hd_form_script.json | 9 +++- .../doctype/hd_form_script/hd_form_script.py | 5 +- helpdesk/helpdesk/doctype/hd_ticket/api.py | 4 +- 5 files changed, 68 insertions(+), 5 deletions(-) diff --git a/desk/src/pages/TicketAgent.vue b/desk/src/pages/TicketAgent.vue index bd25c25d3..c40ef3bdf 100644 --- a/desk/src/pages/TicketAgent.vue +++ b/desk/src/pages/TicketAgent.vue @@ -202,9 +202,14 @@ const ticket = createResource({ onSuccess: (data) => { setupCustomActions(data, { doc: data, + updateField, }); }, }); +function updateField(name, value, callback = () => {}) { + updateTicket(name, value); + callback(); +} const breadcrumbs = computed(() => { let items = [{ label: "Tickets", route: { name: "TicketsAgent" } }]; diff --git a/desk/src/pages/TicketCustomer.vue b/desk/src/pages/TicketCustomer.vue index 8980ddbc1..1571a37c7 100644 --- a/desk/src/pages/TicketCustomer.vue +++ b/desk/src/pages/TicketCustomer.vue @@ -5,6 +5,10 @@