Skip to content

Commit

Permalink
Merge pull request #912 from oslokommune/fix-team-member-display-name
Browse files Browse the repository at this point in the history
Fix display name computation in team member list
  • Loading branch information
simenheg authored Nov 7, 2023
2 parents 3ab226e + a3ddc67 commit 6d7959e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/RoleMembers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="role-group__members-list">
<span v-for="member in membersWithRole" :key="member.id" class="role-group__member">
<pkt-button size="small" skin="tertiary" @onClick="openProfileModal(member.id)">
{{ member.displayName || firstPartOfEmail(member.id) }}
{{ displayName(member) }}
</pkt-button>
</span>
</div>
Expand Down Expand Up @@ -33,8 +33,8 @@ export default {
},
methods: {
firstPartOfEmail(email) {
return email.replace(/@.*/, '');
displayName(member) {
return member.displayName || member.id?.replace(/@.*/, '') || '';
},
openProfileModal(profileId) {
Expand Down

0 comments on commit 6d7959e

Please sign in to comment.