code-corps-api
code-corps-api copied to clipboard
Add user mentions to comments
Problem
We want to be able to add user mentions to comments.
Overall draft based on our deprecated rails api
-
we need a
CommentUserMention
model, belongs toComment
andUser
, cachesusername
, has anindices
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 thebody
field, generates mentions and inserts/updates/deletes alongsideComment
, 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
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.