From e4e9a255f6b68eb90a3010216705d8353cc12b93 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 15 May 2024 20:10:45 +0800 Subject: [PATCH 1/4] :art: Clean code --- app/src/mobile/settings/editor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/mobile/settings/editor.ts b/app/src/mobile/settings/editor.ts index 2f46c1e46..69106bcb9 100644 --- a/app/src/mobile/settings/editor.ts +++ b/app/src/mobile/settings/editor.ts @@ -14,9 +14,9 @@ const setEditor = (modelMainElement: Element) => { dynamicLoadBlocks = 1024; (modelMainElement.querySelector("#dynamicLoadBlocks") as HTMLInputElement).value = "1024"; } - window.siyuan.config.editor.markdown= { + window.siyuan.config.editor.markdown = { inlineSup: (modelMainElement.querySelector("#editorMarkdownInlineSup") as HTMLInputElement).checked, - inlineSub: (modelMainElement.querySelector("#editorMarkdownInlineSub") as HTMLInputElement).checked, + inlineSub: (modelMainElement.querySelector("#editorMarkdownInlineSub") as HTMLInputElement).checked, inlineTag: (modelMainElement.querySelector("#editorMarkdownInlineTag") as HTMLInputElement).checked, inlineMath: (modelMainElement.querySelector("#editorMarkdownInlineMath") as HTMLInputElement).checked }; From f205ab38df1db0df03b441e2c9aa9fb68e52a905 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 15 May 2024 20:54:43 +0800 Subject: [PATCH 2/4] :hammer: Downgrades the glibc 2.31 version to solve booting failed on Linux https://github.com/siyuan-note/siyuan/issues/11417 --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f8d857eaf..d6f67a927 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -92,7 +92,7 @@ jobs: strategy: matrix: config: - - os: ubuntu-22.04 + - os: ubuntu-20.04 name: ubuntu build linux.AppImage kernel_path: "../app/kernel-linux/SiYuan-Kernel" build_args_prefix: "-s -w -X" @@ -101,7 +101,7 @@ jobs: goos: "linux" goarch: "amd64" suffix: "linux.AppImage" - - os: ubuntu-22.04 + - os: ubuntu-20.04 name: ubuntu build linux.tar.gz kernel_path: "../app/kernel-linux/SiYuan-Kernel" build_args_prefix: "-s -w -X" From 718260379133ea933ce677b203bc53d56c6176b8 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 15 May 2024 22:10:26 +0800 Subject: [PATCH 3/4] :bug: The selection options are inconsistent after pasting data into the database https://github.com/siyuan-note/siyuan/issues/11409 --- kernel/av/av.go | 10 ++++++++++ kernel/model/attribute_view.go | 19 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/kernel/av/av.go b/kernel/av/av.go index a9242f4f6..f28ef2bad 100644 --- a/kernel/av/av.go +++ b/kernel/av/av.go @@ -120,6 +120,16 @@ func NewKey(id, name, icon string, keyType KeyType) *Key { } } +func (k *Key) GetOption(name string) (ret *SelectOption) { + for _, option := range k.Options { + if option.Name == name { + ret = option + return + } + } + return +} + type Date struct { AutoFillNow bool `json:"autoFillNow"` // 是否自动填充当前时间 The database date field supports filling the current time by default https://github.com/siyuan-note/siyuan/issues/10823 } diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 64c1d93af..cf4781d61 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -2704,7 +2704,7 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string, } if nil == val { - val = &av.Value{ID: cellID, KeyID: keyValues.Key.ID, BlockID: rowID, Type: keyValues.Key.Type, CreatedAt: now, UpdatedAt: now} + val = &av.Value{ID: cellID, KeyID: keyID, BlockID: rowID, Type: keyValues.Key.Type, CreatedAt: now, UpdatedAt: now} keyValues.Values = append(keyValues.Values, val) } break @@ -2728,6 +2728,8 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string, return } + key, _ := attrView.GetKey(keyID) + if av.KeyTypeNumber == val.Type { if nil != val.Number && !val.Number.IsNotEmpty { val.Number.Content = 0 @@ -2738,6 +2740,20 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string, val.Date.Content = 0 val.Date.FormattedContent = "" } + } else if av.KeyTypeSelect == val.Type || av.KeyTypeMSelect == val.Type { + if nil != key && 0 < len(val.MSelect) { + // The selection options are inconsistent after pasting data into the database https://github.com/siyuan-note/siyuan/issues/11409 + for _, valOpt := range val.MSelect { + if opt := key.GetOption(valOpt.Content); nil == opt { + // 不存在的选项新建保存 + opt = &av.SelectOption{Name: valOpt.Content, Color: valOpt.Color} + key.Options = append(key.Options, opt) + } else { + // 已经存在的选项颜色需要保持不变 + valOpt.Color = opt.Color + } + } + } } relationChangeMode := 0 // 0:不变(仅排序),1:增加,2:减少 @@ -2800,7 +2816,6 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string, } val.SetUpdatedAt(now) - key, _ := attrView.GetKey(val.KeyID) if nil != key && av.KeyTypeRelation == key.Type && nil != key.Relation && key.Relation.IsTwoWay { // 双向关联需要同时更新目标字段的值 From ab1fc9366fbdf712925cf0a8b0f07acad0eeeff8 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 15 May 2024 22:54:44 +0800 Subject: [PATCH 4/4] :memo: Update README https://github.com/siyuan-note/siyuan/pull/11422 --- README.md | 4 ++-- README_zh_CN.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 04cdc7a88..a999b715d 100644 --- a/README.md +++ b/README.md @@ -253,11 +253,11 @@ Template reference: ``` Web UI: 6806 Container Port: 6806 +Container Path: /home/siyuan Host path: /mnt/user/appdata/siyuan -Container Path: /siyuan/workspace PUID: 1000 PGID: 1000 -Publish parameters: --workspace=/siyuan/workspace/ --accessAuthCode=******(Access authorization code) +Publish parameters: --accessAuthCode=******(Access authorization code) ``` diff --git a/README_zh_CN.md b/README_zh_CN.md index cec62dc01..a99fd4e99 100644 --- a/README_zh_CN.md +++ b/README_zh_CN.md @@ -256,11 +256,11 @@ services: ``` Web UI: 6806 Container Port: 6806 +Container Path: /home/siyuan Host path: /mnt/user/appdata/siyuan -Container Path: /siyuan/workspace PUID: 1000 PGID: 1000 -Publish parameters: --workspace=/siyuan/workspace/ --accessAuthCode=******(访问授权码) +Publish parameters: --accessAuthCode=******(访问授权码) ```