M src/store.js => src/store.js +10 -0
@@ 31,6 31,7 @@ export default {
id: null,
name: 'unknown',
invites: [],
+ membersNameMap: {},
},
invites: [],
haveTeamInfo: false,
@@ 115,6 116,10 @@ export default {
.then(async(response) => {
if (response.status === 200) {
this.team = await response.json();
+ this.team.membersNameMap = {};
+ this.team.members.forEach(m => {
+ this.team.membersNameMap[m.member] = m.displayName;
+ });
this.haveTeamInfo = true;
} else if (response.status === 204){
this.team = null;
@@ 124,6 129,11 @@ export default {
});
},
+ mapUserName: function(username) {
+ const displayName = this.team.membersNameMap[username];
+ return displayName || username;
+ },
+
choreById: function(choreId) {
return this.chores.find(chore => chore.id === choreId);
},
M src/views/Dashboard.vue => src/views/Dashboard.vue +4 -1
@@ 50,7 50,7 @@
<NcUserBubble
:size="36"
:user="chore.assignee"
- :displayName="chore.assignee"
+ :displayName="getUserDisplayName(chore.assignee)"
/>
</td>
<td class="cell-due">
@@ 176,6 176,9 @@ export default {
this.store.submitWork(choreId);
this.closeConfirmModal();
},
+ getUserDisplayName(username) {
+ return this.store.mapUserName(username);
+ },
gotoLink(choreId) {
this.$router.push(this.getLink(choreId));
},