Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider ef3faff8 rédigé par Steffen van Bergerem's avatar Steffen van Bergerem
Parcourir les fichiers

Render mentions as links in comments

parent 99351bd1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -20,7 +20,7 @@ app.views.Comment = app.views.Content.extend({
presenter : function() {
return _.extend(this.defaultPresenter(), {
canRemove: this.canRemove(),
text : app.helpers.textFormatter(this.model.get("text"))
text: app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people"))
});
},
......
......@@ -5,11 +5,12 @@ class CommentPresenter < BasePresenter
def as_json(opts={})
{
:id => @comment.id,
:guid => @comment.guid,
:text => @comment.message.plain_text_for_json,
:author => @comment.author.as_api_response(:backbone),
:created_at => @comment.created_at
id: @comment.id,
guid: @comment.guid,
text: @comment.message.plain_text_for_json,
author: @comment.author.as_api_response(:backbone),
created_at: @comment.created_at,
mentioned_people: @comment.mentioned_people.as_api_response(:backbone)
}
end
end
......@@ -54,3 +54,15 @@ Feature: Mentions
Then I should see "Bob Jones" within ".stream-element"
When I follow "Bob Jones"
Then I should see "Bob Jones"
Scenario: A user mentions another user in a comment and it displays correctly
Given following users exist:
| username | email |
| Bob Jones | bob@bob.bob |
| Alice Smith | alice@alice.alice |
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
And "alice@alice.alice" has a public post with text "check this out!"
And "alice@alice.alice" has commented mentioning "bob@bob.bob" on "check this out!"
When I sign in as "alice@alice.alice"
And I follow "Bob Jones"
Then I should see "Bob Jones"
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter