summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-12-05 20:48:05 +0000
committerAlfredo Sumaran <alfredo@gitlab.com>2016-12-05 20:48:05 +0000
commit615eb1f007f6a92d5812735bc1087e429d5b913a (patch)
tree261ec68fc070747f3ac12325146fda264b8176e1
parente9357405daff7778ca41e19fb12a6dd21c8a0a15 (diff)
parent454e963196fdbded9ef8c530b0457a8c489e810d (diff)
downloadgitlab-ce-615eb1f007f6a92d5812735bc1087e429d5b913a.tar.gz
Merge branch 'feature/admin-user-groups-link' into 'master'
Make the 'Group projects' links clickable in the admin screens ## What does this MR do? This MR makes the group links within the 'users' section of the admin interface clickable. Currently, to view the details of groups a user is a member of, you have to go back to the 'groups' tab (which isn't ideal). ## Are there points in the code the reviewer needs to double check? No ## Why was this MR needed? It's a UX improvement - it saves going back to the 'groups' a user is a member of and then clicking the group to view the group details. ## Screenshots (if relevant) ### Before ![Screenshot_from_2016-11-21_14-25-01](/uploads/2a6b75efd4c700e5760c64f0db17e847/Screenshot_from_2016-11-21_14-25-01.png) ### After ![Screenshot_from_2016-11-21_14-24-42](/uploads/9be288c1d9e4cf818c96e11e24790860/Screenshot_from_2016-11-21_14-24-42.png) ## Does this MR meet the acceptance criteria? - [ ] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if it does - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !7620
-rw-r--r--app/views/admin/users/projects.html.haml2
-rw-r--r--changelogs/unreleased/feature-admin-user-groups-link.yml4
-rw-r--r--spec/features/admin/admin_users_spec.rb28
3 files changed, 33 insertions, 1 deletions
diff --git a/app/views/admin/users/projects.html.haml b/app/views/admin/users/projects.html.haml
index 84b9ceb23b3..dd6b7303493 100644
--- a/app/views/admin/users/projects.html.haml
+++ b/app/views/admin/users/projects.html.haml
@@ -7,7 +7,7 @@
%ul.well-list
- @user.groups.each do |group|
%li
- %strong= group.name
+ %strong= link_to group.name, admin_group_path(group)
&ndash; access to
#{pluralize(group.projects.count, 'project')}
diff --git a/changelogs/unreleased/feature-admin-user-groups-link.yml b/changelogs/unreleased/feature-admin-user-groups-link.yml
new file mode 100644
index 00000000000..b89c08f82d7
--- /dev/null
+++ b/changelogs/unreleased/feature-admin-user-groups-link.yml
@@ -0,0 +1,4 @@
+---
+title: The admin user projects view now has a clickable group link
+merge_request: 7620
+author: James Gregory
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb
index cb3191dfdde..e31325ce47b 100644
--- a/spec/features/admin/admin_users_spec.rb
+++ b/spec/features/admin/admin_users_spec.rb
@@ -225,4 +225,32 @@ describe "Admin::Users", feature: true do
end
end
end
+
+ describe "GET /admin/users/:id/projects" do
+ before do
+ @group = create(:group)
+ @project = create(:project, group: @group)
+ @simple_user = create(:user)
+ @group.add_developer(@simple_user)
+
+ visit projects_admin_user_path(@simple_user)
+ end
+
+ it "lists group projects" do
+ within(:css, '.append-bottom-default + .panel') do
+ expect(page).to have_content 'Group projects'
+ expect(page).to have_link @group.name, admin_group_path(@group)
+ end
+ end
+
+ it 'allows navigation to the group details' do
+ within(:css, '.append-bottom-default + .panel') do
+ click_link @group.name
+ end
+ within(:css, 'h3.page-title') do
+ expect(page).to have_content "Group: #{@group.name}"
+ end
+ expect(page).to have_content @project.name
+ end
+ end
end