🎨 Candidate values of the database relation fields are no longer subject to view filtering https://github.com/siyuan-note/siyuan/issues/10411

This commit is contained in:
Daniel 2024-02-23 22:22:54 +08:00
parent 0226bbb310
commit aea30d12f7
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 57 additions and 0 deletions

View file

@ -38,6 +38,28 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func GetAttributeViewPrimaryKeyValues(avID string, page, pageSize int) (ret *av.KeyValues, err error) {
waitForSyncingStorages()
attrView, err := av.ParseAttributeView(avID)
if nil != err {
logging.LogErrorf("parse attribute view [%s] failed: %s", avID, err)
return
}
ret = attrView.GetBlockKeyValues()
if 1 > pageSize {
pageSize = 50
}
start := (page - 1) * pageSize
end := start + pageSize
if len(ret.Values) < end {
end = len(ret.Values)
}
ret.Values = ret.Values[start:end]
return
}
func GetAttributeViewFilterSort(id string) (filters []*av.ViewFilter, sorts []*av.ViewSort) {
waitForSyncingStorages()