mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-25 09:46:10 +01:00
🐛 Database kanban view grouping modification issues https://github.com/siyuan-note/siyuan/issues/16511
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
3eb3836d91
commit
3a1376d49e
1 changed files with 10 additions and 1 deletions
|
|
@ -241,6 +241,8 @@ func getAttrViewAddingBlockDefaultValues(attrView *av.AttributeView, view, group
|
|||
if !av.MSelectExistOption(newValue.MSelect, groupView.GetGroupValue()) {
|
||||
if 1 > len(newValue.MSelect) || av.KeyTypeMSelect == groupKey.Type {
|
||||
newValue.MSelect = append(newValue.MSelect, &av.ValueSelect{Content: opt.Name, Color: opt.Color})
|
||||
} else {
|
||||
newValue.MSelect = []*av.ValueSelect{{Content: opt.Name, Color: opt.Color}}
|
||||
}
|
||||
} else {
|
||||
var vals []*av.ValueSelect
|
||||
|
|
@ -3987,11 +3989,18 @@ func sortAttributeViewRow(operation *Operation) (err error) {
|
|||
if targetGroupView := view.GetGroupByID(operation.TargetGroupID); nil != targetGroupView && !gulu.Str.Contains(itemID, targetGroupView.GroupItemIDs) {
|
||||
fillDefaultValue(attrView, view, targetGroupView, operation.PreviousID, itemID, false)
|
||||
|
||||
// 移除旧分组的值
|
||||
if val := attrView.GetValue(groupKey.ID, itemID); nil != val {
|
||||
if av.MSelectExistOption(val.MSelect, groupView.GetGroupValue()) {
|
||||
// 移除旧分组的值
|
||||
val.MSelect = av.MSelectRemoveOption(val.MSelect, groupView.GetGroupValue())
|
||||
}
|
||||
|
||||
now := time.Now().UnixMilli()
|
||||
val.SetUpdatedAt(now)
|
||||
if blockVal := attrView.GetBlockValue(itemID); nil != blockVal {
|
||||
blockVal.Block.Updated = now
|
||||
blockVal.SetUpdatedAt(now)
|
||||
}
|
||||
}
|
||||
|
||||
for i, r := range targetGroupView.GroupItemIDs {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue