Skip to content
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

Display Notification When User Likes Research Note #9353

Closed
noi5e opened this issue Mar 23, 2021 · 9 comments · Fixed by #9385
Closed

Display Notification When User Likes Research Note #9353

noi5e opened this issue Mar 23, 2021 · 9 comments · Fixed by #9385
Labels
easy feature explains that the issue is to add a new feature help wanted requires help by anyone willing to contribute JavaScript

Comments

@noi5e
Copy link
Contributor

noi5e commented Mar 23, 2021

Description

Let's display a notyNotification when a user likes a research note. And also a second notification when the user dislikes a research note.

See this thread for more context.

Why Do This?

Here's a video of what happens when a user likes a research note:

Screen.Recording.2021-03-22.at.12.44.22.PM.mov
  1. It's not clear to the user what this star button does. No hover tooltip, no notification.
  2. There is a slight delay (probably due to slowness in the controller) between when the user clicks, and the star gets filled in. A hover tooltip can really help here to reduce UX confusion.

For example, here's the notification that we use when a user posts a comment (in the top-right corner):

Screen.Recording.2021-03-22.at.12.50.41.PM.mov

How to Implement

The comment example above is done here in create.js.erb:

notyNotification('mint', 3000, 'success', 'topRight', 'Comment Added!');

We can add similar notyNotifications here in like.js, depending on if the research note is liked or disliked:

function changeLikeStatus(node_id, method) {
$('#like-button-' + node_id).off();
$.getJSON("/likes/node/" + node_id + method)
.then(function(resp) {
updateLikeCount(parseInt(resp), node_id);
renderLikeStar(parseInt(resp), node_id);
})
.then(function(resp) {
let method1 = method === "/delete" ? clicknotliked : clickliked
$('#like-button-' + node_id).on('click', method1);
});
}

@noi5e noi5e added help wanted requires help by anyone willing to contribute JavaScript feature explains that the issue is to add a new feature easy labels Mar 23, 2021
@jcads
Copy link
Contributor

jcads commented Mar 23, 2021

Can I work on this one?

@noi5e
Copy link
Contributor Author

noi5e commented Mar 23, 2021

@jcads Yeah, go for it! Post a comment here if you need any pointers, or if you need some help. :)

@RuthNjeri

This comment has been minimized.

@RuthNjeri
Copy link
Contributor

oh, sorry this is not a first-timer issue... my bad @jcads sorry for the confusion...

@sahilsaha7773
Copy link
Contributor

As there is no update on this, can I take up this issue?

@noi5e
Copy link
Contributor Author

noi5e commented Mar 24, 2021

@sahilsaha7773 I am assuming that @jcads is working on it, they'll let you know if they stop working on it.

@sahilsaha7773
Copy link
Contributor

@sahilsaha7773 I am assuming that @jcads is working on it, they'll let you know if they stop working on it.

okay sure, thanks!

@jcads
Copy link
Contributor

jcads commented Mar 26, 2021

@sahilsaha7773 I am assuming that @jcads is working on it, they'll let you know if they stop working on it.

Yes I am still working on this. Will open a PR in a couple of days, I just have to finish some internship stuff.

@jcads
Copy link
Contributor

jcads commented Mar 28, 2021

@noi5e here's what I came up with:

Screencast-2021-03-28-171020

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy feature explains that the issue is to add a new feature help wanted requires help by anyone willing to contribute JavaScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants