1
0

fix(filter): correctly replace project title in filter query

Resolves https://community.vikunja.io/t/filter-option-to-exclude-a-tag-project-etc/1523/6
This commit is contained in:
kolaente 2024-03-10 18:32:15 +01:00
parent ca0de680ad
commit 22dcedcd7d
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
3 changed files with 5 additions and 4 deletions

View File

@ -211,9 +211,9 @@ function handleFieldInput() {
function autocompleteSelect(value) { function autocompleteSelect(value) {
filterQuery.value = filterQuery.value.substring(0, autocompleteMatchPosition.value + 1) + filterQuery.value = filterQuery.value.substring(0, autocompleteMatchPosition.value + 1) +
(autocompleteResultType.value === 'labels' (autocompleteResultType.value === 'assignees'
? value.title ? value.username
: value.username) + : value.title) +
filterQuery.value.substring(autocompleteMatchPosition.value + autocompleteMatchText.value.length + 1) filterQuery.value.substring(autocompleteMatchPosition.value + autocompleteMatchText.value.length + 1)
autocompleteResults.value = [] autocompleteResults.value = []

View File

@ -88,7 +88,7 @@ watchDebounced(
val.filter = transformFilterStringFromApi( val.filter = transformFilterStringFromApi(
val?.filter || '', val?.filter || '',
labelId => labelStore.getLabelById(labelId)?.title, labelId => labelStore.getLabelById(labelId)?.title,
projectId => projectStore.projects.value[projectId]?.title || null, projectId => projectStore.projects[projectId]?.title || null,
) )
params.value = val params.value = val
}, },

View File

@ -33,6 +33,7 @@ export const AVAILABLE_FILTER_FIELDS = [
...DATE_FIELDS, ...DATE_FIELDS,
...ASSIGNEE_FIELDS, ...ASSIGNEE_FIELDS,
...LABEL_FIELDS, ...LABEL_FIELDS,
...PROJECT_FIELDS,
] ]
export const FILTER_OPERATORS = [ export const FILTER_OPERATORS = [