Loading
Paginate starred projects on user profile
What does this MR do and why?
The Starred projects tab on a user profile (/users/:username/starred) showed at most 20 projects and no pager. UsersController#load_starred_projects didn't paginate the relation, so paginate_collection in shared/projects/_list rendered no pager, and the partial's default projects_limit of 20 silently cut off the rest.
This MR adds .page(params[:page]), the same as the Personal projects tab. The starred tab now shows a pager and every starred project is reachable, which matches /dashboard/projects/starred.
References
Resolves #618875 (closed)
Screenshots or screen recordings
| Before | After |
|---|---|
| First 20 starred projects, no pager | 20 per page, with a pager |
How to set up and validate locally
- As any user, star more than 20 projects. For example, in the Rails console:
user = User.find_by_username('root') Project.public_only.limit(25).each { |p| user.toggle_star(p) unless user.starred?(p) } - Visit
http://gdk.test:3000/users/root/starred. - Before: you see 20 projects and no pager. After: a pager appears and page 2 lists the rest.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.