UX: Don't match emails in user selector in group add members modal.

https://meta.discourse.org/t/cant-add-members-to-a-group/85738?u=tgxworld
This commit is contained in:
Guo Xiang Tan 2018-04-20 10:25:52 +08:00
parent 70d181bff8
commit 116ddec22e
3 changed files with 7 additions and 4 deletions

View File

@ -33,7 +33,8 @@ export default TextField.extend({
excludeCurrentUser = bool('excludeCurrentUser'), excludeCurrentUser = bool('excludeCurrentUser'),
single = bool('single'), single = bool('single'),
allowAny = bool('allowAny'), allowAny = bool('allowAny'),
disabled = bool('disabled'); disabled = bool('disabled'),
disallowEmails = bool('disallowEmails');
function excludedUsernames() { function excludedUsernames() {
// hack works around some issues with allowAny eventing // hack works around some issues with allowAny eventing
@ -64,7 +65,8 @@ export default TextField.extend({
allowedUsers, allowedUsers,
includeMentionableGroups, includeMentionableGroups,
includeMessageableGroups, includeMessageableGroups,
group: self.get("group") group: self.get("group"),
disallowEmails,
}); });
return results; return results;

View File

@ -61,7 +61,7 @@ function organizeResults(r, options) {
}); });
} }
if (options.term.match(/@/)) { if (!options.disallowEmails && options.term.match(/@/)) {
let e = { username: options.term }; let e = { username: options.term };
emails = [ e ]; emails = [ e ];
results.push(e); results.push(e);

View File

@ -9,7 +9,8 @@
class="input-xxlarge" class="input-xxlarge"
usernames=model.usernames usernames=model.usernames
placeholderKey="groups.selector_placeholder" placeholderKey="groups.selector_placeholder"
id="group-add-members-user-selector"}} id="group-add-members-user-selector"
disallowEmails=true}}
</div> </div>
{{#if currentUser.admin}} {{#if currentUser.admin}}