Skip to content

Commit

Permalink
🎨 Supports multiple views for the database #9751
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Dec 1, 2023
1 parent 83bebb9 commit 57b7a90
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions kernel/model/attribute_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -1431,11 +1431,6 @@ func addAttributeViewColumn(operation *Operation) (err error) {
return
}

view, err := attrView.GetCurrentView()
if nil != err {
return
}

keyType := av.KeyType(operation.Typ)
switch keyType {
case av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone, av.KeyTypeMAsset, av.KeyTypeTemplate, av.KeyTypeCreated, av.KeyTypeUpdated, av.KeyTypeCheckbox:
Expand All @@ -1446,9 +1441,11 @@ func addAttributeViewColumn(operation *Operation) (err error) {
key := av.NewKey(operation.ID, operation.Name, icon, keyType)
attrView.KeyValues = append(attrView.KeyValues, &av.KeyValues{Key: key})

switch view.LayoutType {
case av.LayoutTypeTable:
view.Table.Columns = append(view.Table.Columns, &av.ViewTableColumn{ID: key.ID})
for _, v := range attrView.Views {
switch v.LayoutType {
case av.LayoutTypeTable:
v.Table.Columns = append(v.Table.Columns, &av.ViewTableColumn{ID: key.ID})
}
}
}

Expand Down

0 comments on commit 57b7a90

Please sign in to comment.