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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
25c57637
Commit
25c57637
authored
Dec 26, 2012
by
Andrey Kumanyaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add functional in user section
parent
9c574464
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
1 deletion
+59
-1
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+9
-0
app/views/groups/_new_group_member.html.haml
app/views/groups/_new_group_member.html.haml
+18
-0
app/views/groups/people.html.haml
app/views/groups/people.html.haml
+1
-1
config/routes.rb
config/routes.rb
+1
-0
features/group/group.feature
features/group/group.feature
+7
-0
features/steps/group/group.rb
features/steps/group/group.rb
+19
-0
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+4
-0
No files found.
app/controllers/groups_controller.rb
View file @
25c57637
...
...
@@ -53,9 +53,18 @@ class GroupsController < ApplicationController
if
@project
@team_member
=
@project
.
users_projects
.
new
else
@team_member
=
UsersProject
.
new
end
end
def
team_members
@group
.
projects
.
each
do
|
p
|
p
.
add_users_ids_to_team
(
params
[
:user_ids
],
params
[
:project_access
])
end
redirect_to
people_group_path
(
@group
),
notice:
'Users was successfully added.'
end
protected
def
group
...
...
app/views/groups/_new_group_member.html.haml
0 → 100644
View file @
25c57637
=
form_for
@team_member
,
as: :team_member
,
url:
team_members_group_path
(
@group
,
@team_member
)
do
|
f
|
%fieldset
%legend
=
"New Team member(s) for projects in
#{
@group
.
name
}
"
%h6
1. Choose people you want in the team
.clearfix
=
f
.
label
:user_ids
,
"People"
.input
=
select_tag
(
:user_ids
,
options_from_collection_for_select
(
User
.
active
,
:id
,
:name
),
{
data:
{
placeholder:
"Select users"
},
class:
"chosen xxlarge"
,
multiple:
true
})
%h6
2. Set access level for them
.clearfix
=
f
.
label
:project_access
,
"Project Access"
.input
=
select_tag
:project_access
,
options_for_select
(
Project
.
access_options
,
@team_member
.
project_access
),
class:
"project-access-select chosen"
.form-actions
=
hidden_field_tag
:redirect_to
,
people_group_path
(
@group
)
=
f
.
submit
'Add'
,
class:
"btn save-btn"
app/views/groups/people.html.haml
View file @
25c57637
...
...
@@ -17,4 +17,4 @@
%span
.cgray
=
user
.
email
-
if
@group
.
owner
==
user
%span
.btn.btn-small.disabled.right
Group Owner
=
render
"new_group_member"
config/routes.rb
View file @
25c57637
...
...
@@ -103,6 +103,7 @@ Gitlab::Application.routes.draw do
get
:merge_requests
get
:search
get
:people
put
:team_members
end
end
...
...
features/group/group.feature
View file @
25c57637
...
...
@@ -17,3 +17,10 @@ Feature: Groups
Given
project from group has merge requests assigned to me
When
I visit group merge requests page
Then
I should see merge requests from this group assigned to me
Scenario
:
I
should add user to projects in Group
Given
I have new user
"John"
When
I visit group page
When
I visit group people page
When
I select user
"John"
from list with role
"Reporter"
Then
I should see user
"John"
in team list
features/steps/group/group.rb
View file @
25c57637
...
...
@@ -32,6 +32,25 @@ class Groups < Spinach::FeatureSteps
end
end
Given
'I have new user "John"'
do
create
(
:user
,
name:
"John"
)
end
When
'I select user "John" from list with role "Reporter"'
do
user
=
User
.
find_by_name
(
"John"
)
within
"#new_team_member"
do
select
user
.
name
,
:from
=>
"user_ids"
select
"Reporter"
,
:from
=>
"project_access"
end
click_button
"Add"
end
Then
'I should see user "John" in team list'
do
user
=
User
.
find_by_name
(
"John"
)
projects_with_access
=
find
(
".ui-box .well-list li"
)
projects_with_access
.
should
have_content
(
"John"
)
end
Given
'project from group has issues assigned to me'
do
create
:issue
,
project:
project
,
...
...
features/steps/shared/paths.rb
View file @
25c57637
...
...
@@ -21,6 +21,10 @@ module SharedPaths
visit
merge_requests_group_path
(
current_group
)
end
When
'I visit group people page'
do
visit
people_group_path
(
current_group
)
end
# ----------------------------------------
# Dashboard
# ----------------------------------------
...
...
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