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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
f23d25bb
Commit
f23d25bb
authored
Jun 10, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix admin:group spinach. Remove selecting .all projects for admin user at teams page
parent
4f953f6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
app/controllers/teams_controller.rb
app/controllers/teams_controller.rb
+1
-1
app/views/admin/groups/show.html.haml
app/views/admin/groups/show.html.haml
+13
-1
features/admin/groups.feature
features/admin/groups.feature
+1
-0
features/steps/admin/admin_groups.rb
features/steps/admin/admin_groups.rb
+2
-3
No files found.
app/controllers/teams_controller.rb
View file @
f23d25bb
...
@@ -17,7 +17,7 @@ class TeamsController < ApplicationController
...
@@ -17,7 +17,7 @@ class TeamsController < ApplicationController
def
edit
def
edit
projects
projects
@avaliable_projects
=
current_user
.
admin?
?
Project
.
without_team
(
user_team
)
:
current_user
.
owned_projects
.
without_team
(
user_team
)
@avaliable_projects
=
current_user
.
owned_projects
.
without_team
(
user_team
)
end
end
def
update
def
update
...
...
app/views/admin/groups/show.html.haml
View file @
f23d25bb
...
@@ -65,6 +65,18 @@
...
@@ -65,6 +65,18 @@
=
select_tag
:project_access
,
options_for_select
(
Project
.
access_options
),
{
class:
"project-access-select chosen span2"
}
=
select_tag
:project_access
,
options_for_select
(
Project
.
access_options
),
{
class:
"project-access-select chosen span2"
}
%hr
%hr
=
submit_tag
'Add user to projects in group'
,
class:
"btn btn-create"
=
submit_tag
'Add user to projects in group'
,
class:
"btn btn-create"
.ui-box
%h5
.title
Users from Group projects
%small
(
#{
@group
.
users
.
count
}
)
%ul
.well-list
-
@group
.
users
.
sort_by
(
&
:name
).
each
do
|
user
|
%li
{
class:
dom_class
(
user
)}
%strong
=
link_to
user
.
name
,
admin_user_path
(
user
)
%span
.pull-right.light
=
pluralize
user
.
authorized_projects
.
in_namespace
(
@group
).
count
,
'project'
.span6
.span6
.ui-box
.ui-box
...
@@ -73,7 +85,7 @@
...
@@ -73,7 +85,7 @@
%small
%small
(
#{
@group
.
projects
.
count
}
)
(
#{
@group
.
projects
.
count
}
)
%ul
.well-list
%ul
.well-list
-
@group
.
projects
.
each
do
|
project
|
-
@group
.
projects
.
sort_by
(
&
:name
).
each
do
|
project
|
%li
%li
%strong
%strong
=
link_to
project
.
name_with_namespace
,
[
:admin
,
project
]
=
link_to
project
.
name_with_namespace
,
[
:admin
,
project
]
...
...
features/admin/groups.feature
View file @
f23d25bb
...
@@ -11,6 +11,7 @@ Feature: Admin Groups
...
@@ -11,6 +11,7 @@ Feature: Admin Groups
Then
I should be redirected to group page
Then
I should be redirected to group page
And
I should see newly created group
And
I should see newly created group
@javascript
Scenario
:
Add user into projects in group
Scenario
:
Add user into projects in group
When
I visit admin group page
When
I visit admin group page
When
I select user
"John"
from user list as
"Reporter"
When
I select user
"John"
from user list as
"Reporter"
...
...
features/steps/admin/admin_groups.rb
View file @
f23d25bb
...
@@ -2,6 +2,7 @@ class AdminGroups < Spinach::FeatureSteps
...
@@ -2,6 +2,7 @@ class AdminGroups < Spinach::FeatureSteps
include
SharedAuthentication
include
SharedAuthentication
include
SharedPaths
include
SharedPaths
include
SharedActiveTab
include
SharedActiveTab
include
Select2Helper
When
'I visit admin group page'
do
When
'I visit admin group page'
do
visit
admin_group_path
(
current_group
)
visit
admin_group_path
(
current_group
)
...
@@ -40,8 +41,8 @@ class AdminGroups < Spinach::FeatureSteps
...
@@ -40,8 +41,8 @@ class AdminGroups < Spinach::FeatureSteps
When
'I select user "John" from user list as "Reporter"'
do
When
'I select user "John" from user list as "Reporter"'
do
user
=
User
.
find_by_name
(
"John"
)
user
=
User
.
find_by_name
(
"John"
)
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
within
"#new_team_member"
do
within
"#new_team_member"
do
select
user
.
name
,
from:
"user_ids"
select
"Reporter"
,
from:
"project_access"
select
"Reporter"
,
from:
"project_access"
end
end
click_button
"Add user to projects in group"
click_button
"Add user to projects in group"
...
@@ -49,8 +50,6 @@ class AdminGroups < Spinach::FeatureSteps
...
@@ -49,8 +50,6 @@ class AdminGroups < Spinach::FeatureSteps
Then
'I should see "John" in team list in every project as "Reporter"'
do
Then
'I should see "John" in team list in every project as "Reporter"'
do
user
=
User
.
find_by_name
(
"John"
)
user
=
User
.
find_by_name
(
"John"
)
projects_with_access
=
find
(
".user_
#{
user
.
id
}
.projects_access"
)
projects_with_access
.
should
have_link
(
"Reporter"
)
end
end
protected
protected
...
...
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