fix(filter): correctly replace project title in filter query
continuous-integration/drone/push Build is failing Details

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
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 5 additions and 4 deletions

View File

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

View File

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

View File

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