mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: allow to filter memos with resources (#1299)
This commit is contained in:
@@ -43,6 +43,10 @@ export const filterConsts = {
|
|||||||
text: "filter.value.linked",
|
text: "filter.value.linked",
|
||||||
value: "LINKED",
|
value: "LINKED",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: "filter.value.has-attachment",
|
||||||
|
value: "HAS_ATTACHMENT",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
TEXT: {
|
TEXT: {
|
||||||
@@ -179,6 +183,8 @@ export const checkShouldShowMemo = (memo: Memo, filter: Filter) => {
|
|||||||
matched = true;
|
matched = true;
|
||||||
} else if (value === "LINKED" && memo.content.match(LINK_REG) !== null) {
|
} else if (value === "LINKED" && memo.content.match(LINK_REG) !== null) {
|
||||||
matched = true;
|
matched = true;
|
||||||
|
} else if (value === "HAS_ATTACHMENT" && memo.resourceList.length > 0) {
|
||||||
|
matched = true;
|
||||||
}
|
}
|
||||||
if (operator === "IS_NOT") {
|
if (operator === "IS_NOT") {
|
||||||
matched = !matched;
|
matched = !matched;
|
||||||
|
@@ -136,7 +136,8 @@
|
|||||||
},
|
},
|
||||||
"value": {
|
"value": {
|
||||||
"not-tagged": "No tags",
|
"not-tagged": "No tags",
|
||||||
"linked": "Has links"
|
"linked": "Has links",
|
||||||
|
"has-attachment": "Has attachments"
|
||||||
},
|
},
|
||||||
"text-placeholder": "Starts with ^ to use regex"
|
"text-placeholder": "Starts with ^ to use regex"
|
||||||
},
|
},
|
||||||
|
@@ -136,7 +136,8 @@
|
|||||||
},
|
},
|
||||||
"value": {
|
"value": {
|
||||||
"not-tagged": "无标签",
|
"not-tagged": "无标签",
|
||||||
"linked": "包含链接"
|
"linked": "包含链接",
|
||||||
|
"has-attachment": "包含附件"
|
||||||
},
|
},
|
||||||
"text-placeholder": "以 ^ 开头使用正则表达式"
|
"text-placeholder": "以 ^ 开头使用正则表达式"
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user