Add a dropdown to filter and sort projects in the dashboard projects & group pages
Addresses #3968 (closed), #3245 (closed), #3799 (closed). This MR is bigger than I expected but I don't think this could be split into smaller MRs.
/cc @creamzy @dzaporozhets @JobV @balameb @dblessing @haynes
Notes:
- I replaced "Last updated" by "Recently active" since the underlying field used with this sorting method is
last_activity_at
which is the time of the most recent project's event. I thought it was not very useful to sort byupdated_at
(which is updated when the project settings itself is updated) because from a user perspective the goal is to see the most recently active projects, not the most recently updated. - I used the
Project
'spersonal
scope for the "Owned by me" filter. - I did not show the "Owned by" filters in the group page since it doesn't make sense: group's projects are owned by the group.
- The group page has been split in two real pages (instead of loading
the activity feed and the project lists on one page) since sorting reloads the page, it was cleaner to do it like that. The two pages are
/groups/:group
-> group's activity (same as before) and/groups/:group/projects
-> group's projects. The former/groups/:group/projects
route has been changed to/groups/:group/projects/edit
which is more appropriate IMO.
Dashboard > Your projects Owned by anyone sorted by Recently active
Dashboard > Your projects Owned by me sorted by Most stars
Dashboard > Starred projects Owned by anyone sorted by Name
Group (while signed-out) > Activity
Group (while signed-out) > All projects sorted by Most stars
Group (while signed-in) > Activity
Group (while signed-in) > All projects sorted by Name
Group > No activity to show
Group > No projects to see
Explore > Update of the dropdown style (to match the style in the proposal's screenshots)
Merge request reports
Activity
Added 1 commit:
- 750aa82a - Fix specs, add specs, fix Rubocop offences, fix some queries & views
Added 1 commit:
- 9fc53e6b - Fix specs and clean links in group page
Added 1 commit:
- 01acf282 - Fix spec
Reassigned to @DouweM
@jschatz1 You'll probably want to review this too since it's a
Frontend
MR!Re. the group page: I realize the changes in
GroupsController
and its views will clash with GitLab EE...I see two possibilities:
- Revert to keep using the "dynamic tab" approach (i.e. load activity and projects in the
show
action and show tabs in JS) as it is currently inmaster
- Keep the changes and handle the merge into EE with the new approach: add a new
shared
scope to the list of scopes in CE, i.e.:All (w) | Contributed (x) | Starred (y) | Shared (z)
. This solution could really be cleaner than the first one, IMHO.
- Revert to keep using the "dynamic tab" approach (i.e. load activity and projects in the
Added 1 commit:
- b4dba39d - Try to fix specs
Keep the changes and handle the merge into EE with the new approach: add a new shared scope to the list of scopes in CE, i.e.: All (w) | Contributed (x) | Starred (y) | Shared (z). This solution could really be cleaner than the first one, IMHO.
I prefer this option, but we should get some UX/Frontend input :)
I also think we should either split up
Activity
andProjects
into different navigation items (like on the Dashboard, and Project whereActivity
has its own item), or at least make sureGroup
in the left is highlighted when on theProjects
page. I prefer the first option since it's more consistent.14 14 private 15 15 16 16 def projects 17 @projects ||= current_user.authorized_projects.sorted_by_activity.non_archived 17 @projects ||= current_user.authorized_projects.sort('recently_active').non_archived Reassigned to @rymai
Added 1 commit:
- 575a9d53 - Address MR feedback
Added 1 commit:
- 70297375 - Fix specs and address latest MR feedback
346 346 member do 347 347 get :issues 348 348 get :merge_requests 349 get :projects 350 349 end 351 350 352 351 scope module: :groups do 352 resources :projects, only: [:index] do 353 get :edit, on: :collection 354 end 353 355 resources :group_members, only: [:index, :create, :update, :destroy] do mentioned in issue #12779 (closed)
Added 1 commit:
- 2bd80129 - Addressing latest MR feedbacks
Added 1 commit:
- d3a51414 - Ensure specs do not fail randomly
Added 1 commit:
- 2221ed87 - Add Group > Activity page and in the group nav bar
Added 1 commit:
- 5d993ef9 - Fix groups/:id/activity route redirect
@DouweM Thanks for the awesome review, I've pushed a few commits to add new "Activity" and "Projects" items in the group's nav bar (see screenshots in the MR description). If you can review them that'd be great!
Also, regarding the known conflict that will happen with EE (with the "Shared projects" feature in group page), should I go ahead and open a MR for CE
master
-> EEmaster
once this one gets merged into CEmaster
?@creamzy & @jschatz1: It would be great if you could give your feedback about this MR as well. Thanks in advance!
PS: I will merge
master
in that branch once it's approved to minimize the need formaster
merges.Reassigned to @DouweM
Added 1 commit:
- 76d6b1c0 - Fix specs broken by last commit
Also, regarding the known conflict that will happen with EE (with the "Shared projects" feature in group page), should I go ahead and open a MR for CE master -> EE master once this one gets merged into CE master?
Shared projects will be backported to CE by #12831 (closed) so it would be wiser to wait for it to be in
master
before merging this MR so that I'll be able to resolve the conflicts during themaster
merge into this branch.Added 1 commit:
- c79c441c - Re-add code that didn't need to be removed
Added 258 commits:
-
c79c441c...22772871 - 257 commits from branch
master
- 264d25da - Merge remote-tracking branch 'origin/master' into add-filter-sort-dropdown-to-dashboard-group-pages
-
c79c441c...22772871 - 257 commits from branch
- app/views/groups/_header.html.haml 0 → 100644
13 .avatar-holder 14 = link_to group_icon(@group), target: '_blank' do 15 = image_tag group_icon(@group), class: "avatar group-avatar s90" 16 .cover-title= @group.name 17 18 .cover-desc.username= @group.to_reference 19 20 - if @group.description.present? 21 .cover-desc.description 22 = markdown(@group.description, pipeline: :description) 23 24 %ul.nav-links 25 = nav_link(path: 'groups#activity') do 26 = link_to 'Activity', activity_group_path(@group) 27 = nav_link(path: 'groups/projects#index') do 28 = link_to 'Projects', group_projects_path(@group) Hmm. I don't like the duplication of the Activity/Projects tabs and nav items, I would prefer to not have the tabs, but that's out of scope for this MR. Would you mind reverting the sidebar change, so we just have a
Group
item there that's highlighted when we're on theActivity
orProjects
tab?Hmm. I don't like the duplication of the Activity/Projects tabs and nav items, I would prefer to not have the tabs, but that's out of scope for this MR.
I'm not a fan of that neither, but as you said since it was not part of the MR I thought that could be a first step on which we could iterate on (it was weird to have the group header without the tab underneath for both the Activity and the Projects page).
Anyways, that was a try but I will definitely be more comfortable not changing the sidebar in this MR so that UX team can come up with a consistent proposal. I'll revert that last changes.
Added 1 commit:
- d984beba - Revert splitting group into "Activity" / "Projects" in the group nav bar
Reassigned to @jschatz1
@rymai Nice job! Functionally it looks like it works.
- #3968 (closed) It does not match the new dropdowns.
- Use
<li role="separator" class="divider"></li>
not<hr>
. Don't reinvent the wheel please. - http://getbootstrap.com/components/#dropdowns-headers Don't reinvent the wheel please.
I think we need a plan for the new dropdowns, I think this regular bs dropdown works here, but it obviously won't work in other places. Do you need me to style these for you or can you handle it?
Reassigned to @rymai
@dzaporozhets I agree, this definitely got a little out of hand. Thank you for your kind warning. :)
- I propose to start with adding sort only on the
dashboard/projects
&dashboard/projects/starred
with the current dropdown UI. - Then I (or someone else) should update the dropdown UI according to #3279 (closed).
- At that time, we'll have the UI ready to add the filtering to
dashboard/projects
&dashboard/projects/starred
. - Only at that point should we start thinking about adding sorting/filtering to the group page (and see if we split it in two distinct pages, as I've done in this MR).
Let me know if that sounds like a (good) plan to you, or not! ;)
If you're ok with at least 1., I will open a new MR for it (once !2677 (merged) and !2678 (merged) are merged since it will avoid many conflicts).
- I propose to start with adding sort only on the
Let me know if that sounds like a (good) plan to you, or not! ;)
@rymai awesome plan. Each step -> at least one merge request
I will open a new MR for it (once !2677 (merged) and !2678 (merged) are merged since it will avoid many conflicts).
smart move!
@rymai With !2677 (merged) introduced I will provide an example by moving existing dropdown on dashboard. I will link MR here and will mention you. Using provided semantic you can proceed with your plan
Awesome, thanks @dzaporozhets!
mentioned in merge request !2691 (merged)
mentioned in commit c8224f0b
mentioned in issue #3799 (closed)