Merge pull request #34039 from akhilnarang/fix-kanban
fix(kanban_view): don't always prompt user to create a new board
This commit is contained in:
commit
fe74f01c70
1 changed files with 15 additions and 1 deletions
|
|
@ -31,7 +31,17 @@ frappe.views.KanbanView = class KanbanView extends frappe.views.ListView {
|
|||
if (!kanbans.length) {
|
||||
return frappe.views.KanbanView.show_kanban_dialog(this.doctype, true);
|
||||
} else if (kanbans.length && frappe.get_route().length !== 4) {
|
||||
return frappe.views.KanbanView.show_kanban_dialog(this.doctype, true);
|
||||
// Try to use the last board the user used, else default to the first available board
|
||||
const last_board = frappe.get_user_settings(this.doctype)["Kanban"]
|
||||
?.last_kanban_board;
|
||||
if (last_board && kanbans.includes(last_board)) {
|
||||
frappe.set_route("List", this.doctype, "Kanban", last_board);
|
||||
return;
|
||||
} else {
|
||||
const first_board = kanbans[0];
|
||||
frappe.set_route("List", this.doctype, "Kanban", first_board.name);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.kanbans = kanbans;
|
||||
|
||||
|
|
@ -120,6 +130,10 @@ frappe.views.KanbanView = class KanbanView extends frappe.views.ListView {
|
|||
// pass
|
||||
}
|
||||
|
||||
set_result_height() {
|
||||
// pass
|
||||
}
|
||||
|
||||
toggle_result_area() {
|
||||
this.$result.toggle(this.data.length > 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue