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
e73269a0
Commit
e73269a0
authored
Feb 02, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Mirror User dropdown
parent
9b5e4b69
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
CHANGELOG-EE
CHANGELOG-EE
+1
-0
app/controllers/autocomplete_controller.rb
app/controllers/autocomplete_controller.rb
+2
-1
spec/controllers/autocomplete_controller_spec.rb
spec/controllers/autocomplete_controller_spec.rb
+12
-1
No files found.
CHANGELOG-EE
View file @
e73269a0
...
@@ -7,6 +7,7 @@ v 8.5.0 (unreleased)
...
@@ -7,6 +7,7 @@ v 8.5.0 (unreleased)
v 8.4.3
v 8.4.3
- Elasticsearch: fix partial blob indexing on push
- Elasticsearch: fix partial blob indexing on push
- Elasticsearch: added advanced indexer for repositories
- Elasticsearch: added advanced indexer for repositories
- Fix Mirror User dropdown
v 8.4.2
v 8.4.2
- Elasticsearch indexer performance improvements
- Elasticsearch indexer performance improvements
...
...
app/controllers/autocomplete_controller.rb
View file @
e73269a0
...
@@ -8,7 +8,8 @@ class AutocompleteController < ApplicationController
...
@@ -8,7 +8,8 @@ class AutocompleteController < ApplicationController
@users
=
@users
.
active
@users
=
@users
.
active
@users
=
@users
.
reorder
(
:name
)
@users
=
@users
.
reorder
(
:name
)
if
params
[
:push_code_to_protected_branches
].
present?
&&
project
if
params
[
:push_code_to_protected_branches
].
present?
&&
params
[
:project_id
].
present?
project
=
Project
.
find_by
(
id:
params
[
:project_id
])
@users
=
@users
.
to_a
.
select
{
|
user
|
user
.
can?
(
:push_code_to_protected_branches
,
project
)
}.
take
(
PER_PAGE
)
@users
=
@users
.
to_a
.
select
{
|
user
|
user
.
can?
(
:push_code_to_protected_branches
,
project
)
}.
take
(
PER_PAGE
)
else
else
@users
=
@users
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@users
=
@users
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
...
...
spec/controllers/autocomplete_controller_spec.rb
View file @
e73269a0
...
@@ -10,6 +10,7 @@ describe AutocompleteController do
...
@@ -10,6 +10,7 @@ describe AutocompleteController do
before
do
before
do
sign_in
(
user
)
sign_in
(
user
)
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user2
,
:developer
]
end
end
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
...
@@ -20,7 +21,7 @@ describe AutocompleteController do
...
@@ -20,7 +21,7 @@ describe AutocompleteController do
end
end
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
.
size
).
to
eq
1
}
it
{
expect
(
body
.
size
).
to
eq
2
}
it
{
expect
(
body
.
first
[
"username"
]).
to
eq
user
.
username
}
it
{
expect
(
body
.
first
[
"username"
]).
to
eq
user
.
username
}
end
end
...
@@ -31,6 +32,16 @@ describe AutocompleteController do
...
@@ -31,6 +32,16 @@ describe AutocompleteController do
it
{
expect
(
response
.
status
).
to
eq
(
404
)
}
it
{
expect
(
response
.
status
).
to
eq
(
404
)
}
end
end
describe
"GET #users that can push to protected branches"
do
before
do
get
(
:users
,
project_id:
project
.
id
,
push_code_to_protected_branches:
'true'
)
end
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
.
size
).
to
eq
1
}
it
{
expect
(
body
.
first
[
"username"
]).
to
eq
user
.
username
}
end
end
end
context
'group members'
do
context
'group members'
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