Global search development

* Add translation tags
* Use translation tags for showing result count
* Add logic for selecting cards by labels
* Readd code for searching card text that was mistakenly deleted
This commit is contained in:
John R. Supplee 2021-01-13 16:52:56 +02:00
parent a647768368
commit 25dc779a73
5 changed files with 77 additions and 9 deletions

View file

@ -17,8 +17,12 @@ template(name="globalSearch")
else if hasResults.get
.global-search-dueat-list-wrapper
h1
= resultsCount.get
| Results
if $eq resultCount.get 0
| {{_ 'no-results' }}
else if $eq resultCount.get 1
| {{_ 'one-result' }}
else
| {{_ 'n-results' resultsCount.get }}
if queryErrors.get
div
each msg in errorMessages

View file

@ -104,7 +104,7 @@ BlazeComponent.extendComponent({
const reLabel = /^#(?<label>[\w:-]+)(\s+|$)/;
const reOperator1 = /^(?<operator>\w+):(?<value>\w+)(\s+|$)/;
const reOperator2 = /^(?<operator>\w+):(?<quote>["']*)(?<value>.*?)\k<quote>(\s+|$)/;
const reText = /^(?<text>[^:@#\s]+)(\s+|$)/;
const reText = /^(?<text>\S+)(\s+|$)/;
const reQuotedText = /^(?<quote>["'])(?<text>\w+)\k<quote>(\s+|$)/;
const operatorMap = {
board: 'boards',