feat: show user display name when searching for assignees on a list
This commit is contained in:
parent
2e84c27d1e
commit
65fd2f14a0
1 changed files with 6 additions and 1 deletions
|
@ -10,7 +10,7 @@
|
||||||
@search="findUser"
|
@search="findUser"
|
||||||
:search-results="foundUsers"
|
:search-results="foundUsers"
|
||||||
@select="addAssignee"
|
@select="addAssignee"
|
||||||
label="username"
|
label="name"
|
||||||
:select-placeholder="$t('task.assignee.selectPlaceholder')"
|
:select-placeholder="$t('task.assignee.selectPlaceholder')"
|
||||||
v-model="assignees"
|
v-model="assignees"
|
||||||
ref="multiselect"
|
ref="multiselect"
|
||||||
|
@ -106,6 +106,11 @@ async function findUser(query: string) {
|
||||||
|
|
||||||
// Filter the results to not include users who are already assigned
|
// Filter the results to not include users who are already assigned
|
||||||
foundUsers.value = response.filter(({id}) => !includesById(assignees.value, id))
|
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() {
|
function clearAllFoundUsers() {
|
||||||
|
|
Loading…
Reference in a new issue