diff --git a/frappe/public/js/frappe/list/list_sidebar.js b/frappe/public/js/frappe/list/list_sidebar.js index 6ad4e324e3..1743a46145 100644 --- a/frappe/public/js/frappe/list/list_sidebar.js +++ b/frappe/public/js/frappe/list/list_sidebar.js @@ -42,6 +42,8 @@ frappe.views.ListSidebar = class ListSidebar { if (frappe.user.has_role("System Manager")) { this.add_insights_banner(); + this.add_crm_banner(); + this.add_helpdesk_banner(); } } @@ -279,25 +281,12 @@ frappe.views.ListSidebar = class ListSidebar { this.get_stats(); } - add_insights_banner() { + add_banner(message, link, cta) { try { - if (this.list_view.view != "Report") { - return; - } - - if (localStorage.getItem("show_insights_banner") == "false") { - return; - } - - if (this.insights_banner) { - this.insights_banner.remove(); - } - - const message = __("Get more insights with"); - const link = "https://frappe.io/s/insights"; - const cta = "Frappe Insights"; - - this.insights_banner = $(` + // if (this.banner) { + // this.banner.remove(); + // } + this.banner = $(`
@@ -306,4 +295,43 @@ frappe.views.ListSidebar = class ListSidebar { console.error(error); } } + + add_insights_banner() { + if (this.list_view.view != "Report") { + return; + } + + if (localStorage.getItem("show_insights_banner") == "false") { + return; + } + + const message = __("Get more insights with"); + const link = "https://frappe.io/s/insights"; + const cta = "Frappe Insights"; + this.add_banner(message, link, cta); + } + + add_crm_banner() { + if (this.list_view.meta.module != "CRM") { + return; + } + + const message = __("Switch to Frappe CRM for smarter sales"); + const link = + "https://frappe.io/crm?utm_source=crm-sidebar&utm_medium=sidebar&utm_campaign=frappe-ad"; + const cta = "Frappe CRM"; + this.add_banner(message, link, cta); + } + + add_helpdesk_banner() { + if (this.list_view.meta.module != "Support") { + return; + } + + const message = __("Upgrade your support experience with Frappe Helpdesk"); + const link = + "https://frappe.io/helpdesk?utm_source=support-sidebar&utm_medium=sidebar&utm_campaign=frappe-ad"; + const cta = "Frappe Helpdesk"; + this.add_banner(message, link, cta); + } };