Commit f7599ef0 authored by Valery Sizov's avatar Valery Sizov

Filter issues by multiple assignee. Intargrate BE and FE parts

parent 64cbe0a2
......@@ -26,7 +26,7 @@ class IssuableFinder
IRRELEVANT_PARAMS_FOR_CACHE_KEY = %i[utf8 sort page state].freeze
SCALAR_PARAMS = %i(scope state group_id project_id milestone_title assignee_id search label_name sort assignee_username author_id author_username authorized_only due_date iids non_archived weight).freeze
ARRAY_PARAMS = { label_name: [], iids: [] }.freeze
ARRAY_PARAMS = { label_name: [], iids: [], assignee_username: [] }.freeze
VALID_PARAMS = (SCALAR_PARAMS + [ARRAY_PARAMS]).freeze
attr_accessor :current_user, :params
......
......@@ -118,8 +118,8 @@ class IssuesFinder < IssuableFinder
@assignees =
if params[:assignee_ids]
User.where(id: params[:assignee_ids])
elsif params[:assignee_usernames]
User.where(username: params[:assignee_usernames])
elsif params[:assignee_username]
User.where(username: params[:assignee_username])
else
[]
end
......
......@@ -196,7 +196,17 @@ describe 'Filter issues', js: true do
end
it 'filters issues by multiple assignees' do
skip('to be tested, issue #26546')
create(:issue, project: project, author: user, assignees: [user2, user])
input_filtered_search("assignee:@#{user.username} assignee:@#{user2.username}")
expect_tokens([
assignee_token(user.name),
assignee_token(user2.name)
])
expect_issues_list_count(1)
expect_filtered_search_input_empty
end
end
......
......@@ -64,7 +64,7 @@ describe IssuesFinder do
let(:params) { { assignee_ids: [user2.id, user3.id] } }
before do
project2.team << [user3, :developer]
project2.add_developer(user3)
issue3.assignees = [user2, user3]
end
......@@ -76,10 +76,10 @@ describe IssuesFinder do
context 'filtering by assignee usernames' do
set(:user3) { create(:user) }
let(:params) { { assignee_usernames: [user2.username, user3.username] } }
let(:params) { { assignee_username: [user2.username, user3.username] } }
before do
project2.team << [user3, :developer]
project2.add_developer(user3)
issue3.assignees = [user2, user3]
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