mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
✨ Database kanban view https://github.com/siyuan-note/siyuan/issues/8873
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
7555f96ac6
commit
bdff7a74c1
1 changed files with 4 additions and 3 deletions
|
|
@ -721,6 +721,7 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
|
|||
return
|
||||
}
|
||||
|
||||
oldLayout := view.LayoutType
|
||||
view.LayoutType = newLayout
|
||||
|
||||
switch newLayout {
|
||||
|
|
@ -734,7 +735,7 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
|
|||
}
|
||||
|
||||
view.Table = av.NewLayoutTable()
|
||||
switch view.LayoutType {
|
||||
switch oldLayout {
|
||||
case av.LayoutTypeGallery:
|
||||
for _, field := range view.Gallery.CardFields {
|
||||
view.Table.Columns = append(view.Table.Columns, &av.ViewTableColumn{BaseField: &av.BaseField{ID: field.ID}})
|
||||
|
|
@ -754,7 +755,7 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
|
|||
}
|
||||
|
||||
view.Gallery = av.NewLayoutGallery()
|
||||
switch view.LayoutType {
|
||||
switch oldLayout {
|
||||
case av.LayoutTypeTable:
|
||||
for _, col := range view.Table.Columns {
|
||||
view.Gallery.CardFields = append(view.Gallery.CardFields, &av.ViewGalleryCardField{BaseField: &av.BaseField{ID: col.ID}})
|
||||
|
|
@ -774,7 +775,7 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
|
|||
}
|
||||
|
||||
view.Kanban = av.NewLayoutKanban()
|
||||
switch view.LayoutType {
|
||||
switch oldLayout {
|
||||
case av.LayoutTypeTable:
|
||||
for _, col := range view.Table.Columns {
|
||||
view.Kanban.Fields = append(view.Kanban.Fields, &av.ViewKanbanField{BaseField: &av.BaseField{ID: col.ID}})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue