BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
80073da9
Commit
80073da9
authored
Nov 17, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include author in assignee dropdown search
When searching for the author in the assignee dropdown it now correctly returns the user Closes #22905
parent
cfcf5460
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
2 deletions
+45
-2
autocomplete_controller.rb
app/controllers/autocomplete_controller.rb
+7
-1
assignee-dropdown-autocomplete.yml
changelogs/unreleased/assignee-dropdown-autocomplete.yml
+4
-0
issue_sidebar_spec.rb
spec/features/issues/issue_sidebar_spec.rb
+34
-1
No files found.
app/controllers/autocomplete_controller.rb
View file @
80073da9
...
...
@@ -55,7 +55,13 @@ class AutocompleteController < ApplicationController
def
find_users
@users
=
if
@project
@project
.
team
.
users
user_ids
=
@project
.
team
.
users
.
map
(
&
:id
)
if
params
[
:author_id
].
present?
user_ids
<<
params
[
:author_id
]
end
User
.
where
(
id:
user_ids
)
elsif
params
[
:group_id
].
present?
group
=
Group
.
find
(
params
[
:group_id
])
return
render_404
unless
can?
(
current_user
,
:read_group
,
group
)
...
...
changelogs/unreleased/assignee-dropdown-autocomplete.yml
0 → 100644
View file @
80073da9
---
title
:
Assignee dropdown now searches author of issue or merge request
merge_request
:
author
:
spec/features/issues/issue_sidebar_spec.rb
View file @
80073da9
require
'rails_helper'
feature
'Issue Sidebar'
,
feature:
true
do
let
(
:project
)
{
create
(
:project
)
}
include
WaitForAjax
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:user
)
{
create
(
:user
)}
...
...
@@ -10,6 +12,37 @@ feature 'Issue Sidebar', feature: true do
login_as
(
user
)
end
context
'assignee'
,
js:
true
do
let
(
:user2
)
{
create
(
:user
)
}
let
(
:issue2
)
{
create
(
:issue
,
project:
project
,
author:
user2
)
}
before
do
project
.
team
<<
[
user
,
:developer
]
visit_issue
(
project
,
issue2
)
find
(
'.block.assignee .edit-link'
).
click
wait_for_ajax
end
it
'shows author in assignee dropdown'
do
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
to
have_content
(
user2
.
name
)
end
end
it
'shows author when filtering assignee dropdown'
do
page
.
within
'.dropdown-menu-user'
do
find
(
'.dropdown-input-field'
).
native
.
send_keys
user2
.
name
sleep
1
# Required to wait for end of input delay
wait_for_ajax
expect
(
page
).
to
have_content
(
user2
.
name
)
end
end
end
context
'as a allowed user'
do
before
do
project
.
team
<<
[
user
,
:developer
]
...
...
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