Commit e9955926 authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'user-search-dropdown' into 'master'

Revert change to search all users

## What does this MR do?

Reverts a change that allowed the user to search for all users in the author/assignee dropdown

## Are there points in the code the reviewer needs to double check?

Double check it isn't still searching all users

See merge request !4564
parents 2e7e2b53 a4b3bdab
...@@ -95,7 +95,7 @@ class @UsersSelect ...@@ -95,7 +95,7 @@ class @UsersSelect
data: (term, callback) => data: (term, callback) =>
isAuthorFilter = $('.js-author-search') isAuthorFilter = $('.js-author-search')
@users term, term is '' and isAuthorFilter, (users) => @users term, (users) =>
if term.length is 0 if term.length is 0
showDivider = 0 showDivider = 0
...@@ -221,7 +221,7 @@ class @UsersSelect ...@@ -221,7 +221,7 @@ class @UsersSelect
multiple: $(select).hasClass('multiselect') multiple: $(select).hasClass('multiselect')
minimumInputLength: 0 minimumInputLength: 0
query: (query) => query: (query) =>
@users query.term, @projectId?, (users) => @users query.term, (users) =>
data = { results: users } data = { results: users }
if query.term.length == 0 if query.term.length == 0
...@@ -304,7 +304,7 @@ class @UsersSelect ...@@ -304,7 +304,7 @@ class @UsersSelect
# Return users list. Filtered by query # Return users list. Filtered by query
# Only active users retrieved # Only active users retrieved
users: (query, fromProject, callback) => users: (query, callback) =>
url = @buildUrl(@usersPath) url = @buildUrl(@usersPath)
$.ajax( $.ajax(
...@@ -313,7 +313,7 @@ class @UsersSelect ...@@ -313,7 +313,7 @@ class @UsersSelect
search: query search: query
per_page: 20 per_page: 20
active: true active: true
project_id: @projectId if fromProject project_id: @projectId
group_id: @groupId group_id: @groupId
current_user: @showCurrentUser current_user: @showCurrentUser
author_id: @authorId author_id: @authorId
......
...@@ -294,40 +294,4 @@ describe 'Filter issues', feature: true do ...@@ -294,40 +294,4 @@ describe 'Filter issues', feature: true do
end end
end end
end end
describe 'filter by any author', js: true do
before do
user2 = create(:user, name: "tester")
create(:issue, project: project, author: user)
create(:issue, project: project, author: user2)
visit namespace_project_issues_path(project.namespace, project)
end
it 'should show filter by any author link' do
click_button "Author"
fill_in "Search authors", with: "tester"
page.within ".dropdown-menu-author" do
expect(page).to have_content "tester"
end
end
it 'should show filter issues by any author' do
page.within '.issues-list' do
expect(page).to have_selector ".issue", count: 2
end
click_button "Author"
fill_in "Search authors", with: "tester"
page.within ".dropdown-menu-author" do
click_link "tester"
end
page.within '.issues-list' do
expect(page).to have_selector ".issue", count: 1
end
end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment