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

Modify the way "Friends" are added #5261

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nertc
Copy link
Contributor

@nertc nertc commented Oct 15, 2024

This PR addresses "Modify the way 'Friends' are added" issue mentioned in #3310

This PR replaces all occurrences of "friends" to "followers", including texts, tests and URLs.

This PR was not broken down to smaller pieces to maintain consistency and avoid different names of the same functionality.

config/locales/en.yml Outdated Show resolved Hide resolved
config/routes.rb Outdated Show resolved Hide resolved
app/views/dashboards/show.html.erb Outdated Show resolved Hide resolved
config/locales/en.yml Outdated Show resolved Hide resolved
config/locales/en.yml Outdated Show resolved Hide resolved
config/locales/en.yml Outdated Show resolved Hide resolved
config/locales/en.yml Outdated Show resolved Hide resolved
config/locales/en.yml Outdated Show resolved Hide resolved
@nertc nertc force-pushed the issues_3310_modify_the_way_friends_are_added branch from e1a1b87 to 8393857 Compare October 22, 2024 07:09
@nertc
Copy link
Contributor Author

nertc commented Oct 22, 2024

Thank you for the review. This PR was updated according to recommendations.

@nertc nertc force-pushed the issues_3310_modify_the_way_friends_are_added branch from 8393857 to 02bede7 Compare November 14, 2024 07:37
Copy link

1 Warning
⚠️ Number of updated lines of code is too large to be in one PR. Perhaps it should be separated into two or more?

Generated by 🚫 Danger

@nertc
Copy link
Contributor Author

nertc commented Nov 14, 2024

PR was updated. Now friendship controller and model are refactored to be named as "follow" and also implement standard CRUD architecture using create and destroy. Old controllers, models, views and tests were removed, and new ones were added with the new names and architecture.

config/routes.rb Outdated Show resolved Hide resolved
@nertc nertc mentioned this pull request Dec 23, 2024
5 tasks
@nertc nertc force-pushed the issues_3310_modify_the_way_friends_are_added branch from 02bede7 to 36fba94 Compare December 24, 2024 09:19
config/routes.rb Outdated Show resolved Hide resolved
app/models/follow.rb Outdated Show resolved Hide resolved
@nertc nertc force-pushed the issues_3310_modify_the_way_friends_are_added branch from 36fba94 to 5c9c7b8 Compare January 10, 2025 12:08
@nertc nertc force-pushed the issues_3310_modify_the_way_friends_are_added branch from 5c9c7b8 to a153faf Compare January 10, 2025 13:07
Comment on lines -87 to +89
<%= link_to t(".remove as friend"), remove_friend_path(:display_name => @user.display_name), :method => :post %>
<%= link_to t(".unfollow"), follow_path(:display_name => @user.display_name), :method => :delete %>
<% else %>
<%= link_to t(".add as friend"), make_friend_path(:display_name => @user.display_name), :method => :post %>
<%= link_to t(".follow"), follow_path(:display_name => @user.display_name), :method => :post %>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't quite work. There's a link that points to /user/.../follow. I can try to open it in a new tab and it won't work because the page doesn't exist. The page is at .../edit but you can't change the link to .../edit because you can't post/delete it. Looks like that out of options in #5261 (comment) :show would have worked the best, especially if you agree with #5449 (comment).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought was to use :edit as the functionality was focused on editing but not showing information about follows. But as #5449 (comment) suggests, if we use :show also as edit page where it is possible, I will change it accordingly. I thought your comment meant to use standard Singular Resource routes in general, not :show in particular.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to say that singular resources don't have :index.

Comment on lines +691 to +696
follow:
heading: "Do you want to follow %{user}?"
button: "Follow User"
unfollow:
heading: "Do you want to unfollow %{user}?"
button: "Unfollow"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why one of the buttons is "Follow User" but another one is just "Unfollow"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to stick to the formulations from the friendship and as they were button: "Add as friend" and button: "Unfriend", I changed them to button: "Follow User" and button: "Unfollow" accordingly.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course you wouldn't write "Unfriend as friend" (as opposed to "Add as friend"), but you can write "Unfollow User".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants