From 02464be6a6af4efa12b2f0ce7692c7aa64c4100a Mon Sep 17 00:00:00 2001 From: Pugazhendhi Velu Date: Thu, 4 Dec 2025 05:22:29 +0000 Subject: [PATCH] fix: hide collapse in edit mode and fix workspace links --- frappe/public/js/frappe/ui/sidebar/sidebar.js | 11 +++++++++-- frappe/public/js/frappe/ui/sidebar/sidebar_header.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frappe/public/js/frappe/ui/sidebar/sidebar.js b/frappe/public/js/frappe/ui/sidebar/sidebar.js index 293aeb5698..3933617c55 100644 --- a/frappe/public/js/frappe/ui/sidebar/sidebar.js +++ b/frappe/public/js/frappe/ui/sidebar/sidebar.js @@ -200,7 +200,14 @@ frappe.ui.Sidebar = class Sidebar { } make_sidebar() { this.empty(); - this.wrapper.find(".collapse-sidebar-link").removeClass("hidden"); + + // Display collapse button when sidebar is not in edit mode + if (!this.edit_mode) { + this.wrapper.find(".collapse-sidebar-link").removeClass("hidden"); + } else { + this.wrapper.find(".collapse-sidebar-link").addClass("hidden"); + } + this.create_sidebar(this.workspace_sidebar_items); // Scroll sidebar to selected page if it is not in viewport. @@ -808,7 +815,7 @@ frappe.ui.Sidebar = class Sidebar { const me = this; this.save_sidebar_button = this.wrapper.find(".save-sidebar"); this.discard_button = this.wrapper.find(".discard-button"); - this.save_sidebar_button.on("click", async function (event) { + this.save_sidebar_button.off("click").on("click", async function (event) { frappe.show_alert({ message: __("Saving Sidebar"), indicator: "success", diff --git a/frappe/public/js/frappe/ui/sidebar/sidebar_header.js b/frappe/public/js/frappe/ui/sidebar/sidebar_header.js index 84f0b5d3ed..829572285e 100644 --- a/frappe/public/js/frappe/ui/sidebar/sidebar_header.js +++ b/frappe/public/js/frappe/ui/sidebar/sidebar_header.js @@ -59,7 +59,7 @@ frappe.ui.SidebarHeader = class SidebarHeader { icon: "wallpaper", url: frappe.utils.generate_route({ type: "Workspace", - route: w.toLowerCase(), + route: frappe.router.slug(w), }), }; sibling_workspaces.push(item);