Skip to content

Commit

Permalink
fix: Properly show displayname and status depending on type
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Aug 2, 2024
1 parent 55a8b01 commit 4328a30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/shared/components/ncTable/partials/TableCellUsergroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="value">
<div v-for="item in value" :key="item.id" class="inline usergroup-entry">
<NcUserBubble :user="item.id" :is-no-user="item.type !== 0" :display-name="item.displayName ?? item.id" :show-user-status="column.showUserStatus" :size="column.showUserStatus ? 34 : 20" :primary="isCurrentUser(item)" />
<NcUserBubble :user="item.id" :avatar-image="item.type === 1 ? 'icon-group' : undefined" :is-no-user="item.type !== 0" :display-name="item.displayName ?? item.id" :show-user-status="isUser(item) && column.showUserStatus" :size="column.showUserStatus ? 34 : 20" :primary="isCurrentUser(item)" />
</div>
</div>
</template>
Expand Down Expand Up @@ -34,7 +34,10 @@ export default {
},
computed: {
isCurrentUser() {
return (user) => user.type === 0 && user.id === currentUser?.uid
return (item) => this.isUser(item) && item.id === currentUser?.uid
},
isUser() {
return (item) => item.type === 0
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<RowFormWrapper :title="column.title" :mandatory="column.mandatory" :description="column.description" :width="2">
<NcSelect v-model="localValue" style="width: 100%;" :loading="loading" :options="options"
:placeholder="getPlaceholder()" :searchable="true" :get-option-key="(option) => option.key"
label="id" :aria-label-combobox="getPlaceholder()"
label="displayName" :aria-label-combobox="getPlaceholder()"
:user-select="true"
:close-on-select="false" :multiple="column.usergroupMultipleItems" data-cy="usergroupRowSelect"
@search="asyncFind" @input="addItem">
Expand Down Expand Up @@ -75,6 +75,7 @@ export default {
id: autocompleteResult.id,
type: autocompleteResult.source.startsWith('users') ? 0 : 1,
key: autocompleteResult.id,
displayName: autocompleteResult.label,
}
},
Expand Down

0 comments on commit 4328a30

Please sign in to comment.