🎨 Support hiding database table view title https://github.com/siyuan-note/siyuan/issues/10478

This commit is contained in:
Daniel 2024-03-01 20:38:53 +08:00
parent ec46cbfce7
commit 7dcdcfb0d3
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 33 additions and 3 deletions

View file

@ -1017,6 +1017,33 @@ func getRowBlockValue(keyValues []*av.KeyValues) (ret *av.Value) {
return
}
func (tx *Transaction) doHideAttrViewName(operation *Operation) (ret *TxErr) {
err := hideAttrViewName(operation)
if nil != err {
return &TxErr{code: TxErrWriteAttributeView, id: operation.AvID, msg: err.Error()}
}
return
}
func hideAttrViewName(operation *Operation) (err error) {
attrView, err := av.ParseAttributeView(operation.AvID)
if nil != err {
logging.LogErrorf("parse attribute view [%s] failed: %s", operation.AvID, err)
return
}
viewID := operation.ID
view := attrView.GetView(viewID)
if nil == view {
logging.LogErrorf("get view [%s] failed: %s", viewID, err)
return
}
view.HideAttrViewName = operation.Data.(bool)
err = av.SaveAttributeView(attrView)
return
}
func (tx *Transaction) doUpdateAttrViewColRollup(operation *Operation) (ret *TxErr) {
err := updateAttributeViewColRollup(operation)
if nil != err {