🎨 Adding row overwriting data after enabling filter in database https://github.com/siyuan-note/siyuan/issues/9395

This commit is contained in:
Daniel 2023-10-11 10:48:29 +08:00
parent 210a3ac547
commit 65adab61c9
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 25 additions and 17 deletions

View file

@ -508,6 +508,16 @@ type TableRow struct {
Cells []*TableCell `json:"cells"`
}
func (row *TableRow) GetBlockValue() (ret *Value) {
for _, cell := range row.Cells {
if KeyTypeBlock == cell.ValueType {
ret = cell.Value
break
}
}
return
}
func (table *Table) GetType() LayoutType {
return LayoutTypeTable
}
@ -569,6 +579,12 @@ func (table *Table) FilterRows() {
rows := []*TableRow{}
for _, row := range table.Rows {
block := row.GetBlockValue()
if !block.IsInitialized && nil != block.Block && "" == block.Block.Content && block.IsDetached {
rows = append(rows, row)
continue
}
pass := true
for j, index := range colIndexes {
operator := table.Filters[j].Operator