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

Implement like/dislike feature for the tutorials. #887

Closed
ABHISHEK-PANDEY2 opened this issue Oct 11, 2023 · 18 comments
Closed

Implement like/dislike feature for the tutorials. #887

ABHISHEK-PANDEY2 opened this issue Oct 11, 2023 · 18 comments
Assignees
Labels
Feature New feature firebase hactoberfest Issues for hacktoberfest stale

Comments

@ABHISHEK-PANDEY2
Copy link
Collaborator

Currently the like/dislike feature is not implemented in the firebase

Task -
Implement the like/dislike feature according to the new data model.
So that a user can only like once , and can only dislike the tutorial after liking it.

Additional context
Link To Data Model.

@github-actions github-actions bot added Feature New feature firebase labels Oct 11, 2023
@shivareddy6 shivareddy6 added the hactoberfest Issues for hacktoberfest label Oct 12, 2023
@Huzaif-Ahmed
Copy link
Contributor

Hi @shivareddy6 @ABHISHEK-PANDEY2 i would like to contribute towards this issue can you please assign it to me

@Huzaif-Ahmed
Copy link
Contributor

@ABHISHEK-PANDEY2
how do you want the like system to be

should it be like the YouTube, where likes and dislikes are independent

or should it be like StackOverflow type where they both are affected

could you please clarify that

In data model the like type is stackoverflow type

@Aady7
Copy link
Contributor

Aady7 commented Oct 12, 2023

@ABHISHEK-PANDEY2 I would also like to work on the issue.

@Pheewww
Copy link

Pheewww commented Oct 14, 2023

Like/Dislike Functionality for Tutorials:

First, we check if they've already shared their feedback. We do this by looking into the "tutorial_likes" collection.

If there's no record of their opinion, we create a new document in the "tutorial_likes" collection. This document includes:
Their user ID (uid)
The tutorial's ID (tut_id)
Their preference, where 1 stands for liking and -1 for disliking (value).

After capturing their preference, we make sure to update the like/dislike count for that tutorial within its document.

Like/Dislike Functionality for Comments:

First, we do checking whether the user has already liked or disliked the comment

If no previous record exists, we create a new document in the "comment_likes" collection. This new document includes:
The user's ID (uid)
The comment's ID (comment_id)
Their preference, with 1 for liking and -1 for disliking (value).

Of course, we also update the like/dislike count within the comment's document.

Hey, @ABHISHEK-PANDEY2 @shivareddy6 , can you please assign it to me.

@Huzaif-Ahmed
Copy link
Contributor

Like/Dislike Functionality for Tutorials:

Check for Existing Feedback: Initially, we verify if the user has already expressed their opinion about a tutorial by examining the "tutorial_likes" collection.

Capture User Feedback: In cases where there's no prior record of the user's feedback, we create a new entry in the "tutorial" collection. where we increase the upvotes

  • The user's unique ID (uid).
  • The ID of the tutorial being rated (tut_id).
  • The user's preference, where a value of 1 indicates a 'like' and -1 represents a 'dislike'.
  • Update Tutorial Rating: After capturing the user's preference, we ensure that the like/dislike count for that specific tutorial is adjusted within its associated document.

Like/Dislike Functionality for Comments:

similar to tutorials

Check Existing Feedback Status: To begin, we check whether the user has previously liked or disliked a particular comment.

Record User Feedback: When there's no existing record of the user's opinion, we create a new entry in the "comment_likes" collection. This new document includes:

The user's unique ID (uid).
The ID of the comment being rated (comment_id).
The user's preference, with 1 denoting a 'like' and -1 indicating a 'dislike'.
Update Comment Rating: We also ensure that the like/dislike count for that specific comment is adjusted within the comment's document.

my approach is also the same
@ABHISHEK-PANDEY2 @shivareddy6 i would also like to work on this issue

@Pheewww
Copy link

Pheewww commented Oct 14, 2023

I'm working on it, sure you are welcome to take it if I'm not able to.

@Huzaif-Ahmed
Copy link
Contributor

I really appreciate your suggestion but I already started working on it 2 days ago as you can see in previous comments.I am sorry to interrupt I am sure there are many other issues to solve with your caliber and expertise and I would like to have your cooperation as a fellow contributor please let me work over this and help me build my moral for further contributions

@ABHISHEK-PANDEY2
Copy link
Collaborator Author

@Pheewww @Huzaif-Ahmed Can you both work together ? it's an important feature so it will be great if we get a good implementation, so both of you can work together .

@Pheewww
Copy link

Pheewww commented Oct 14, 2023

@Pheewww @Huzaif-Ahmed Can you both work together ? it's an important feature so it will be great if we get a good implementation, so both of you can work together .

Sure, seems cool to me. let me work on Like/Dislike Functionality for tutorial, @Huzaif-Ahmed you can get head start on Like/Dislike Functionality for comments by then?

@Huzaif-Ahmed
Copy link
Contributor

@Pheewww @Huzaif-Ahmed Can you both work together ? it's an important feature so it will be great if we get a good implementation, so both of you can work together .

Sure, seems cool to me. let me work on Like/Dislike Functionality for tutorial, @Huzaif-Ahmed you can get head start on Like/Dislike Functionality for comments by then?

Sure, Would love work with you as a fellow contributor and wish you a very Good luck!

@Huzaif-Ahmed
Copy link
Contributor

@Pheewww @Huzaif-Ahmed Can you both work together ? it's an important feature so it will be great if we get a good implementation, so both of you can work together .

Thanks for assigning me this issue ,I will try to solve it as soon as possible now

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 16, 2023
@Huzaif-Ahmed
Copy link
Contributor

ii will work on this issue
sorry for being late as i went through `some exams

@Huzaif-Ahmed
Copy link
Contributor

@ABHISHEK-PANDEY2 @shivareddy6 can you please check the cypress issue i also made changes like this before the triage label issue is persistant

Can you please help me over that

@Huzaif-Ahmed
Copy link
Contributor

@ABHISHEK-PANDEY2 i saw your previous commits and the PR's and have observed that you have worked with cypress Can you please explain me why am i getting this issue of label error

@Huzaif-Ahmed
Copy link
Contributor

Huzaif-Ahmed commented Jan 1, 2024

i made the required changes all the cypress tests are passing and comment like system is implemented

codelabz-google-chrome-2024-01-01-20-33-48_bGLtiZzd.mp4

@ABHISHEK-PANDEY2 @shivareddy6 please check it

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label May 24, 2024
Copy link

github-actions bot commented Jun 7, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature firebase hactoberfest Issues for hacktoberfest stale
Projects
None yet
Development

No branches or pull requests

5 participants