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:
Akhil Narang 2025-09-22 12:30:45 +05:30 committed by GitHub
commit fe74f01c70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}