🎨 Database column icon https://github.com/siyuan-note/siyuan/issues/9304
This commit is contained in:
parent
19b73ecc9b
commit
c516e83bb7
2 changed files with 27 additions and 0 deletions
|
@ -758,6 +758,31 @@ func setAttributeViewColHidden(operation *Operation) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func (tx *Transaction) doSetAttrViewColumnIcon(operation *Operation) (ret *TxErr) {
|
||||
err := setAttributeViewColIcon(operation)
|
||||
if nil != err {
|
||||
return &TxErr{code: TxErrWriteAttributeView, id: operation.AvID, msg: err.Error()}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func setAttributeViewColIcon(operation *Operation) (err error) {
|
||||
attrView, err := av.ParseAttributeView(operation.AvID)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
for _, keyValues := range attrView.KeyValues {
|
||||
if keyValues.Key.ID == operation.ID {
|
||||
keyValues.Key.Icon = operation.Data.(string)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
err = av.SaveAttributeView(attrView)
|
||||
return
|
||||
}
|
||||
|
||||
func (tx *Transaction) doSortAttrViewRow(operation *Operation) (ret *TxErr) {
|
||||
err := sortAttributeViewRow(operation)
|
||||
if nil != err {
|
||||
|
|
|
@ -206,6 +206,8 @@ func performTx(tx *Transaction) (ret *TxErr) {
|
|||
ret = tx.doSetAttrViewColumnWrap(op)
|
||||
case "setAttrViewColHidden":
|
||||
ret = tx.doSetAttrViewColumnHidden(op)
|
||||
case "setAttrViewColIcon":
|
||||
ret = tx.doSetAttrViewColumnIcon(op)
|
||||
case "insertAttrViewBlock":
|
||||
ret = tx.doInsertAttrViewBlock(op)
|
||||
case "removeAttrViewBlock":
|
||||
|
|
Loading…
Add table
Reference in a new issue