-
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
Fixes #8453: added the number of followers/following in the profile of the user #8462
Conversation
Thanks for opening this pull request! This space is protected by our Code of Conduct - and we're here to help. |
Codecov Report
@@ Coverage Diff @@
## main #8462 +/- ##
==========================================
- Coverage 82.01% 81.89% -0.12%
==========================================
Files 101 101
Lines 5899 5894 -5
==========================================
- Hits 4838 4827 -11
- Misses 1061 1067 +6
|
app/views/users/profile.html.erb
Outdated
@@ -268,6 +268,8 @@ | |||
<li><h5><a href = "/tag/activity:*/author/<%= params[:id] %>"><%= pluralize(@count_activities_posted, 'activity posted', plural:'activities posted') %> </a></h5></li> | |||
<li><h5><a href = "/tag/replication:*/author/<%= params[:id] %>"><%= pluralize(@count_activities_attempted, 'activity attempted', plural:'activities attempted')%></a> </h5></li> | |||
<li><h5><a href = "/tag/with:<%= @profile_user.username %>"><%= pluralize(Tag.find_nodes_by_type("with:#{@profile_user.username}").count, 'note co-authored', plural: 'notes co-authored')%></a> </h5></li> | |||
<li><h5><a href = "/people/<%= params[:id]%>/followers"><%= pluralize(following_path(@user.username).count, 'follower', plural:'followers')%></a></h5></li> |
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.
Hi! Thanks so much for taking this on! Can you help me unpack this line... where is the definition for following_path()
that should yield the count? I searched for https://github.com/publiclab/plots2/search?q=following_path but didn't get a definition. Could we instead use followers.size
?
<li><h5><a href = "/people/<%= params[:id]%>/followers"><%= pluralize(following_path(@user.username).count, 'follower', plural:'followers')%></a></h5></li> | |
<li><h5><a href = "/people/<%= params[:id]%>/followers"><%= @user.size %> following</a></h5></li> |
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.
Sorry, but can I ask why did you use@user.size %>following</a>
rather than @user.size %>followers</a>
since we are counting the followers?
app/views/users/profile.html.erb
Outdated
@@ -268,6 +268,8 @@ | |||
<li><h5><a href = "/tag/activity:*/author/<%= params[:id] %>"><%= pluralize(@count_activities_posted, 'activity posted', plural:'activities posted') %> </a></h5></li> | |||
<li><h5><a href = "/tag/replication:*/author/<%= params[:id] %>"><%= pluralize(@count_activities_attempted, 'activity attempted', plural:'activities attempted')%></a> </h5></li> | |||
<li><h5><a href = "/tag/with:<%= @profile_user.username %>"><%= pluralize(Tag.find_nodes_by_type("with:#{@profile_user.username}").count, 'note co-authored', plural: 'notes co-authored')%></a> </h5></li> | |||
<li><h5><a href = "/people/<%= params[:id]%>/followers"><%= pluralize(following_path(@user.username).count, 'follower', plural:'followers')%></a></h5></li> | |||
<li><h5><a href = "/people/<%= params[:id]%>/following"><%=pluralize(following_path(@user.username).count, 'following', plural:'following')%></a></h5></li> |
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.
<li><h5><a href = "/people/<%= params[:id]%>/following"><%=pluralize(following_path(@user.username).count, 'following', plural:'following')%></a></h5></li> | |
<li><h5><a href = "/people/<%= params[:id]%>/following"><%= @user.size %> following</a></h5></li> |
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.
done, thanks :)
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.
Just a suggestion for database optimization and also slightly simpler code! Thanks!!!
Thank you so much @jywarren for your suggestions. I made the changes you requested. |
Sorry, just trying to retrigger the tests now that we've resolved an unrelated issue! |
Hi @renugasaraswathy , can you review this pull request which is a fix for issue: #8453, please? |
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.
Awesome 🎉 Thanks for working on this @BatoolMM
Congrats on merging your first pull request! 🙌🎉⚡️ Help others take their first stepNow that you've merged your first pull request, you're the perfect person to help someone else out with this challenging first step. 🙌 Try looking at this list of `first-timers-only` issues, and see if someone else is waiting for feedback, or even stuck! 😕 People often get stuck at the same steps, so you might be able to help someone get unstuck, or help lead them to some documentation that'd help. Reach out and be encouraging and friendly! 😄 🎉 Read about how to help support another newcomer here, or find other ways to offer mutual support here. |
Thank you!!! |
…profile of the user (publiclab#8462) * added the number of followers/following in the profile of the user * minor changes * tried to fix Functional Tests
…profile of the user (publiclab#8462) * added the number of followers/following in the profile of the user * minor changes * tried to fix Functional Tests
…profile of the user (publiclab#8462) * added the number of followers/following in the profile of the user * minor changes * tried to fix Functional Tests
…profile of the user (publiclab#8462) * added the number of followers/following in the profile of the user * minor changes * tried to fix Functional Tests
…profile of the user (publiclab#8462) * added the number of followers/following in the profile of the user * minor changes * tried to fix Functional Tests
…profile of the user (publiclab#8462) * added the number of followers/following in the profile of the user * minor changes * tried to fix Functional Tests
I was trying to display the list of user's followers and the list of people whom the user is following.
This is the link for the issue: #8453
I can display the list of followers/following but not their count. I added the code in
profile.html.erb
Can you have a look? Any help would be greatly appreciated?
Regards,
Batool