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
7fd235da
Commit
7fd235da
authored
Mar 06, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed Ruby to use symbol
parent
73cbd727
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
app/assets/javascripts/protected_branches/protected_branch_access_dropdown.js
...ts/protected_branches/protected_branch_access_dropdown.js
+1
-1
app/controllers/projects/protected_branches_controller.rb
app/controllers/projects/protected_branches_controller.rb
+2
-2
spec/features/protected_branches/access_control_ee_spec.rb
spec/features/protected_branches/access_control_ee_spec.rb
+3
-0
No files found.
app/assets/javascripts/protected_branches/protected_branch_access_dropdown.js
View file @
7fd235da
...
...
@@ -25,7 +25,7 @@
this
.
isAllowedToPushDropdown
=
false
;
this
.
groups
=
[];
this
.
accessLevel
=
accessLevel
;
this
.
accessLevelsData
=
accessLevelsData
.
R
oles
;
this
.
accessLevelsData
=
accessLevelsData
.
r
oles
;
this
.
$dropdown
=
$dropdown
;
this
.
$wrap
=
this
.
$dropdown
.
closest
(
`.
${
this
.
accessLevel
}
-container`
);
this
.
usersPath
=
'
/autocomplete/users.json
'
;
...
...
app/controllers/projects/protected_branches_controller.rb
View file @
7fd235da
...
...
@@ -70,10 +70,10 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
def
access_levels_options
{
push_access_levels:
{
"Roles"
=>
ProtectedBranch
::
PushAccessLevel
.
human_access_levels
.
map
{
|
id
,
text
|
{
id:
id
,
text:
text
,
before_divider:
true
}
},
roles:
ProtectedBranch
::
PushAccessLevel
.
human_access_levels
.
map
{
|
id
,
text
|
{
id:
id
,
text:
text
,
before_divider:
true
}
},
},
merge_access_levels:
{
"Roles"
=>
ProtectedBranch
::
MergeAccessLevel
.
human_access_levels
.
map
{
|
id
,
text
|
{
id:
id
,
text:
text
,
before_divider:
true
}
},
roles:
ProtectedBranch
::
MergeAccessLevel
.
human_access_levels
.
map
{
|
id
,
text
|
{
id:
id
,
text:
text
,
before_divider:
true
}
},
},
selected_merge_access_levels:
@protected_branch
.
merge_access_levels
.
map
{
|
access_level
|
access_level
.
user_id
||
access_level
.
access_level
},
selected_push_access_levels:
@protected_branch
.
push_access_levels
.
map
{
|
access_level
|
access_level
.
user_id
||
access_level
.
access_level
}
...
...
spec/features/protected_branches/access_control_ee_spec.rb
View file @
7fd235da
...
...
@@ -92,10 +92,13 @@ RSpec.shared_examples "protected branches > access control > EE" do
within
(
".protected-branches-list"
)
do
find
(
".js-allowed-to-
#{
git_operation
}
"
).
click
find
(
".dropdown-input-field"
).
set
(
users
.
last
.
name
)
# Find a user that is not loaded
expect
(
page
).
to
have_selector
(
'.dropdown-header'
,
count:
3
)
%w{Roles Groups Users}
.
each_with_index
do
|
header
,
index
|
expect
(
all
(
'.dropdown-header'
)[
index
]).
to
have_content
(
header
)
end
wait_for_ajax
click_on
users
.
last
.
name
find
(
".js-allowed-to-
#{
git_operation
}
"
).
click
# close
...
...
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