mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
fec603487b
1 changed files with 25 additions and 0 deletions
|
@ -4229,6 +4229,19 @@ func updateAttributeViewValue(tx *Transaction, attrView *av.AttributeView, keyID
|
||||||
}
|
}
|
||||||
} else if av.KeyTypeSelect == val.Type || av.KeyTypeMSelect == val.Type {
|
} else if av.KeyTypeSelect == val.Type || av.KeyTypeMSelect == val.Type {
|
||||||
if nil != key && 0 < len(val.MSelect) {
|
if nil != key && 0 < len(val.MSelect) {
|
||||||
|
var tmp []*av.ValueSelect
|
||||||
|
// 移除空选项 https://github.com/siyuan-note/siyuan/issues/15533
|
||||||
|
for _, v := range val.MSelect {
|
||||||
|
if "" != v.Content {
|
||||||
|
tmp = append(tmp, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val.MSelect = tmp
|
||||||
|
|
||||||
|
if 1 > len(val.MSelect) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// The selection options are inconsistent after pasting data into the database https://github.com/siyuan-note/siyuan/issues/11409
|
// The selection options are inconsistent after pasting data into the database https://github.com/siyuan-note/siyuan/issues/11409
|
||||||
for _, valOpt := range val.MSelect {
|
for _, valOpt := range val.MSelect {
|
||||||
if opt := key.GetOption(valOpt.Content); nil == opt {
|
if opt := key.GetOption(valOpt.Content); nil == opt {
|
||||||
|
@ -4551,6 +4564,18 @@ func updateAttributeViewColumnOptions(operation *Operation) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 移除空选项 https://github.com/siyuan-note/siyuan/issues/15533
|
||||||
|
var tmp []*av.SelectOption
|
||||||
|
for _, opt := range options {
|
||||||
|
if "" != opt.Name {
|
||||||
|
tmp = append(tmp, opt)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
options = tmp
|
||||||
|
if 1 > len(options) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for _, keyValues := range attrView.KeyValues {
|
for _, keyValues := range attrView.KeyValues {
|
||||||
if keyValues.Key.ID == operation.ID {
|
if keyValues.Key.ID == operation.ID {
|
||||||
keyValues.Key.Options = options
|
keyValues.Key.Options = options
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue