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
b5266f60
Commit
b5266f60
authored
Sep 06, 2021
by
Eulyeon Ko
Committed by
Mark Chao
Sep 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow filtering of issues by negated author in GraphQL
parent
08fb7d51
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
app/graphql/types/issues/negated_issue_filter_input_type.rb
app/graphql/types/issues/negated_issue_filter_input_type.rb
+3
-0
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
spec/graphql/resolvers/issues_resolver_spec.rb
spec/graphql/resolvers/issues_resolver_spec.rb
+10
-0
No files found.
app/graphql/types/issues/negated_issue_filter_input_type.rb
View file @
b5266f60
...
...
@@ -14,6 +14,9 @@ module Types
argument
:milestone_title
,
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'Milestone not applied to this issue.'
argument
:author_username
,
GraphQL
::
Types
::
String
,
required:
false
,
description:
"Username of a user who didn't author the issue."
argument
:assignee_usernames
,
[
GraphQL
::
Types
::
String
],
required:
false
,
description:
'Usernames of users not assigned to the issue.'
...
...
doc/api/graphql/reference/index.md
View file @
b5266f60
...
...
@@ -17548,6 +17548,7 @@ Represents an escalation rule.
| ---- | ---- | ----------- |
|
<a
id=
"negatedissuefilterinputassigneeid"
></a>
`assigneeId`
|
[
`String`
](
#string
)
| ID of a user not assigned to the issues. |
|
<a
id=
"negatedissuefilterinputassigneeusernames"
></a>
`assigneeUsernames`
|
[
`[String!]`
](
#string
)
| Usernames of users not assigned to the issue. |
|
<a
id=
"negatedissuefilterinputauthorusername"
></a>
`authorUsername`
|
[
`String`
](
#string
)
| Username of a user who didn't author the issue. |
|
<a
id=
"negatedissuefilterinputepicid"
></a>
`epicId`
|
[
`String`
](
#string
)
| ID of an epic not associated with the issues. |
|
<a
id=
"negatedissuefilterinputiids"
></a>
`iids`
|
[
`[String!]`
](
#string
)
| List of IIDs of issues to exclude. For example,
`[1, 2]`
. |
|
<a
id=
"negatedissuefilterinputiterationid"
></a>
`iterationId`
|
[
`[ID!]`
](
#id
)
| List of iteration Global IDs not applied to the issue. |
...
...
spec/graphql/resolvers/issues_resolver_spec.rb
View file @
b5266f60
...
...
@@ -6,6 +6,7 @@ RSpec.describe Resolvers::IssuesResolver do
include
GraphqlHelpers
let_it_be
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:reporter
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
)
}
...
...
@@ -27,6 +28,7 @@ RSpec.describe Resolvers::IssuesResolver do
context
"with a project"
do
before_all
do
project
.
add_developer
(
current_user
)
project
.
add_reporter
(
reporter
)
create
(
:label_link
,
label:
label1
,
target:
issue1
)
create
(
:label_link
,
label:
label1
,
target:
issue2
)
create
(
:label_link
,
label:
label2
,
target:
issue2
)
...
...
@@ -235,6 +237,14 @@ RSpec.describe Resolvers::IssuesResolver do
it
'returns issues without the specified assignee_id'
do
expect
(
resolve_issues
(
not:
{
assignee_id:
[
assignee
.
id
]
})).
to
contain_exactly
(
issue1
)
end
context
'when filtering by negated author'
do
let_it_be
(
:issue_by_reporter
)
{
create
(
:issue
,
author:
reporter
,
project:
project
,
state: :opened
)
}
it
'returns issues without the specified author_username'
do
expect
(
resolve_issues
(
not:
{
author_username:
issue1
.
author
.
username
})).
to
contain_exactly
(
issue_by_reporter
)
end
end
end
describe
'sorting'
do
...
...
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