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
e44e71cf
Commit
e44e71cf
authored
Jun 08, 2021
by
Jan Provaznik
Committed by
Etienne Baqué
Jun 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add epics filters to epic board lists
parent
7113b604
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
15 deletions
+30
-15
app/graphql/resolvers/board_list_issues_resolver.rb
app/graphql/resolvers/board_list_issues_resolver.rb
+2
-2
app/graphql/resolvers/board_lists_resolver.rb
app/graphql/resolvers/board_lists_resolver.rb
+2
-2
app/graphql/resolvers/concerns/board_item_filterable.rb
app/graphql/resolvers/concerns/board_item_filterable.rb
+3
-3
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-0
ee/app/graphql/ee/resolvers/board_item_filterable.rb
ee/app/graphql/ee/resolvers/board_item_filterable.rb
+1
-1
ee/app/graphql/resolvers/board_groupings/epics_resolver.rb
ee/app/graphql/resolvers/board_groupings/epics_resolver.rb
+2
-2
ee/app/graphql/resolvers/boards/epic_lists_resolver.rb
ee/app/graphql/resolvers/boards/epic_lists_resolver.rb
+7
-1
ee/app/graphql/types/boards/epic_list_type.rb
ee/app/graphql/types/boards/epic_list_type.rb
+3
-1
ee/spec/requests/api/graphql/boards/epic_lists_query_spec.rb
ee/spec/requests/api/graphql/boards/epic_lists_query_spec.rb
+9
-3
No files found.
app/graphql/resolvers/board_list_issues_resolver.rb
View file @
e44e71cf
...
...
@@ -2,7 +2,7 @@
module
Resolvers
class
BoardListIssuesResolver
<
BaseResolver
include
BoardI
ssue
Filterable
include
BoardI
tem
Filterable
argument
:filters
,
Types
::
Boards
::
BoardIssueInputType
,
required:
false
,
...
...
@@ -13,7 +13,7 @@ module Resolvers
alias_method
:list
,
:object
def
resolve
(
**
args
)
filter_params
=
i
ssue
_filters
(
args
[
:filters
]).
merge
(
board_id:
list
.
board
.
id
,
id:
list
.
id
)
filter_params
=
i
tem
_filters
(
args
[
:filters
]).
merge
(
board_id:
list
.
board
.
id
,
id:
list
.
id
)
service
=
::
Boards
::
Issues
::
ListService
.
new
(
list
.
board
.
resource_parent
,
context
[
:current_user
],
filter_params
)
offset_pagination
(
service
.
execute
)
...
...
app/graphql/resolvers/board_lists_resolver.rb
View file @
e44e71cf
...
...
@@ -2,7 +2,7 @@
module
Resolvers
class
BoardListsResolver
<
BaseResolver
include
BoardI
ssue
Filterable
include
BoardI
tem
Filterable
include
Gitlab
::
Graphql
::
Authorize
::
AuthorizeResource
include
LooksAhead
...
...
@@ -22,7 +22,7 @@ module Resolvers
def
resolve_with_lookahead
(
id:
nil
,
issue_filters:
{})
lists
=
board_lists
(
id
)
context
.
scoped_set!
(
:issue_filters
,
i
ssue
_filters
(
issue_filters
))
context
.
scoped_set!
(
:issue_filters
,
i
tem
_filters
(
issue_filters
))
List
.
preload_preferences_for_user
(
lists
,
current_user
)
if
load_preferences?
...
...
app/graphql/resolvers/concerns/board_i
ssue
_filterable.rb
→
app/graphql/resolvers/concerns/board_i
tem
_filterable.rb
View file @
e44e71cf
# frozen_string_literal: true
module
BoardI
ssue
Filterable
module
BoardI
tem
Filterable
extend
ActiveSupport
::
Concern
private
def
i
ssue
_filters
(
args
)
def
i
tem
_filters
(
args
)
filters
=
args
.
to_h
set_filter_values
(
filters
)
...
...
@@ -32,4 +32,4 @@ module BoardIssueFilterable
end
end
::
BoardI
ssueFilterable
.
prepend_mod_with
(
'Resolvers::BoardIssue
Filterable'
)
::
BoardI
temFilterable
.
prepend_mod_with
(
'Resolvers::BoardItem
Filterable'
)
doc/api/graphql/reference/index.md
View file @
e44e71cf
...
...
@@ -8567,6 +8567,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
| Name | Type | Description |
| ---- | ---- | ----------- |
|
<a
id=
"epicboardlistsepicfilters"
></a>
`epicFilters`
|
[
`EpicFilters`
](
#epicfilters
)
| Filters applied when getting epic metadata in the epic board list. |
|
<a
id=
"epicboardlistsid"
></a>
`id`
|
[
`BoardsEpicListID`
](
#boardsepiclistid
)
| Find an epic board list by ID. |
### `EpicDescendantCount`
...
...
ee/app/graphql/ee/resolvers/board_i
ssue
_filterable.rb
→
ee/app/graphql/ee/resolvers/board_i
tem
_filterable.rb
View file @
e44e71cf
...
...
@@ -2,7 +2,7 @@
module
EE
module
Resolvers
module
BoardI
ssue
Filterable
module
BoardI
tem
Filterable
extend
ActiveSupport
::
Concern
extend
::
Gitlab
::
Utils
::
Override
...
...
ee/app/graphql/resolvers/board_groupings/epics_resolver.rb
View file @
e44e71cf
...
...
@@ -3,7 +3,7 @@
module
Resolvers
module
BoardGroupings
class
EpicsResolver
<
BaseResolver
include
::
BoardI
ssue
Filterable
include
::
BoardI
tem
Filterable
alias_method
:board
,
:object
...
...
@@ -25,7 +25,7 @@ module Resolvers
private
def
board_epic_ids
(
issue_params
)
params
=
i
ssue
_filters
(
issue_params
).
merge
(
all_lists:
true
,
board_id:
board
.
id
)
params
=
i
tem
_filters
(
issue_params
).
merge
(
all_lists:
true
,
board_id:
board
.
id
)
list_service
=
::
Boards
::
Issues
::
ListService
.
new
(
board
.
resource_parent
,
...
...
ee/app/graphql/resolvers/boards/epic_lists_resolver.rb
View file @
e44e71cf
...
...
@@ -5,6 +5,7 @@ module Resolvers
class
EpicListsResolver
<
BaseResolver
include
Gitlab
::
Graphql
::
Authorize
::
AuthorizeResource
include
LooksAhead
include
::
BoardItemFilterable
type
Types
::
Boards
::
EpicListType
.
connection_type
,
null:
true
...
...
@@ -12,12 +13,17 @@ module Resolvers
required:
false
,
description:
'Find an epic board list by ID.'
argument
:epic_filters
,
Types
::
Boards
::
BoardEpicInputType
,
required:
false
,
description:
'Filters applied when getting epic metadata in the epic board list.'
alias_method
:epic_board
,
:object
def
resolve_with_lookahead
(
id:
nil
)
def
resolve_with_lookahead
(
id:
nil
,
epic_filters:
{}
)
authorize!
lists
=
board_lists
(
id
)
context
.
scoped_set!
(
:epic_filters
,
item_filters
(
epic_filters
))
if
load_preferences?
(
lookahead
)
::
Boards
::
EpicList
.
preload_preferences_for_user
(
lists
,
current_user
)
...
...
ee/app/graphql/types/boards/epic_list_type.rb
View file @
e44e71cf
...
...
@@ -48,8 +48,10 @@ module Types
def
metadata
strong_memoize
(
:metadata
)
do
params
=
(
context
[
:epic_filters
]
||
{}).
merge
(
board_id:
list
.
epic_board_id
,
id:
list
.
id
)
::
Boards
::
Epics
::
ListService
.
new
(
list
.
epic_board
.
resource_parent
,
current_user
,
{
board_id:
list
.
epic_board_id
,
id:
list
.
id
}
)
.
new
(
list
.
epic_board
.
resource_parent
,
current_user
,
params
)
.
metadata
end
end
...
...
ee/spec/requests/api/graphql/boards/epic_lists_query_spec.rb
View file @
e44e71cf
...
...
@@ -80,11 +80,17 @@ RSpec.describe 'get list of epic boards' do
end
it
'returns the correct values for count'
do
create_list
(
:epic
,
2
,
group:
group
)
# epics in backlog, the list which is returned first
label
=
create
(
:group_label
,
group:
group
)
# Epics in backlog, the list which is returned first. The first epic
# should be ignored because it doesn't have the label by which we are
# filtering.
create
(
:labeled_epic
,
group:
group
)
create
(
:labeled_epic
,
group:
group
,
labels:
[
label
])
post_graphql
(
pagination_query
,
current_user:
current_user
)
params
=
{
epicFilters:
{
labelName:
label
.
title
}
}
post_graphql
(
pagination_query
(
params
),
current_user:
current_user
)
assert_field_value
(
'epicsCount'
,
[
2
,
0
,
0
])
assert_field_value
(
'epicsCount'
,
[
1
,
0
,
0
])
end
end
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