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

feat: migrate User Recent Posts to React.js #2664

Merged
merged 20 commits into from
Sep 8, 2024

Conversation

wescopeland
Copy link
Member

This PR is stacked on #2663.


This PR migrates the /user/[user]/posts route to React.js. This is achieved by largely reusing components from the /forums/recent-posts page.

There should only be one functional change on the page - it has been renamed from "Recent Posts" to "Forum Posts".

Screenshot 2024-09-01 at 7 51 22 PM

@wescopeland wescopeland requested a review from a team September 1, 2024 23:51
@@ -322,7 +323,7 @@ private function buildRankMetadata(
private function buildSocialStats(User $user): array
{
$userSetRequestInformation = getUserRequestsInformation($user);
$numForumPosts = $user->forumPosts()->count();
$numForumPosts = $user->forumPosts()->authorized()->viewable(Auth::user())->count();
Copy link
Member Author

Choose a reason for hiding this comment

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

This change fixes a bug on the user profile. The current count of forum posts represents all posts made by the user, including the ones that can't be seen due to being unauthorized or locked behind a permissions gate.

The count now reflects the posts that are visible on the /user/[user]/posts page.

Copy link
Member

@Jamiras Jamiras left a comment

Choose a reason for hiding this comment

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

Didn't review code. Spot checking forum posts page seems okay.

@wescopeland wescopeland merged commit c5a9891 into RetroAchievements:master Sep 8, 2024
5 checks passed
@wescopeland wescopeland deleted the user-forum-posts branch September 8, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants