From 65fd2f14a067ea9d79b352af00f3c316be883fdf Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 7 Sep 2022 17:05:44 +0200 Subject: [PATCH] feat: show user display name when searching for assignees on a list --- src/components/tasks/partials/editAssignees.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/tasks/partials/editAssignees.vue b/src/components/tasks/partials/editAssignees.vue index bb21fd57..09e96e3f 100644 --- a/src/components/tasks/partials/editAssignees.vue +++ b/src/components/tasks/partials/editAssignees.vue @@ -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() {