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
f4d6ee7e
Commit
f4d6ee7e
authored
Nov 11, 2021
by
Scott Stern
Committed by
James Fargher
Nov 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix graphql boards filtering by iterationId
parent
3140c76a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
ee/app/graphql/ee/resolvers/board_item_filterable.rb
ee/app/graphql/ee/resolvers/board_item_filterable.rb
+15
-1
ee/spec/graphql/ee/resolvers/board_list_issues_resolver_spec.rb
...c/graphql/ee/resolvers/board_list_issues_resolver_spec.rb
+6
-0
No files found.
ee/app/graphql/ee/resolvers/board_item_filterable.rb
View file @
f4d6ee7e
...
@@ -34,8 +34,22 @@ module EE
...
@@ -34,8 +34,22 @@ module EE
def
filter_by_iteration
(
filters
)
def
filter_by_iteration
(
filters
)
iteration_wildcard_id
=
filters
.
delete
(
:iteration_wildcard_id
)
iteration_wildcard_id
=
filters
.
delete
(
:iteration_wildcard_id
)
# passing string is not failing the check...should be an array
iterations
=
filters
[
:iteration_id
]
if
iteration_wildcard_id
if
iterations
.
present?
&&
iteration_wildcard_id
raise
::
Gitlab
::
Graphql
::
Errors
::
ArgumentError
,
'Incompatible arguments: iterationId, iterationWildCardId.'
end
if
iterations
.
present?
filters
[
:iteration_id
]
=
iterations
.
map
do
|
global_id
|
# TODO: remove this line when the compatibility layer is removed
# See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
parsed_id
=
::
Types
::
GlobalIDType
[
::
Iteration
].
coerce_isolated_input
(
global_id
)
parsed_id
&
.
model_id
end
elsif
iteration_wildcard_id
filters
[
:iteration_id
]
=
iteration_wildcard_id
filters
[
:iteration_id
]
=
iteration_wildcard_id
end
end
end
end
...
...
ee/spec/graphql/ee/resolvers/board_list_issues_resolver_spec.rb
View file @
f4d6ee7e
...
@@ -107,6 +107,12 @@ RSpec.describe Resolvers::BoardListIssuesResolver do
...
@@ -107,6 +107,12 @@ RSpec.describe Resolvers::BoardListIssuesResolver do
expect
(
result
).
to
contain_exactly
(
issue1
,
issue3
)
expect
(
result
).
to
contain_exactly
(
issue1
,
issue3
)
end
end
it
'accepts iteration iteration id'
do
result
=
resolve_board_list_issues
({
filters:
{
iteration_id:
[
iteration
.
to_global_id
]
}
})
expect
(
result
).
to
contain_exactly
(
issue2
)
end
context
'filterning by negated iteration'
do
context
'filterning by negated iteration'
do
it
'accepts iteration wildcard id'
do
it
'accepts iteration wildcard id'
do
result
=
resolve_board_list_issues
({
filters:
{
not:
{
iteration_wildcard_id:
'CURRENT'
}
}
})
result
=
resolve_board_list_issues
({
filters:
{
not:
{
iteration_wildcard_id:
'CURRENT'
}
}
})
...
...
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