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
5e32ee44
Commit
5e32ee44
authored
Feb 23, 2021
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviewer feedback
- Remove unneeded method - Rename variable
parent
6c2b0676
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
17 deletions
+4
-17
app/services/boards/base_items_list_service.rb
app/services/boards/base_items_list_service.rb
+2
-2
app/services/boards/issues/list_service.rb
app/services/boards/issues/list_service.rb
+0
-12
ee/spec/requests/api/graphql/boards/epic_lists_query_spec.rb
ee/spec/requests/api/graphql/boards/epic_lists_query_spec.rb
+2
-3
No files found.
app/services/boards/base_items_list_service.rb
View file @
5e32ee44
...
...
@@ -13,11 +13,11 @@ module Boards
# rubocop: disable CodeReuse/ActiveRecord
def
metadata
issues
=
item_model
.
arel_table
issu
abl
es
=
item_model
.
arel_table
keys
=
metadata_fields
.
keys
# TODO: eliminate need for SQL literal fragment
columns
=
Arel
.
sql
(
metadata_fields
.
values_at
(
*
keys
).
join
(
', '
))
results
=
item_model
.
where
(
id:
items
.
select
(
issues
[
:id
])).
pluck
(
columns
)
results
=
item_model
.
where
(
id:
items
.
select
(
issu
abl
es
[
:id
])).
pluck
(
columns
)
Hash
[
keys
.
zip
(
results
.
flatten
)]
end
...
...
app/services/boards/issues/list_service.rb
View file @
5e32ee44
...
...
@@ -9,18 +9,6 @@ module Boards
IssuesFinder
.
valid_params
end
# rubocop: disable CodeReuse/ActiveRecord
def
metadata
issues
=
Issue
.
arel_table
keys
=
metadata_fields
.
keys
# TODO: eliminate need for SQL literal fragment
columns
=
Arel
.
sql
(
metadata_fields
.
values_at
(
*
keys
).
join
(
', '
))
results
=
Issue
.
where
(
id:
items
.
select
(
issues
[
:id
])).
pluck
(
columns
)
Hash
[
keys
.
zip
(
results
.
flatten
)]
end
# rubocop: enable CodeReuse/ActiveRecord
private
def
ordered_items
...
...
ee/spec/requests/api/graphql/boards/epic_lists_query_spec.rb
View file @
5e32ee44
...
...
@@ -12,8 +12,6 @@ RSpec.describe 'get list of epic boards' do
let_it_be
(
:list2
)
{
create
(
:epic_list
,
epic_board:
board
,
list_type: :closed
)
}
let_it_be
(
:list3
)
{
create
(
:epic_list
,
epic_board:
board
,
list_type: :backlog
)
}
let_it_be
(
:some_epics
)
{
create_list
(
:epic
,
2
,
group:
group
)
}
def
pagination_query
(
params
=
{})
graphql_query_for
(
:group
,
{
full_path:
group
.
full_path
},
<<~
BOARDS
...
...
@@ -82,13 +80,14 @@ 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
post_graphql
(
pagination_query
,
current_user:
current_user
)
assert_field_value
(
'epicsCount'
,
[
2
,
0
,
0
])
end
end
end
end
def
assert_field_value
(
field
,
expected_value
)
expect
(
graphql_dig_at
(
graphql_data
,
'group'
,
'epicBoard'
,
'lists'
,
'nodes'
,
field
)).
to
eq
(
expected_value
)
...
...
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