From fe5ea60847ef26d470ffd346e666cb0f49b000c9 Mon Sep 17 00:00:00 2001 From: Jonas Oberg Date: Fri, 25 Aug 2017 08:22:20 +0200 Subject: [PATCH 1/2] Usernames should be able to include dots (.) --- client/components/lists/listBody.js | 2 +- client/components/main/editor.js | 4 ++-- sandstorm.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index bdc812c72..724e805bc 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -180,7 +180,7 @@ BlazeComponent.extendComponent({ $textarea.escapeableTextComplete([ // User mentions { - match: /\B@(\w*)$/, + match: /\B@([\w.]*)$/, search(term, callback) { const currentBoard = Boards.findOne(Session.get('currentBoard')); callback($.map(currentBoard.activeMembers(), (member) => { diff --git a/client/components/main/editor.js b/client/components/main/editor.js index da15407a0..5987b7720 100755 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -25,7 +25,7 @@ Template.editor.onRendered(() => { // User mentions { - match: /\B@(\w*)$/, + match: /\B@([\w.]*)$/, search(term, callback) { const currentBoard = Boards.findOne(Session.get('currentBoard')); callback(currentBoard.activeMembers().map((member) => { @@ -60,7 +60,7 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() { member.username = Users.findOne(member.userId).username; return member; }); - const mentionRegex = /\B@(\w*)/gi; + const mentionRegex = /\B@([\w.]*)/gi; let content = Blaze.toHTML(view.templateContentBlock); let currentMention; diff --git a/sandstorm.js b/sandstorm.js index 80910dc35..6b7c8172d 100644 --- a/sandstorm.js +++ b/sandstorm.js @@ -188,7 +188,7 @@ if (isSandstorm && Meteor.isServer) { caption = { defaultText: comment.text }; const activeMembers = _.pluck(Boards.findOne(sandstormBoard._id).activeMembers(), 'userId'); - (comment.text.match(/\B@(\w*)/g) || []).forEach((username) => { + (comment.text.match(/\B@([\w.]*)/g) || []).forEach((username) => { const user = Meteor.users.findOne({ username: username.slice(1)}); if (user && activeMembers.indexOf(user._id) !== -1) { mentionedUser(user._id); From 80a13be3e2bb66841643f031ecd20ee3f8cac9b9 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 26 Aug 2017 03:35:53 +0300 Subject: [PATCH 2/2] Usernames can now include dots (.) Thanks to jonasob ! --- CHANGELOG.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a5cfeba5..e5f93a6d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,14 +10,15 @@ This release adds the following new features: * [Gogs integration part 1](https://github.com/wekan/wekan/pull/1189); * [Add web manifest so Wekan can be used like standalone app on Desktop with Chrome or Firefox](https://github.com/wekan/wekan/pull/1184); -* [Copy card link to clipboard](https://github.com/wekan/wekan/issues/1188). +* [Copy card link to clipboard](https://github.com/wekan/wekan/issues/1188); +* [Usernames can now include dots (.)](https://github.com/wekan/wekan/pull/1194). and fixes the following bugs: * [Fix Squeezed tickbox in Card](https://github.com/wekan/wekan/pull/1171). -Thanks to GitHub users andresmanelli, danhawkes, kubiko, nztqa and xet7 -for their contributions. +Thanks to GitHub users andresmanelli, danhawkes, jonasob, kubiko, nztqa +and xet7 for their contributions. # v0.32 2017-07-30 Wekan release