-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reactions to comments #4612
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, I think this solution is the best option.
Not sure what I think about the name contentSelf
. I feel like it should still contain "content target" as that is sort of the name of this concept in the code base. It should be easy to understand out of context what function the property has.
@eikhr Thanks for your input 😁. Would you rather prefer changing the name of the existing property |
Idk, it doesn't matter that much. I just meant I think it should be f.ex. "selfContentTarget" or "parentContentTarget" so that it still contains the entire phrase "content target". Because I don't feel like it's obvious what "content" in "selfContent" is referring to. |
8c8ac00
to
bb96fe4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! But you need to rebase and lint, and there seems to be a problem with the comment tests.
bb96fe4
to
45e4e94
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
5588e71
to
4c1ba38
Compare
4c1ba38
to
5b2844e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Description
Adds reactions to comments.
I faced a small issue and came up with a "hacky" solution: Models that can be reacted on, like articles and meetings, have a contentTarget property that determines what model the reaction should be added to. This property points to the model itself, so that if you react to an article, the reaction is added to that article. I imagined that I could to the same thing for comments: adding a contentTarget property that points back to the comment itself. However, comments already have a contentTarget property that is used to link to the parent model, like an article, causing reactions to be added to the article instead of the comment (never really tested that this actually happened, but it's my guess). My workaround was to add a contentSelf property and pass it to LegoReactions as the contentTarget property. Do you guys think this implementation is alright?
Result
If you've made visual changes, please check the boxes below and include images showing the changes. Descriptions are appreciated.
Testing
Adding and deletion works.
I haven't tested for comments that were made before these changes yet.
Resolves ABA-678