Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b2102468
Commit
b2102468
authored
Dec 28, 2016
by
James Gregory
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged the 'groups' and 'projects' tabs when viewing user profiles
parent
f9a49d09
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
32 deletions
+34
-32
app/assets/stylesheets/framework/common.scss
app/assets/stylesheets/framework/common.scss
+1
-0
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+0
-3
app/views/admin/users/_head.html.haml
app/views/admin/users/_head.html.haml
+1
-3
app/views/admin/users/groups.html.haml
app/views/admin/users/groups.html.haml
+0
-20
app/views/admin/users/projects.html.haml
app/views/admin/users/projects.html.haml
+11
-5
changelogs/unreleased/feature-admin-merge-groups-and-projects.yml
...gs/unreleased/feature-admin-merge-groups-and-projects.yml
+4
-0
config/routes/admin.rb
config/routes/admin.rb
+0
-1
spec/features/admin/admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+17
-0
No files found.
app/assets/stylesheets/framework/common.scss
View file @
b2102468
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
.append-bottom-default
{
margin-bottom
:
$gl-padding
;
}
.append-bottom-default
{
margin-bottom
:
$gl-padding
;
}
.inline
{
display
:
inline-block
;
}
.inline
{
display
:
inline-block
;
}
.center
{
text-align
:
center
;
}
.center
{
text-align
:
center
;
}
.vertical-align-middle
{
vertical-align
:
middle
;
}
.underlined-link
{
text-decoration
:
underline
;
}
.underlined-link
{
text-decoration
:
underline
;
}
.hint
{
font-style
:
italic
;
color
:
$hint-color
;
}
.hint
{
font-style
:
italic
;
color
:
$hint-color
;
}
...
...
app/controllers/admin/users_controller.rb
View file @
b2102468
...
@@ -16,9 +16,6 @@ class Admin::UsersController < Admin::ApplicationController
...
@@ -16,9 +16,6 @@ class Admin::UsersController < Admin::ApplicationController
@joined_projects
=
user
.
projects
.
joined
(
@user
)
@joined_projects
=
user
.
projects
.
joined
(
@user
)
end
end
def
groups
end
def
keys
def
keys
@keys
=
user
.
keys
@keys
=
user
.
keys
end
end
...
...
app/views/admin/users/_head.html.haml
View file @
b2102468
...
@@ -15,10 +15,8 @@
...
@@ -15,10 +15,8 @@
%ul
.nav-links
%ul
.nav-links
=
nav_link
(
path:
'users#show'
)
do
=
nav_link
(
path:
'users#show'
)
do
=
link_to
"Account"
,
admin_user_path
(
@user
)
=
link_to
"Account"
,
admin_user_path
(
@user
)
=
nav_link
(
path:
'users#groups'
)
do
=
link_to
"Groups"
,
groups_admin_user_path
(
@user
)
=
nav_link
(
path:
'users#projects'
)
do
=
nav_link
(
path:
'users#projects'
)
do
=
link_to
"
P
rojects"
,
projects_admin_user_path
(
@user
)
=
link_to
"
Groups and p
rojects"
,
projects_admin_user_path
(
@user
)
=
nav_link
(
path:
'users#keys'
)
do
=
nav_link
(
path:
'users#keys'
)
do
=
link_to
"SSH keys"
,
keys_admin_user_path
(
@user
)
=
link_to
"SSH keys"
,
keys_admin_user_path
(
@user
)
=
nav_link
(
controller: :identities
)
do
=
nav_link
(
controller: :identities
)
do
...
...
app/views/admin/users/groups.html.haml
deleted
100644 → 0
View file @
f9a49d09
-
page_title
"Groups"
,
@user
.
name
,
"Users"
=
render
'admin/users/head'
-
group_members
=
@user
.
group_members
.
includes
(
:source
)
-
if
group_members
.
any?
.panel.panel-default
.panel-heading
Groups:
%ul
.well-list
-
group_members
.
each
do
|
group_member
|
-
group
=
group_member
.
group
%li
.group_member
%span
{
class:
(
"list-item-name"
unless
group_member
.
owner?
)}
%strong
=
link_to
group
.
name
,
admin_group_path
(
group
)
.pull-right
%span
.light
=
group_member
.
human_access
-
unless
group_member
.
owner?
=
link_to
group_group_member_path
(
group
,
group_member
),
data:
{
confirm:
remove_member_message
(
group_member
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from group'
do
%i
.fa.fa-times.fa-inverse
-
else
.nothing-here-block
This user has no groups.
app/views/admin/users/projects.html.haml
View file @
b2102468
-
page_title
"
P
rojects"
,
@user
.
name
,
"Users"
-
page_title
"
Groups and p
rojects"
,
@user
.
name
,
"Users"
=
render
'admin/users/head'
=
render
'admin/users/head'
-
if
@user
.
groups
.
any?
-
if
@user
.
groups
.
any?
.panel.panel-default
.panel.panel-default
.panel-heading
Group projects
.panel-heading
Group projects
%ul
.well-list
%ul
.well-list
-
@user
.
groups
.
each
do
|
group
|
-
@user
.
group_members
.
includes
(
:source
).
each
do
|
group_member
|
%li
-
group
=
group_member
.
group
%li
.group_member
%strong
=
link_to
group
.
name
,
admin_group_path
(
group
)
%strong
=
link_to
group
.
name
,
admin_group_path
(
group
)
–
access to
–
access to
#{
pluralize
(
group
.
projects
.
count
,
'project'
)
}
#{
pluralize
(
group
.
projects
.
count
,
'project'
)
}
.pull-right
%span
.light.vertical-align-middle
=
group_member
.
human_access
-
unless
group_member
.
owner?
=
link_to
group_group_member_path
(
group
,
group_member
),
data:
{
confirm:
remove_member_message
(
group_member
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove prepend-left-10"
,
title:
'Remove user from group'
do
%i
.fa.fa-times.fa-inverse
.row
.row
.col-md-6
.col-md-6
...
@@ -35,8 +41,8 @@
...
@@ -35,8 +41,8 @@
-
if
member
.
owner?
-
if
member
.
owner?
%span
.light
Owner
%span
.light
Owner
-
else
-
else
%span
.light
=
member
.
human_access
%span
.light
.vertical-align-middle
=
member
.
human_access
-
if
member
.
respond_to?
:project
-
if
member
.
respond_to?
:project
=
link_to
namespace_project_project_member_path
(
project
.
namespace
,
project
,
member
),
data:
{
confirm:
remove_member_message
(
member
)
},
remote:
true
,
method: :delete
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from project'
do
=
link_to
namespace_project_project_member_path
(
project
.
namespace
,
project
,
member
),
data:
{
confirm:
remove_member_message
(
member
)
},
remote:
true
,
method: :delete
,
class:
"btn-xs btn btn-remove
prepend-left-10
"
,
title:
'Remove user from project'
do
%i
.fa.fa-times
%i
.fa.fa-times
changelogs/unreleased/feature-admin-merge-groups-and-projects.yml
0 → 100644
View file @
b2102468
---
title
:
Merged the 'Groups' and 'Projects' tabs when viewing user profiles
merge_request
:
8323
author
:
James Gregory
config/routes/admin.rb
View file @
b2102468
...
@@ -6,7 +6,6 @@ namespace :admin do
...
@@ -6,7 +6,6 @@ namespace :admin do
member
do
member
do
get
:projects
get
:projects
get
:keys
get
:keys
get
:groups
put
:block
put
:block
put
:unblock
put
:unblock
put
:unlock
put
:unlock
...
...
spec/features/admin/admin_users_spec.rb
View file @
b2102468
require
'spec_helper'
require
'spec_helper'
describe
"Admin::Users"
,
feature:
true
do
describe
"Admin::Users"
,
feature:
true
do
include
WaitForAjax
before
{
login_as
:admin
}
before
{
login_as
:admin
}
describe
"GET /admin/users"
do
describe
"GET /admin/users"
do
...
@@ -252,5 +254,20 @@ describe "Admin::Users", feature: true do
...
@@ -252,5 +254,20 @@ describe "Admin::Users", feature: true do
end
end
expect
(
page
).
to
have_content
@project
.
name
expect
(
page
).
to
have_content
@project
.
name
end
end
it
'shows the group access level'
do
within
(
:css
,
'.append-bottom-default + .panel'
)
do
expect
(
page
).
to
have_content
'Developer'
end
end
it
'allows group membership to be revoked'
,
js:
true
do
page
.
within
(
first
(
'.group_member'
))
do
find
(
'.btn-remove'
).
click
end
wait_for_ajax
expect
(
page
).
not_to
have_selector
(
'.group_member'
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment