fix(quick actions): don't show projects when searching for labels or tasks

This commit is contained in:
kolaente 2023-08-29 12:38:59 +02:00
parent d57e1909c4
commit 4e6b99544e
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -48,7 +48,7 @@
<x-label :label="i"/> <x-label :label="i"/>
</template> </template>
<template v-else-if="r.type === ACTION_TYPE.TASK"> <template v-else-if="r.type === ACTION_TYPE.TASK">
<single-task-inline-readonly <single-task-inline-readonly
:task="i" :task="i"
:show-project="true" :show-project="true"
/> />
@ -148,12 +148,18 @@ function closeQuickActions() {
} }
const foundProjects = computed(() => { const foundProjects = computed(() => {
const {project, text} = parsedQuery.value const {project, text, labels, assignees} = parsedQuery.value
if (
searchMode.value === SEARCH_MODE.ALL || if (project !== null) {
searchMode.value === SEARCH_MODE.PROJECTS || return projectStore.searchProject(project ?? text)
text === '' .filter(p => Boolean(p))
) { }
if (labels.length > 0 || assignees.length > 0) {
return []
}
if (text === '') {
const history = getHistory() const history = getHistory()
return history.map((p) => projectStore.projects[p.id]) return history.map((p) => projectStore.projects[p.id])
.filter(p => Boolean(p)) .filter(p => Boolean(p))