Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

Vanessa 1 rok pred
rodič
commit
d0b9368bf0

+ 1 - 1
app/src/layout/dock/Inbox.ts

@@ -301,7 +301,7 @@ ${(Lute.New()).MarkdownStr("", data.shorthandContent)}
         if (needSubscribe("")) {
         if (needSubscribe("")) {
             this.element.lastElementChild.innerHTML = `<ul class="b3-list b3-list--background">
             this.element.lastElementChild.innerHTML = `<ul class="b3-list b3-list--background">
     <li class="b3-list--empty">
     <li class="b3-list--empty">
-        相关功能可打开帮助文档搜索 <code>收集箱</code> 查看使用说明
+        打开帮助文档搜索 <code>收集箱</code> 查看使用说明
     </li>
     </li>
     <li class="b3-list--empty">
     <li class="b3-list--empty">
         ${window.siyuan.config.system.container === "ios" ? window.siyuan.languages._kernel[122] : window.siyuan.languages._kernel[29].replace("${url}", getCloudURL("subscribe/siyuan"))}
         ${window.siyuan.config.system.container === "ios" ? window.siyuan.languages._kernel[122] : window.siyuan.languages._kernel[29].replace("${url}", getCloudURL("subscribe/siyuan"))}

+ 43 - 6
kernel/av/table.go

@@ -123,6 +123,9 @@ func (value *Value) Compare(other *Value) int {
 		}
 		}
 		return strings.Compare(v1, v2)
 		return strings.Compare(v1, v2)
 	}
 	}
+	if nil != value.URL && nil != other.URL {
+		return strings.Compare(value.URL.Content, other.URL.Content)
+	}
 	return 0
 	return 0
 }
 }
 
 
@@ -132,7 +135,24 @@ func (value *Value) CompareOperator(other *Value, operator FilterOperator) bool
 	}
 	}
 
 
 	if nil != value.Block && nil != other.Block {
 	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 {
 	if nil != value.Text && nil != other.Text {
@@ -238,6 +258,28 @@ func (value *Value) CompareOperator(other *Value, operator FilterOperator) bool
 			return 0 != len(value.MSelect) && !(1 == len(value.MSelect) && "" == value.MSelect[0].Content)
 			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
 	return true
 }
 }
 
 
@@ -301,11 +343,6 @@ func (table *Table) SortRows() {
 
 
 	sort.Slice(table.Rows, func(i, j int) bool {
 	sort.Slice(table.Rows, func(i, j int) bool {
 		for _, colIndexSort := range colIndexSorts {
 		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)
 			result := table.Rows[i].Cells[colIndexSort.Index].Value.Compare(table.Rows[j].Cells[colIndexSort.Index].Value)
 			if 0 == result {
 			if 0 == result {
 				continue
 				continue

+ 1 - 1
kernel/model/attribute_view.go

@@ -757,7 +757,7 @@ func updateAttributeViewColumn(operation *Operation) (err error) {
 
 
 	colType := av.KeyType(operation.Typ)
 	colType := av.KeyType(operation.Typ)
 	switch colType {
 	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 {
 		for _, keyValues := range attrView.KeyValues {
 			if keyValues.Key.ID == operation.ID {
 			if keyValues.Key.ID == operation.ID {
 				keyValues.Key.Name = operation.Name
 				keyValues.Key.Name = operation.Name