Add possibilty to view starrers ("stargazers") of a repository & any user's starred repositories
What does this MR do?
API
- Adds
GET projects/:id/starrers
to retrieve a list of users who starred a project. - Adds
GET users/:user_id/starred_projects
to retrieve a list of projects starred by a user.
UI
-
Adds a route to
{project}/starrers
which lists the users who starred a project. The list can be searched by name (of the user), can be sorted by name and date of starring (both asc & desc), and is paginated by 20 (this is some constant set elsewhere). Private profiles are hidden from this view, but the total count is still shown. -
Adds a route to
{user}/starred
which lists the projects a user has starred. This list is similar to that of personal/contributed projects, so there is no search/sorting, but the list is paginated. -
On the project home panel, make the number of stars clickable with a link to the starrers list.
-
In project lists, make the number of stars clickable with a link to the starrers list.
Notes / for discussion
- I used the terminology "starrers" instead of GitHub's "stargazers" because the term "starrers" was already used in
app/models/project.rb
. - I did not include user location (suggested in https://gitlab.com/gitlab-org/gitlab-ce/issues/20137#note_16844494). With long user identifiers there is not so much space.
What are the relevant issue numbers?
- Closes #20137 (closed).
Does this MR meet the acceptance criteria?
I'm not sure if I should tick these boxes or if reviewers should do that, but as far as I'm concerned this MR is ready.
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer