[GH-5915] Clicking on @mention of a user in a post shows the profile popover (#6129)

* post message at-mention profile pop-over

* remove hover effect to special mentions

* make non-clickable the non-existing at-mention username

* fix "video call" position

* use usernameMap instead of initially defined liteUsernameMap

* update per comments
Этот коммит содержится в:
Saturnino Abril
2017-05-01 23:08:54 +09:00
коммит произвёл Harrison Healey
родитель 597641545d
Коммит 83f819451a
20 изменённых файлов: 281 добавлений и 102 удалений

Просмотреть файл

@@ -50,21 +50,6 @@ describe('TextFormatting.AtMentions', function() {
);
});
it('Implied at mentions', function() {
// PLT-4454 Assume users exist for things that look like at mentions until we support the new mention syntax
assert.equal(
TextFormatting.autolinkAtMentions('@user', new Map(), {}),
'$MM_ATMENTION0',
'should imply user exists and replace mention with token'
);
assert.equal(
TextFormatting.autolinkAtMentions('@user.', new Map(), {}),
'$MM_ATMENTION0.',
'should assume username doesn\'t end in punctuation'
);
});
it('Not at mentions', function() {
assert.equal(
TextFormatting.autolinkAtMentions('user@host', new Map(), {user: {}, host: {}}),
@@ -75,5 +60,28 @@ describe('TextFormatting.AtMentions', function() {
TextFormatting.autolinkAtMentions('user@email.com', new Map(), {user: {}, email: {}}),
'user@email.com'
);
assert.equal(
TextFormatting.autolinkAtMentions('@user', new Map(), {}),
'@user'
);
assert.equal(
TextFormatting.autolinkAtMentions('@user.', new Map(), {}),
'@user.',
'should assume username doesn\'t end in punctuation'
);
assert.equal(
TextFormatting.autolinkAtMentions('@will', new Map(), {william: {}}),
'@will',
'should return same text without token'
);
assert.equal(
TextFormatting.autolinkAtMentions('@william', new Map(), {will: {}}),
'@william',
'should return same text without token'
);
});
});

Просмотреть файл

@@ -166,7 +166,7 @@ describe('TextFormatting.Hashtags', function() {
};
assert.equal(
TextFormatting.formatText('#@test', options).trim(),
"<p>#<a class='mention-link' href='#' data-mention='test'>@test</a></p>"
"<p>#<span data-mention='test'><a class='mention-link' href='#'>@test</a></span></p>"
);
assert.equal(