From ec2bcda44026637d39cd68a1068432f57559ba48 Mon Sep 17 00:00:00 2001 From: Ernesto Ruiz Date: Thu, 11 Aug 2022 01:40:30 -0600 Subject: [PATCH] feat: add button in calendar view list to show calendar (#17778) * feat: add button in calendar view list to show calendar * style: format JS * chore: linting Co-authored-by: gavin --- .../doctype/calendar_view/calendar_view_list.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 frappe/desk/doctype/calendar_view/calendar_view_list.js diff --git a/frappe/desk/doctype/calendar_view/calendar_view_list.js b/frappe/desk/doctype/calendar_view/calendar_view_list.js new file mode 100644 index 0000000000..aa55a8ebbb --- /dev/null +++ b/frappe/desk/doctype/calendar_view/calendar_view_list.js @@ -0,0 +1,16 @@ +frappe.listview_settings["Calendar View"] = { + button: { + show(doc) { + return doc.name; + }, + get_label() { + return frappe.utils.icon("calendar", "sm"); + }, + get_description(doc) { + return __("View {0}", [`${doc.name}`]); + }, + action(doc) { + frappe.set_route("List", doc.reference_doctype, "Calendar", doc.name); + }, + }, +};