feat: show user display name when searching for assignees on a list
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2022-09-07 17:05:44 +02:00
parent 2e84c27d1e
commit 65fd2f14a0
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 1 deletions

View File

@ -10,7 +10,7 @@
@search="findUser"
:search-results="foundUsers"
@select="addAssignee"
label="username"
label="name"
:select-placeholder="$t('task.assignee.selectPlaceholder')"
v-model="assignees"
ref="multiselect"
@ -106,6 +106,11 @@ async function findUser(query: string) {
// Filter the results to not include users who are already assigned
foundUsers.value = response.filter(({id}) => !includesById(assignees.value, id))
.map(u => {
// Users may not have a display name set, so we fall back on the username in that case
u.name = u.name === '' ? u.username : u.name
return u
})
}
function clearAllFoundUsers() {