mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-02 05:31:47 +01:00
Add database lineNumber field type (#11008)
* 🎨 add database lineNumber type * 🎨 fix https://github.com/siyuan-note/siyuan/issues/10896 * 🎨 Improve mobile app appearance language https://github.com/siyuan-note/siyuan/issues/11009 * 🎨 Improve database template field calc https://github.com/siyuan-note/siyuan/issues/11011 * ⬆️ Upgrade kernel deps * ⬆️ Upgrade kernel deps * 🎨 fix https://github.com/siyuan-note/siyuan/issues/10896 * 🎨 fix https://github.com/siyuan-note/siyuan/issues/10896 * 🐛 https://github.com/siyuan-note/siyuan/issues/11015 * 🐛 https://github.com/siyuan-note/siyuan/issues/11018 * 🐛 https://github.com/siyuan-note/siyuan/issues/11018 * 🎨 刚创建时无 id,更新需和 oldValue 保持一致 * 🐛 Database date field between filter calculation error Fix https://github.com/siyuan-note/siyuan/issues/10979 * 🐛 Primary key value unexpectedly updated when database adds row https://github.com/siyuan-note/siyuan/issues/11018 * 🎨 https://github.com/siyuan-note/siyuan/issues/11013 * 🎨 搜索可汇总字段时排除行号类型字段 https://github.com/siyuan-note/siyuan/pull/11008 * 🎨 lineNumber no need to join the calc op and remove useless todo tag --------- Co-authored-by: Vanessa <lly219@gmail.com> Co-authored-by: Daniel <845765@qq.com>
This commit is contained in:
parent
afeea6a80e
commit
8a354da50a
16 changed files with 224 additions and 108 deletions
|
|
@ -64,22 +64,23 @@ func (kValues *KeyValues) GetValue(blockID string) (ret *Value) {
|
|||
type KeyType string
|
||||
|
||||
const (
|
||||
KeyTypeBlock KeyType = "block"
|
||||
KeyTypeText KeyType = "text"
|
||||
KeyTypeNumber KeyType = "number"
|
||||
KeyTypeDate KeyType = "date"
|
||||
KeyTypeSelect KeyType = "select"
|
||||
KeyTypeMSelect KeyType = "mSelect"
|
||||
KeyTypeURL KeyType = "url"
|
||||
KeyTypeEmail KeyType = "email"
|
||||
KeyTypePhone KeyType = "phone"
|
||||
KeyTypeMAsset KeyType = "mAsset"
|
||||
KeyTypeTemplate KeyType = "template"
|
||||
KeyTypeCreated KeyType = "created"
|
||||
KeyTypeUpdated KeyType = "updated"
|
||||
KeyTypeCheckbox KeyType = "checkbox"
|
||||
KeyTypeRelation KeyType = "relation"
|
||||
KeyTypeRollup KeyType = "rollup"
|
||||
KeyTypeBlock KeyType = "block"
|
||||
KeyTypeText KeyType = "text"
|
||||
KeyTypeNumber KeyType = "number"
|
||||
KeyTypeDate KeyType = "date"
|
||||
KeyTypeSelect KeyType = "select"
|
||||
KeyTypeMSelect KeyType = "mSelect"
|
||||
KeyTypeURL KeyType = "url"
|
||||
KeyTypeEmail KeyType = "email"
|
||||
KeyTypePhone KeyType = "phone"
|
||||
KeyTypeMAsset KeyType = "mAsset"
|
||||
KeyTypeTemplate KeyType = "template"
|
||||
KeyTypeCreated KeyType = "created"
|
||||
KeyTypeUpdated KeyType = "updated"
|
||||
KeyTypeCheckbox KeyType = "checkbox"
|
||||
KeyTypeRelation KeyType = "relation"
|
||||
KeyTypeRollup KeyType = "rollup"
|
||||
KeyTypeLineNumber KeyType = "lineNumber"
|
||||
)
|
||||
|
||||
// Key 描述了属性视图属性列的基础结构。
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ func SearchAttributeViewNonRelationKey(avID, keyword string) (ret []*av.Key) {
|
|||
}
|
||||
|
||||
for _, keyValues := range attrView.KeyValues {
|
||||
if av.KeyTypeRelation != keyValues.Key.Type && av.KeyTypeRollup != keyValues.Key.Type && av.KeyTypeTemplate != keyValues.Key.Type && av.KeyTypeCreated != keyValues.Key.Type && av.KeyTypeUpdated != keyValues.Key.Type {
|
||||
if av.KeyTypeRelation != keyValues.Key.Type && av.KeyTypeRollup != keyValues.Key.Type && av.KeyTypeTemplate != keyValues.Key.Type && av.KeyTypeCreated != keyValues.Key.Type && av.KeyTypeUpdated != keyValues.Key.Type && av.KeyTypeLineNumber != keyValues.Key.Type {
|
||||
if strings.Contains(strings.ToLower(keyValues.Key.Name), strings.ToLower(keyword)) {
|
||||
ret = append(ret, keyValues.Key)
|
||||
}
|
||||
|
|
@ -2654,7 +2654,7 @@ func AddAttributeViewKey(avID, keyID, keyName, keyType, keyIcon, previousKeyID s
|
|||
switch keyTyp {
|
||||
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,
|
||||
av.KeyTypeRelation, av.KeyTypeRollup:
|
||||
av.KeyTypeRelation, av.KeyTypeRollup, av.KeyTypeLineNumber:
|
||||
|
||||
key := av.NewKey(keyID, keyName, keyIcon, keyTyp)
|
||||
if av.KeyTypeRollup == keyTyp {
|
||||
|
|
@ -2766,7 +2766,7 @@ func updateAttributeViewColumn(operation *Operation) (err error) {
|
|||
switch colType {
|
||||
case av.KeyTypeBlock, 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,
|
||||
av.KeyTypeRelation, av.KeyTypeRollup:
|
||||
av.KeyTypeRelation, av.KeyTypeRollup, av.KeyTypeLineNumber:
|
||||
for _, keyValues := range attrView.KeyValues {
|
||||
if keyValues.Key.ID == operation.ID {
|
||||
keyValues.Key.Name = strings.TrimSpace(operation.Name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue