code-corps-api icon indicating copy to clipboard operation
code-corps-api copied to clipboard

Add user mentions to comments

Open joshsmith opened this issue 7 years ago • 2 comments

Problem

We want to be able to add user mentions to comments.

joshsmith avatar Oct 02 '17 21:10 joshsmith

Overall draft based on our deprecated rails api

  • we need a CommentUserMention model, belongs to Comment and User, caches username, has an indices field which is a 2-element array of [start, end]. In elixir, it could be a tuple, but no real need to do so, I think - ~2 hours

  • we need a module/function which takes a Comment changeset and, based on the body field, generates mentions and inserts/updates/deletes alongside Comment, can use code in rails api as guideline ~3 hours, with tests

https://github.com/code-corps/deprecated-code-corps-rails-api/blob/develop/lib/code_corps/scenario/generate_user_mentions_for_comment.rb

  • we need to decide if we want to include mentions with the Comment in our view, or, fetch them async from ember

    • if former, ~1 hour for the view modification, ~1 hour to see if ember adapter/serializer/model need to be configured to accept these
    • if later, ~2 hours for controller
  • we need to re-nable/re-add our custom DS.Type field for indices ~2 hours

  • we need to re-enable our mirage code on Ember, which generates mentions for our tests ~1 hour

  • we need to re-enable the code on Ember which parses these mentions and inserts them into the body ~2 hours

  • as a reminder, the reason we do this on ember and not on our server is because the mentions are links to a user, so they depend on the client rendering them

begedin avatar Oct 03 '17 13:10 begedin

The estimates here include tasks on ember and involve overlaps with #1003. We should create a milestone for mentions on ember and api and break this apart into individual issues to get a clearer view of what we need to do and how long it will take.

begedin avatar Oct 03 '17 13:10 begedin