🎨 Add Relation and Rollup column to database table view https://github.com/siyuan-note/siyuan/issues/9888

This commit is contained in:
Daniel 2023-12-23 10:54:47 +08:00
parent 50b76c7294
commit 940dff4c7f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 27 additions and 11 deletions

View file

@ -142,10 +142,14 @@ func (value *Value) String() string {
}
return ""
case KeyTypeRelation:
if nil == value.Relation {
if 1 > len(value.Relation.Contents) {
return ""
}
return value.Relation.Content
var ret []string
for _, v := range value.Relation.Contents {
ret = append(ret, v)
}
return strings.Join(ret, " ")
case KeyTypeRollup:
if nil == value.Rollup {
return ""
@ -463,7 +467,7 @@ type ValueCheckbox struct {
}
type ValueRelation struct {
Content string `json:"content"`
Contents []string `json:"contents"`
BlockIDs []string `json:"blockIDs"`
}