mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
🎨 Add Relation and Rollup column to database table view https://github.com/siyuan-note/siyuan/issues/9888
This commit is contained in:
parent
0547f27839
commit
fca3bf6855
5 changed files with 215 additions and 5 deletions
|
|
@ -50,6 +50,8 @@ type Value struct {
|
|||
Created *ValueCreated `json:"created,omitempty"`
|
||||
Updated *ValueUpdated `json:"updated,omitempty"`
|
||||
Checkbox *ValueCheckbox `json:"checkbox,omitempty"`
|
||||
Relation *ValueRelation `json:"relation,omitempty"`
|
||||
Rollup *ValueRollup `json:"rollup,omitempty"`
|
||||
}
|
||||
|
||||
func (value *Value) String() string {
|
||||
|
|
@ -135,6 +137,16 @@ func (value *Value) String() string {
|
|||
return "√"
|
||||
}
|
||||
return ""
|
||||
case KeyTypeRelation:
|
||||
if nil == value.Relation {
|
||||
return ""
|
||||
}
|
||||
return value.Relation.Content
|
||||
case KeyTypeRollup:
|
||||
if nil == value.Rollup {
|
||||
return ""
|
||||
}
|
||||
return strings.Join(value.Rollup.Contents, " ")
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
|
@ -433,3 +445,12 @@ func NewFormattedValueUpdated(content, content2 int64, format UpdatedFormat) (re
|
|||
type ValueCheckbox struct {
|
||||
Checked bool `json:"checked"`
|
||||
}
|
||||
|
||||
type ValueRelation struct {
|
||||
Content string `json:"content"`
|
||||
BlockIDs []string `json:"blockIDs"`
|
||||
}
|
||||
|
||||
type ValueRollup struct {
|
||||
Contents []string `json:"contents"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue