fix(filters): correctly replace values when clicking on an autocomplete result
continuous-integration/drone/push Build is failing Details

Related #2194
This commit is contained in:
kolaente 2024-03-14 09:02:57 +01:00
parent c8b35d49ca
commit 6cf3a578c0
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 11 additions and 1 deletions

View File

@ -222,7 +222,7 @@ function handleFieldInput() {
autocompleteResults.value = projectStore.searchProject(search)
}
autocompleteMatchText.value = keyword
autocompleteMatchPosition.value = prefix.length - 1 + keyword.replace(search, '').length
autocompleteMatchPosition.value = match.index + prefix.length - 1 + keyword.replace(search, '').length
}
}
})

View File

@ -107,6 +107,16 @@ describe('Filter Transformation', () => {
expect(transformed).toBe('project = 1')
})
it('should resolve project and labels independently', () => {
const transformed = transformFilterStringForApi(
'project = lorem && labels = ipsum',
multipleDummyResolver,
multipleDummyResolver,
)
expect(transformed).toBe('project = 1 && labels = 2')
})
})
describe('To API', () => {