forked from vikunja/frontend
feat: use task parsing to search for lists
This commit is contained in:
parent
a404e42b2b
commit
912746ac08
|
@ -109,11 +109,6 @@ export default {
|
||||||
results() {
|
results() {
|
||||||
let lists = []
|
let lists = []
|
||||||
if (this.searchMode === SEARCH_MODE_ALL || this.searchMode === SEARCH_MODE_LISTS) {
|
if (this.searchMode === SEARCH_MODE_ALL || this.searchMode === SEARCH_MODE_LISTS) {
|
||||||
let query = this.query
|
|
||||||
if (this.searchMode === SEARCH_MODE_LISTS) {
|
|
||||||
query = query.substr(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
const ncache = {}
|
const ncache = {}
|
||||||
|
|
||||||
const history = getHistory()
|
const history = getHistory()
|
||||||
|
@ -124,7 +119,9 @@ export default {
|
||||||
}),
|
}),
|
||||||
...Object.values(this.$store.state.lists)])]
|
...Object.values(this.$store.state.lists)])]
|
||||||
|
|
||||||
lists = (allLists.filter(l => {
|
const {list} = this.parsedQuery
|
||||||
|
|
||||||
|
lists = list === null ? [] : (allLists.filter(l => {
|
||||||
if (typeof l === 'undefined' || l === null) {
|
if (typeof l === 'undefined' || l === null) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -141,7 +138,7 @@ export default {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return l.title.toLowerCase().includes(query.toLowerCase())
|
return l.title.toLowerCase().includes(list.toLowerCase())
|
||||||
}) ?? [])
|
}) ?? [])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,10 +246,10 @@ export default {
|
||||||
if (this.query.startsWith('#')) {
|
if (this.query.startsWith('#')) {
|
||||||
return SEARCH_MODE_TASKS
|
return SEARCH_MODE_TASKS
|
||||||
}
|
}
|
||||||
if (this.query.startsWith('*')) {
|
if (assignees.length === 0 && list !== null && text === '' && labels.length === 0) {
|
||||||
return SEARCH_MODE_LISTS
|
return SEARCH_MODE_LISTS
|
||||||
}
|
}
|
||||||
if (assignees.length > 0 && list === '' && text === '' && labels.length === 0) {
|
if (assignees.length > 0 && list === null && text === '' && labels.length === 0) {
|
||||||
return SEARCH_MODE_TEAMS
|
return SEARCH_MODE_TEAMS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user