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
57ad690e
Commit
57ad690e
authored
Apr 13, 2021
by
Eulyeon Ko
Committed by
Jan Provaznik
Apr 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support filtering by assignee wildcard in GraphQL
parent
92cfa61d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
2 deletions
+64
-2
app/graphql/resolvers/concerns/board_issue_filterable.rb
app/graphql/resolvers/concerns/board_issue_filterable.rb
+11
-0
app/graphql/types/boards/assignee_wildcard_id_enum.rb
app/graphql/types/boards/assignee_wildcard_id_enum.rb
+13
-0
app/graphql/types/boards/board_issue_input_type.rb
app/graphql/types/boards/board_issue_input_type.rb
+4
-0
changelogs/unreleased/280781-support-assignee-wildcard-filters-board-issues-graphql.yml
...upport-assignee-wildcard-filters-board-issues-graphql.yml
+5
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+9
-0
ee/app/graphql/ee/resolvers/board_issue_filterable.rb
ee/app/graphql/ee/resolvers/board_issue_filterable.rb
+2
-0
spec/graphql/resolvers/board_list_issues_resolver_spec.rb
spec/graphql/resolvers/board_list_issues_resolver_spec.rb
+18
-0
spec/graphql/types/boards/board_issue_input_type_spec.rb
spec/graphql/types/boards/board_issue_input_type_spec.rb
+2
-2
No files found.
app/graphql/resolvers/concerns/board_issue_filterable.rb
View file @
57ad690e
...
...
@@ -18,6 +18,17 @@ module BoardIssueFilterable
end
def
set_filter_values
(
filters
)
filter_by_assignee
(
filters
)
end
def
filter_by_assignee
(
filters
)
if
filters
[
:assignee_username
]
&&
filters
[
:assignee_wildcard_id
]
raise
::
Gitlab
::
Graphql
::
Errors
::
ArgumentError
,
'Incompatible arguments: assigneeUsername, assigneeWildcardId.'
end
if
filters
[
:assignee_wildcard_id
]
filters
[
:assignee_id
]
=
filters
.
delete
(
:assignee_wildcard_id
)
end
end
end
...
...
app/graphql/types/boards/assignee_wildcard_id_enum.rb
0 → 100644
View file @
57ad690e
# frozen_string_literal: true
module
Types
module
Boards
class
AssigneeWildcardIdEnum
<
BaseEnum
graphql_name
'AssigneeWildcardId'
description
'Assignee ID wildcard values'
value
'NONE'
,
'No assignee is assigned.'
value
'ANY'
,
'An assignee is assigned.'
end
end
end
app/graphql/types/boards/board_issue_input_type.rb
View file @
57ad690e
...
...
@@ -18,6 +18,10 @@ module Types
argument
:search
,
GraphQL
::
STRING_TYPE
,
required:
false
,
description:
'Search query for issue title or description.'
argument
:assignee_wildcard_id
,
::
Types
::
Boards
::
AssigneeWildcardIdEnum
,
required:
false
,
description:
'Filter by assignee wildcard. Incompatible with assigneeUsername.'
end
end
end
...
...
changelogs/unreleased/280781-support-assignee-wildcard-filters-board-issues-graphql.yml
0 → 100644
View file @
57ad690e
---
title
:
Support filtering by assignee wildcard in GraphQL board list issues query
merge_request
:
58996
author
:
type
:
added
doc/api/graphql/reference/index.md
View file @
57ad690e
...
...
@@ -7525,6 +7525,15 @@ The kind of an approval rule.
|
`REGULAR`
| A
`regular`
approval rule. |
|
`REPORT_APPROVER`
| A
`report_approver`
approval rule. |
### `AssigneeWildcardId`
Assignee ID wildcard values.
| Value | Description |
| ----- | ----------- |
|
`ANY`
| An assignee is assigned. |
|
`NONE`
| No assignee is assigned. |
### `AvailabilityEnum`
User availability status.
...
...
ee/app/graphql/ee/resolvers/board_issue_filterable.rb
View file @
57ad690e
...
...
@@ -10,6 +10,8 @@ module EE
def
set_filter_values
(
filters
)
filter_by_epic
(
filters
)
filter_by_iteration
(
filters
)
super
end
private
...
...
spec/graphql/resolvers/board_list_issues_resolver_spec.rb
View file @
57ad690e
...
...
@@ -39,6 +39,24 @@ RSpec.describe Resolvers::BoardListIssuesResolver do
expect
(
result
).
to
match_array
([
issue1
])
end
it
'raises an exception if both assignee_username and assignee_wildcard_id are present'
do
expect
do
resolve_board_list_issues
(
args:
{
filters:
{
assignee_username:
[
'username'
],
assignee_wildcard_id:
'NONE'
}
})
end
.
to
raise_error
(
Gitlab
::
Graphql
::
Errors
::
ArgumentError
)
end
it
'accepts assignee wildcard id NONE'
do
result
=
resolve_board_list_issues
(
args:
{
filters:
{
assignee_wildcard_id:
'NONE'
}
})
expect
(
result
).
to
match_array
([
issue1
,
issue2
,
issue3
])
end
it
'accepts assignee wildcard id ANY'
do
result
=
resolve_board_list_issues
(
args:
{
filters:
{
assignee_wildcard_id:
'ANY'
}
})
expect
(
result
).
to
match_array
([])
end
end
end
...
...
spec/graphql/types/boards/board_issue_input_type_spec.rb
View file @
57ad690e
...
...
@@ -5,9 +5,9 @@ require 'spec_helper'
RSpec
.
describe
GitlabSchema
.
types
[
'BoardIssueInput'
]
do
it
{
expect
(
described_class
.
graphql_name
).
to
eq
(
'BoardIssueInput'
)
}
it
'
exposes negated issue argument
s'
do
it
'
has specific field
s'
do
allowed_args
=
%w(labelName milestoneTitle assigneeUsername authorUsername
releaseTag myReactionEmoji not search)
releaseTag myReactionEmoji not search
assigneeWildcardId
)
expect
(
described_class
.
arguments
.
keys
).
to
include
(
*
allowed_args
)
expect
(
described_class
.
arguments
[
'not'
].
type
).
to
eq
(
Types
::
Boards
::
NegatedBoardIssueInputType
)
...
...
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