fix: always show standard items in sidebar
This commit is contained in:
parent
69e341d2bd
commit
3989040ab6
3 changed files with 16 additions and 5 deletions
|
|
@ -26,6 +26,7 @@ frappe.ui.Sidebar = class Sidebar {
|
|||
|
||||
prepare() {
|
||||
try {
|
||||
this.add_standard_items();
|
||||
this.sidebar_data = frappe.boot.workspace_sidebar_item[this.workspace_title];
|
||||
this.workspace_sidebar_items = this.sidebar_data.items;
|
||||
if (this.edit_mode) {
|
||||
|
|
@ -213,7 +214,6 @@ frappe.ui.Sidebar = class Sidebar {
|
|||
}
|
||||
create_sidebar(items) {
|
||||
this.empty();
|
||||
this.add_standard_items(items);
|
||||
if (items && items.length > 0) {
|
||||
items.forEach((w) => {
|
||||
if (!w.display_depends_on || frappe.utils.eval(w.display_depends_on)) {
|
||||
|
|
@ -403,9 +403,11 @@ frappe.ui.Sidebar = class Sidebar {
|
|||
if (sidebars.length == 0) {
|
||||
let module_name = router.meta?.module;
|
||||
if (module_name) {
|
||||
frappe.app.sidebar.setup(
|
||||
this.sidebar_module_map[module_name][0] || module_name
|
||||
);
|
||||
let sidebar_title =
|
||||
(this.sidebar_module_map[module_name] &&
|
||||
this.sidebar_module_map[module_name][0]) ||
|
||||
module_name;
|
||||
frappe.app.sidebar.setup(sidebar_title);
|
||||
}
|
||||
} else {
|
||||
if (this.sidebar_title && sidebars.includes(this.workspace_title)) {
|
||||
|
|
|
|||
|
|
@ -99,8 +99,14 @@ frappe.ui.SidebarHeader = class SidebarHeader {
|
|||
false,
|
||||
`var(${this.header_bg_color})`
|
||||
);
|
||||
} else {
|
||||
this.header_icon = this.get_default_icon();
|
||||
this.header_icon = `<img src=${this.header_icon}></img>`;
|
||||
}
|
||||
}
|
||||
get_default_icon() {
|
||||
return frappe.boot.app_data[0].app_logo_url;
|
||||
}
|
||||
get_desktop_icon_by_label(title, filters) {
|
||||
if (!filters) {
|
||||
return frappe.boot.desktop_icons.find((f) => f.label === title && f.hidden != 1);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@ frappe.ui.sidebar_item.TypeLink = class SidebarItem {
|
|||
this.item = opts.item;
|
||||
this.container = opts.container;
|
||||
this.nested_items = opts.item.nested_items || [];
|
||||
this.workspace_title = $(".body-sidebar").attr("data-title").toLowerCase();
|
||||
this.workspace_title =
|
||||
($(".body-sidebar").attr("data-title") &&
|
||||
$(".body-sidebar").attr("data-title").toLowerCase()) ||
|
||||
frappe.app.sidebar.sidebar_title;
|
||||
this.prepare(opts);
|
||||
this.make();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue