-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Comment Likes Does Not Work #5113
Comments
@jywarren Do you think this is descriptive enough for someone to take on this issue with everything in mind from the last one I did or can I improve it? |
I think this is good, although maybe a link to the Js code driving the
button would be nice to add! Thanks!
…On Sat, Mar 16, 2019, 5:01 PM Sasha Boginsky ***@***.***> wrote:
@jywarren <https://github.com/jywarren> Do you think this is descriptive
enough for someone to take on this issue with everything in mind from the
last one I did or can I improve it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5113 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ9GwXB5Tt8GI1pH03sQFSa4yPoUUks5vXVt-gaJpZM4b4BtJ>
.
|
@sashadev-sky @jywarren Is this issue available. ? |
@CleverFool77 hey it is! All yours! You have enough information to get started but I’ll post some more things that might help you shortly |
(This was specifically for liking notes) javascript driving the like button functionality: https://github.com/publiclab/plots2/blob/master/app/assets/javascripts/like.js
So now there is both but implement it however you would like! I definitely think my code could be improved on if you have any ideas for the implementation for comments. |
@sashadev-sky I am looking forward to work on this issue. What if we just increase the size of icons representing the expressions the current user has already reacted? We might need some extra data from back-end as well, I am not sure if the back-end is already checking whether current user has reacted to a given comment. |
Just adding some context here, i believe the reactions system was built over the previous comment liking system, and we had hoped that the 👍 reaction would replace "liking" -- in fact, i think i recall that previously made "likes" were converted to 👍 retroactively! I wonder also if the interface "like" buttons @sashadev-sky had seen are now gone too? Does that mean that this issues is mostly complete? Is there more we could do to clarify that |
@jywarren Doing some research on this. Liking NotesThe code in For example this function here does some eventHandling on plots2/app/assets/javascripts/like.js Lines 14 to 25 in 38e37eb
Which is an ID that appears here: plots2/app/views/like/_like.html.erb Lines 26 to 34 in 38e37eb
That corresponds to this star button below, which is for liking a research note in general: Current Video of Liking Notes in Action:
Current Status of Liking Notes:
It seems like this PR #4852 was merged right around the time this issue was created. It seems like that PR actually solves this issue? Not sure what is left over, I'd have to sift through that issue to see. |
Just browsed #4852, it seems like that PR was fixing a problem with likes via debouncing (liking a note was triggering a million likes and dislikes, GIF here in this note) I think this issue can be closed... It really seems like the problem's been solved since it was created? Liking notes AND liking comments work as expected, they send POST requests to the server, the models are updated etc. The only thing that is missing in both cases which would be nice is a Noty Notification appearing for 'Note Liked!' and 'Comment Liked!' I can make an issue in both cases. |
@jywarren Last note, in reference to this comment:
I think that was done in 2018 in this PR #2869, so that was already in place by the time this issue was made. Can you review and close this issue if you think that's appropriate? |
I just did a little more browsing to make absolutely certain that things are working like they should be. I still think they are! Just leaving a trail here so that others can follow. Clicking on the star button to like a note calls the following (event attached to plots2/app/views/like/_like.html.erb Line 221 in 38e37eb
plots2/app/assets/javascripts/like.js Lines 4 to 7 in 38e37eb
plots2/app/assets/javascripts/like.js Lines 14 to 25 in 38e37eb
The route `/likes/node/123/create' is defined here: plots2/app/controllers/like_controller.rb Lines 29 to 31 in 38e37eb
Lines 1093 to 1125 in 38e37eb
The DB is updated here to show that user liked the node: Lines 1079 to 1091 in 38e37eb
@jywarren (or anyone else that can review this), can you double-check the above to see that all the parts are working as expected? I think they are, AFAIK. If everything looks okay, I recommend we close this issue, and open a new one: "Display Notification When User Likes Research Note" |
This all looks right, and esp the part about:
as that is specific to liking individual comments, not just notes. Sounds good to me and THANK YOU SO MUCH for digging through this so thoroughly!!! |
Find a comment on any page on the PL website and you will find that clicking its like button results in a POST request to show a 'noty notification' (a green popup to the right saying 'Reacted'! or 'Unreacted!') and does not send any request to actually "like" the comment or update the comment's like button UI to show it has been liked:
Here is an example page:
https://publiclab.org/questions/OrionAllgaier/03-13-2019/questions-from-the-university-of-wisconsin-eau-claire
The code needs to be added to implement the like functionality for a comment. Please reference the PR #4852 to find some files that may be useful to you in implementing this and to note some bugs we experienced while adding like functionality elsewhere and how it was solved.
Thank you!!
The text was updated successfully, but these errors were encountered: