fix: Allow overriding breadcrumbs modules
Some modules like Core, Email, Automation are shown in the Settings module. This change will allow apps to define which module the original module should map to.
This commit is contained in:
parent
5f1d0f3d2b
commit
b2764ca4dc
2 changed files with 13 additions and 3 deletions
|
|
@ -11,6 +11,16 @@ frappe.breadcrumbs = {
|
|||
"Dashboard Chart Source": "Customization",
|
||||
},
|
||||
|
||||
module_map: {
|
||||
'Core': 'Settings',
|
||||
'Email': 'Settings',
|
||||
'Custom': 'Settings',
|
||||
'Workflow': 'Settings',
|
||||
'Printing': 'Settings',
|
||||
'Automation': 'Settings',
|
||||
'Setup': 'Settings',
|
||||
},
|
||||
|
||||
set_doctype_module: function(doctype, module) {
|
||||
localStorage["preferred_breadcrumbs:" + doctype] = module;
|
||||
},
|
||||
|
|
@ -73,8 +83,8 @@ frappe.breadcrumbs = {
|
|||
}
|
||||
|
||||
if(breadcrumbs.module) {
|
||||
if(in_list(["Core", "Email", "Custom", "Workflow", "Print"], breadcrumbs.module)) {
|
||||
breadcrumbs.module = "Setup";
|
||||
if (frappe.breadcrumbs.module_map[breadcrumbs.module]) {
|
||||
breadcrumbs.module = frappe.breadcrumbs.module_map[breadcrumbs.module];
|
||||
}
|
||||
|
||||
if(frappe.get_module(breadcrumbs.module)) {
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ frappe.views.TreeView = Class.extend({
|
|||
|
||||
this.page = this.parent.page;
|
||||
frappe.container.change_to(this.page_name);
|
||||
frappe.breadcrumbs.add(me.opts.breadcrumb || locals.DocType[me.doctype].module);
|
||||
frappe.breadcrumbs.add(me.opts.breadcrumb || locals.DocType[me.doctype].module, me.doctype);
|
||||
|
||||
this.set_title();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue