mirror of
https://github.com/wekan/wekan.git
synced 2025-12-23 10:50:13 +01:00
User mentions now return @username (full name) - part 2
This commit is contained in:
parent
a160b662ef
commit
4589c3df15
1 changed files with 12 additions and 15 deletions
|
|
@ -22,25 +22,22 @@ BlazeComponent.extendComponent({
|
||||||
const user = Users.findOne(member.userId);
|
const user = Users.findOne(member.userId);
|
||||||
const username = user.username;
|
const username = user.username;
|
||||||
const fullName = user.profile && user.profile !== undefined && user.profile.fullname ? user.profile.fullname : "";
|
const fullName = user.profile && user.profile !== undefined && user.profile.fullname ? user.profile.fullname : "";
|
||||||
// return username.includes(term) || fullName.includes(term) ? fullName + "(" + username + ")" : null;
|
return username.includes(term) || fullName.includes(term) ? user : null;
|
||||||
if (username.includes(term) || fullName.includes(term)) {
|
|
||||||
if (fullName) {
|
|
||||||
return username + " (" + fullName + ")";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return username;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
})
|
})
|
||||||
.filter(Boolean), [...specialHandleNames])
|
.filter(Boolean), [...specialHandles])
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
template(value) {
|
template(user) {
|
||||||
return value;
|
if (user.profile && user.profile.fullname) {
|
||||||
|
return (user.profile.fullname + " (" + user.username + ")");
|
||||||
|
}
|
||||||
|
return user.username;
|
||||||
},
|
},
|
||||||
replace(username) {
|
replace(user) {
|
||||||
return `@${username} `;
|
if (user.profile && user.profile.fullname) {
|
||||||
|
return `@${user.username} (${user.profile.fullname}) `;
|
||||||
|
}
|
||||||
|
return `@${user.username} `;
|
||||||
},
|
},
|
||||||
index: 1,
|
index: 1,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue