From 6d59de2577845ddaec64016e0e231899eae6e7df Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 2 Aug 2023 12:27:48 +0800 Subject: [PATCH 1/4] :art: Update av https://github.com/siyuan-note/insider/issues/1117 --- kernel/av/table.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/kernel/av/table.go b/kernel/av/table.go index 8f96c262e..447a7d03f 100644 --- a/kernel/av/table.go +++ b/kernel/av/table.go @@ -123,6 +123,9 @@ func (value *Value) Compare(other *Value) int { } return strings.Compare(v1, v2) } + if nil != value.URL && nil != other.URL { + return strings.Compare(value.URL.Content, other.URL.Content) + } return 0 } @@ -238,6 +241,28 @@ func (value *Value) CompareOperator(other *Value, operator FilterOperator) bool return 0 != len(value.MSelect) && !(1 == len(value.MSelect) && "" == value.MSelect[0].Content) } } + + if nil != value.URL && nil != other.URL { + switch operator { + case FilterOperatorIsEqual: + return value.URL.Content == other.URL.Content + case FilterOperatorIsNotEqual: + return value.URL.Content != other.URL.Content + case FilterOperatorContains: + return strings.Contains(value.URL.Content, other.URL.Content) + case FilterOperatorDoesNotContain: + return !strings.Contains(value.URL.Content, other.URL.Content) + case FilterOperatorStartsWith: + return strings.HasPrefix(value.URL.Content, other.URL.Content) + case FilterOperatorEndsWith: + return strings.HasSuffix(value.URL.Content, other.URL.Content) + case FilterOperatorIsEmpty: + return "" == strings.TrimSpace(value.URL.Content) + case FilterOperatorIsNotEmpty: + return "" != strings.TrimSpace(value.URL.Content) + } + } + return true } From 8fb83d115691f8b0b9a22e638cb3f47c338832a1 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 2 Aug 2023 12:33:17 +0800 Subject: [PATCH 2/4] :art: Update av https://github.com/siyuan-note/insider/issues/1110 --- kernel/model/attribute_view.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index bf6f758fe..064265059 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -757,7 +757,7 @@ func updateAttributeViewColumn(operation *Operation) (err error) { colType := av.KeyType(operation.Typ) switch colType { - case av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL: + case av.KeyTypeBlock, av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL: for _, keyValues := range attrView.KeyValues { if keyValues.Key.ID == operation.ID { keyValues.Key.Name = operation.Name From cf06f74e1bfab3a8a588761e4bc0b20a82237a7b Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 2 Aug 2023 12:36:35 +0800 Subject: [PATCH 3/4] :art: Update av https://github.com/siyuan-note/insider/issues/1110 --- kernel/av/table.go | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/kernel/av/table.go b/kernel/av/table.go index 447a7d03f..61e51e1d5 100644 --- a/kernel/av/table.go +++ b/kernel/av/table.go @@ -135,7 +135,24 @@ func (value *Value) CompareOperator(other *Value, operator FilterOperator) bool } if nil != value.Block && nil != other.Block { - return strings.Contains(value.Block.Content, other.Block.Content) + switch operator { + case FilterOperatorIsEqual: + return value.Block.Content == other.Block.Content + case FilterOperatorIsNotEqual: + return value.Block.Content != other.Block.Content + case FilterOperatorContains: + return strings.Contains(value.Block.Content, other.Block.Content) + case FilterOperatorDoesNotContain: + return !strings.Contains(value.Block.Content, other.Block.Content) + case FilterOperatorStartsWith: + return strings.HasPrefix(value.Block.Content, other.Block.Content) + case FilterOperatorEndsWith: + return strings.HasSuffix(value.Block.Content, other.Block.Content) + case FilterOperatorIsEmpty: + return "" == strings.TrimSpace(value.Block.Content) + case FilterOperatorIsNotEmpty: + return "" != strings.TrimSpace(value.Block.Content) + } } if nil != value.Text && nil != other.Text { @@ -326,11 +343,6 @@ func (table *Table) SortRows() { sort.Slice(table.Rows, func(i, j int) bool { for _, colIndexSort := range colIndexSorts { - c := table.Columns[colIndexSort.Index] - if c.Type == KeyTypeBlock { - continue - } - result := table.Rows[i].Cells[colIndexSort.Index].Value.Compare(table.Rows[j].Cells[colIndexSort.Index].Value) if 0 == result { continue From 77350cabdf5ea366ed7d72ce5324c885cca3acf8 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 2 Aug 2023 12:42:03 +0800 Subject: [PATCH 4/4] :art: Update text --- app/src/layout/dock/Inbox.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/layout/dock/Inbox.ts b/app/src/layout/dock/Inbox.ts index 6579a8053..98e8c5d32 100644 --- a/app/src/layout/dock/Inbox.ts +++ b/app/src/layout/dock/Inbox.ts @@ -301,7 +301,7 @@ ${(Lute.New()).MarkdownStr("", data.shorthandContent)} if (needSubscribe("")) { this.element.lastElementChild.innerHTML = `
收集箱
查看使用说明
+ 打开帮助文档搜索 收集箱
查看使用说明