refactor: add condition for dashboard-view
This commit is contained in:
parent
12c7f2ae2d
commit
d5f5b07435
1 changed files with 11 additions and 0 deletions
|
|
@ -70,6 +70,9 @@ frappe.breadcrumbs = {
|
|||
this.set_form_breadcrumb(breadcrumbs, view);
|
||||
} else if (breadcrumbs.doctype && view === 'list') {
|
||||
this.set_list_breadcrumb(breadcrumbs);
|
||||
} else if (breadcrumbs.doctype && view == 'dashboard-view') {
|
||||
this.set_list_breadcrumb(breadcrumbs);
|
||||
this.set_dashboard_breadcrumb(breadcrumbs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -164,6 +167,14 @@ frappe.breadcrumbs = {
|
|||
|
||||
},
|
||||
|
||||
set_dashboard_breadcrumb(breadcrumbs) {
|
||||
const doctype = breadcrumbs.doctype;
|
||||
const docname = frappe.get_route()[1];
|
||||
let dashboard_route = `/app/${frappe.router.slug(doctype)}/${docname}`;
|
||||
$(`<li><a href="${dashboard_route}">${__(docname)}</a></li>`)
|
||||
.appendTo(this.$breadcrumbs);
|
||||
},
|
||||
|
||||
setup_modules() {
|
||||
if (!frappe.visible_modules) {
|
||||
frappe.visible_modules = $.map(frappe.boot.allowed_workspaces, (m) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue