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
f27c6f74
Commit
f27c6f74
authored
Dec 30, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'performance-fixes' into 'master'
Performance fixes Fixes #195 See merge request !280
parents
f71faaf3
15a0e1d6
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
24 deletions
+26
-24
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+2
-0
app/controllers/projects/group_links_controller.rb
app/controllers/projects/group_links_controller.rb
+2
-5
app/views/projects/group_links/index.html.haml
app/views/projects/group_links/index.html.haml
+16
-16
features/project/group_links.feature
features/project/group_links.feature
+1
-0
features/steps/project/project_group_links.rb
features/steps/project/project_group_links.rb
+5
-3
No files found.
app/assets/javascripts/dispatcher.js.coffee
View file @
f27c6f74
...
...
@@ -79,6 +79,8 @@ class Dispatcher
new
ProjectFork
()
when
'users:show'
new
User
()
when
'projects:group_links:index'
new
GroupsSelect
()
switch
path
.
first
()
when
'admin'
...
...
app/controllers/projects/group_links_controller.rb
View file @
f27c6f74
...
...
@@ -4,15 +4,12 @@ class Projects::GroupLinksController < Projects::ApplicationController
def
index
@group_links
=
project
.
project_group_links
.
all
@available_groups
=
Group
.
all
@available_groups
-=
project
.
invited_groups
@available_groups
-=
[
project
.
group
]
end
def
create
link
=
project
.
project_group_links
.
new
link
.
group_id
=
params
[
:group_id
]
link
.
group_access
=
params
[
:group_access
]
link
.
group_id
=
params
[
:
link_
group_id
]
link
.
group_access
=
params
[
:
link_
group_access
]
link
.
save
redirect_to
project_group_links_path
(
project
)
...
...
app/views/projects/group_links/index.html.haml
View file @
f27c6f74
...
...
@@ -20,20 +20,20 @@
%i
.icon-remove
disable sharing
-
if
@available_groups
.
present?
.available-groups
.available-groups
%h4
Can be shared with
%div
=
form_tag
project_group_links_path
(
@project
),
method: :post
,
class:
'form-horizontal'
do
.form-group
=
label_tag
:
group_id
,
'Group'
,
class:
'control-label'
=
label_tag
:link_
group_id
,
'Group'
,
class:
'control-label'
.col-sm-10
=
select_tag
:group_id
,
options_from_collection_for_select
(
@available_groups
,
:id
,
:name
),
class:
'select2'
=
groups_select_tag
(
:link_group_id
)
.form-group
=
label_tag
:
group_access
,
'Max access level'
,
class:
'control-label'
=
label_tag
:link_
group_access
,
'Max access level'
,
class:
'control-label'
.col-sm-10
=
select_tag
:
group_access
,
options_for_select
(
ProjectGroupLink
.
access_options
,
ProjectGroupLink
.
default_access
),
class:
"form-control"
=
select_tag
:link_
group_access
,
options_for_select
(
ProjectGroupLink
.
access_options
,
ProjectGroupLink
.
default_access
),
class:
"form-control"
.form-actions
=
submit_tag
"Share"
,
class:
"btn btn-create"
features/project/group_links.feature
View file @
f27c6f74
...
...
@@ -10,6 +10,7 @@ Feature: Project Group Links
Then
I should see project already shared with group
"Ops"
Then
I should see project is not shared with group
"Market"
@javascript
Scenario
:
I
share project with group
When
I select group
"Market"
for share
Then
I should see project is shared with group
"Market"
features/steps/project/project_group_links.rb
View file @
f27c6f74
...
...
@@ -2,6 +2,7 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
include
SharedAuthentication
include
SharedProject
include
SharedPaths
include
Select2Helper
step
'I should see project already shared with group "Ops"'
do
within
'.enabled-groups'
do
...
...
@@ -16,8 +17,9 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
end
step
'I select group "Market" for share'
do
select
"Master"
,
from:
'group_access'
select
"Market"
,
from:
'group_id'
group
=
Group
.
find_by
(
path:
'market'
)
select2
(
group
.
id
,
from:
"#link_group_id"
)
select
"Master"
,
from:
'link_group_access'
click_button
"Share"
end
...
...
@@ -35,7 +37,7 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
end
step
'project "Shop" is not shared with group "Market"'
do
create
(
:group
,
name:
'Market'
)
create
(
:group
,
name:
'Market'
,
path:
'market'
)
end
step
'I visit project group links page'
do
...
...
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