Skip to content

Add possibilty to view starrers ("stargazers") of a repository & any user's starred repositories

Camil Staps requested to merge (removed):20137-starrers into master

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.

    Preview2019-02-02-205129_1272x731
    Preview for project without stars2019-01-27-122033_1262x156
  • 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.

    Preview2019-01-27-111416_1270x455
    Preview for user without starred projects2019-07-26-200820_672x252
  • On the project home panel, make the number of stars clickable with a link to the starrers list.

    Preview2019-01-27-104250_387x96
  • In project lists, make the number of stars clickable with a link to the starrers list.

    Preview2019-01-27-104305_508x284

Notes / for discussion

  1. I used the terminology "starrers" instead of GitHub's "stargazers" because the term "starrers" was already used in app/models/project.rb.
  2. 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?

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.

Edited by Douglas Barbosa Alexandre

Merge request reports