🎨 Fix kanban attrView followup (#16277)

* fix: more robust fix for kanban empty groups error
- followup for handling of edge cases that cause "Cannot read properties of undefined (reading 'forEach')" error in renderKanban
- always apply preferred group key logic whenever kanban has an empty group key

* 🎨 Clean code

---------

Co-authored-by: D <845765@qq.com>
This commit is contained in:
NateSmyth 2025-11-03 23:31:59 -05:00 committed by GitHub
parent d4c46ebaa2
commit 3525c2b5d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,7 +90,15 @@ func renderAttributeView(attrView *av.AttributeView, nodeID, viewID, query strin
func renderAttributeViewGroups(viewable av.Viewable, attrView *av.AttributeView, view *av.View, query string, page, pageSize int, groupPaging map[string]interface{}) (err error) {
groupKey := view.GetGroupKey(attrView)
if nil == groupKey {
return
if view.LayoutType == av.LayoutTypeKanban {
preferredGroupKey := getKanbanPreferredGroupKey(attrView)
group := &av.ViewGroup{Field: preferredGroupKey.ID}
setAttributeViewGroup(attrView, view, group)
av.SaveAttributeView(attrView)
groupKey = view.GetGroupKey(attrView)
} else {
return
}
}
// 当前日期可能会变,所以如果是按日期分组则需要重新生成分组