🎨 Add asset type column to Attribute View https://github.com/siyuan-note/siyuan/issues/8895

This commit is contained in:
Daniel 2023-09-22 09:37:55 +08:00
parent c2066c3c5a
commit 2b34dd2e32
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -764,7 +764,7 @@ func addAttributeViewColumn(operation *Operation) (err error) {
keyType := av.KeyType(operation.Typ) keyType := av.KeyType(operation.Typ)
switch keyType { switch keyType {
case av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone: case av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone, av.KeyTypeMAsset:
key := av.NewKey(operation.ID, operation.Name, keyType) key := av.NewKey(operation.ID, operation.Name, keyType)
attrView.KeyValues = append(attrView.KeyValues, &av.KeyValues{Key: key}) attrView.KeyValues = append(attrView.KeyValues, &av.KeyValues{Key: key})
@ -823,7 +823,7 @@ func updateAttributeViewColumn(operation *Operation) (err error) {
colType := av.KeyType(operation.Typ) colType := av.KeyType(operation.Typ)
switch colType { switch colType {
case av.KeyTypeBlock, av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone: case av.KeyTypeBlock, av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone, av.KeyTypeMAsset:
for _, keyValues := range attrView.KeyValues { for _, keyValues := range attrView.KeyValues {
if keyValues.Key.ID == operation.ID { if keyValues.Key.ID == operation.ID {
keyValues.Key.Name = operation.Name keyValues.Key.Name = operation.Name