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
f7599ef0
Commit
f7599ef0
authored
Aug 15, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter issues by multiple assignee. Intargrate BE and FE parts
parent
64cbe0a2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+1
-1
app/finders/issues_finder.rb
app/finders/issues_finder.rb
+2
-2
spec/features/issues/filtered_search/filter_issues_spec.rb
spec/features/issues/filtered_search/filter_issues_spec.rb
+11
-1
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+3
-3
No files found.
app/finders/issuable_finder.rb
View file @
f7599ef0
...
...
@@ -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
...
...
app/finders/issues_finder.rb
View file @
f7599ef0
...
...
@@ -118,8 +118,8 @@ class IssuesFinder < IssuableFinder
@assignees
=
if
params
[
:assignee_ids
]
User
.
where
(
id:
params
[
:assignee_ids
])
elsif
params
[
:assignee_username
s
]
User
.
where
(
username:
params
[
:assignee_username
s
])
elsif
params
[
:assignee_username
]
User
.
where
(
username:
params
[
:assignee_username
])
else
[]
end
...
...
spec/features/issues/filtered_search/filter_issues_spec.rb
View file @
f7599ef0
...
...
@@ -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
...
...
spec/finders/issues_finder_spec.rb
View file @
f7599ef0
...
...
@@ -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_username
s
:
[
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
...
...
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