fix: show misconfigured icons

This commit is contained in:
sokumon 2026-01-22 03:06:01 +05:30
parent c3bcdee999
commit 8cd03ba19b
2 changed files with 10 additions and 9 deletions

View file

@ -86,16 +86,13 @@ class DesktopIcon(Document):
else:
try:
items = bootinfo.workspace_sidebar_item[self.label.lower()]["items"]
#
if len(items) == 0:
return False
if len(items) and all(item["type"] == "Section Break" for item in items):
return False
return True
except KeyError:
return False
return True
def check_app_permission(self):
for a in frappe.get_installed_apps():
@ -193,7 +190,6 @@ def get_desktop_icons(user=None, bootinfo=None):
permitted_icons = []
permitted_parent_labels = set()
if bootinfo:
for s in user_icons:
icon = frappe.get_doc("Desktop Icon", s)

View file

@ -890,9 +890,6 @@ class DesktopIcon {
if (this.icon_type == "Folder") {
if (this.icon_data.child_icons.length == 0) return false;
}
if (this.icon_type == "Link" && !this.icon_route) {
return false;
}
return true;
}
get_child_icons_data() {
@ -999,7 +996,15 @@ class DesktopIcon {
if (this.icon_route && this.icon_route.startsWith("http")) {
this.icon.attr("target", "_blank");
}
this.icon.attr("href", this.icon_route);
if (this.icon_route) {
this.icon.attr("href", this.icon_route);
} else {
this.icon.on("click", function (event) {
frappe.msgprint(
"Icon is not correctly configured please check the workspace sidebar to it"
);
});
}
}
}