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
e0ce5f4e
Commit
e0ce5f4e
authored
Feb 20, 2021
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviewer feedback
- Tweak description - remove debug line
parent
20c126c5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
13 deletions
+17
-13
doc/api/graphql/reference/index.md
doc/api/graphql/reference/index.md
+1
-1
ee/app/graphql/resolvers/boards/epic_lists_resolver.rb
ee/app/graphql/resolvers/boards/epic_lists_resolver.rb
+5
-0
ee/app/graphql/types/boards/epic_list_type.rb
ee/app/graphql/types/boards/epic_list_type.rb
+1
-1
ee/spec/requests/api/graphql/boards/epic_board_list_epics_query_spec.rb
...ts/api/graphql/boards/epic_board_list_epics_query_spec.rb
+8
-9
spec/support/shared_examples/models/boards/user_preferences_shared_examples.rb
...xamples/models/boards/user_preferences_shared_examples.rb
+2
-2
No files found.
doc/api/graphql/reference/index.md
View file @
e0ce5f4e
...
...
@@ -1825,7 +1825,7 @@ Represents an epic board list.
| Field | Type | Description |
| ----- | ---- | ----------- |
|
`collapsed`
| Boolean | Indicates if list is collapsed for this user. |
|
`collapsed`
| Boolean | Indicates if
this
list is collapsed for this user. |
|
`epics`
| EpicConnection | List epics. |
|
`id`
| BoardsEpicListID! | Global ID of the board list. |
|
`label`
| Label | Label of the list. |
...
...
ee/app/graphql/resolvers/boards/epic_lists_resolver.rb
View file @
e0ce5f4e
...
...
@@ -29,6 +29,11 @@ module Resolvers
private
def
load_preferences?
(
lookahead
)
lookahead
&
.
selection
(
:edges
)
&
.
selection
(
:node
)
&
.
selects?
(
:collapsed
)
||
lookahead
&
.
selection
(
:nodes
)
&
.
selects?
(
:collapsed
)
end
def
authorize!
Ability
.
allowed?
(
context
[
:current_user
],
:read_epic_board_list
,
epic_board
.
group
)
||
raise_resource_not_available_error!
end
...
...
ee/app/graphql/types/boards/epic_list_type.rb
View file @
e0ce5f4e
...
...
@@ -25,7 +25,7 @@ module Types
description:
'Label of the list.'
field
:collapsed
,
GraphQL
::
BOOLEAN_TYPE
,
null:
true
,
description:
'Indicates if list is collapsed for this user.'
description:
'Indicates if
this
list is collapsed for this user.'
field
:epics
,
Types
::
EpicType
.
connection_type
,
null:
true
,
resolver:
Resolvers
::
Boards
::
BoardListEpicsResolver
,
...
...
ee/spec/requests/api/graphql/boards/epic_board_list_epics_query_spec.rb
View file @
e0ce5f4e
...
...
@@ -57,15 +57,15 @@ RSpec.describe 'get list of epics for an epic board list' do
describe
'field values'
do
def
query
(
params
=
{})
graphql_query_for
(
:group
,
{
full_path:
group
.
full_path
},
<<~
BOARDS
epicBoard(id: "
#{
board
.
to_global_id
}
") {
lists(id: "
#{
list
.
to_global_id
}
") {
nodes {
#{
all_graphql_fields_for
(
'epic_list'
.
classify
)
}
<<~
BOARDS
epicBoard(id: "
#{
board
.
to_global_id
}
") {
lists(id: "
#{
list
.
to_global_id
}
") {
nodes {
#{
all_graphql_fields_for
(
'epic_list'
.
classify
)
}
}
}
}
}
BOARDS
BOARDS
)
end
...
...
@@ -73,9 +73,8 @@ RSpec.describe 'get list of epics for an epic board list' do
board
.
epic_lists
.
first
.
update_preferences_for
(
current_user
,
collapsed:
true
)
post_graphql
(
query
,
current_user:
current_user
)
pp
graphql_dig_at
(
graphql_data
,
'group'
,
'epicBoard'
,
'lists'
,
'nodes'
,
0
)
expect
(
graphql_dig_at
(
graphql_data
,
'group'
,
'epicBoard'
,
'lists'
,
'nodes'
,
0
,
'collapsed'
)).
to
eq
list
.
collapsed?
(
current_user
)
expect
(
graphql_dig_at
(
graphql_data
,
'group'
,
'epicBoard'
,
'lists'
,
'nodes'
,
0
,
'collapsed'
)).
to
eq
(
true
)
end
end
end
spec/support/shared_examples/models/boards/user_preferences_shared_examples.rb
View file @
e0ce5f4e
...
...
@@ -10,7 +10,7 @@ RSpec.shared_examples 'list_preferences_for user' do |list_factory, list_id, pre
it
'returns not persisted preferences'
do
preferences
=
subject
.
preferences_for
(
nil
)
expect
(
preferences
.
persisted?
).
to
eq
(
false
)
expect
(
preferences
).
not_to
be_persisted
expect
(
preferences
.
send
(
list_id
)).
to
eq
(
subject
.
id
)
expect
(
preferences
.
user_id
).
to
be_nil
end
...
...
@@ -33,7 +33,7 @@ RSpec.shared_examples 'list_preferences_for user' do |list_factory, list_id, pre
it
'returns not persisted preferences'
do
preferences
=
subject
.
preferences_for
(
user
)
expect
(
preferences
.
persisted?
).
to
eq
(
false
)
expect
(
preferences
).
not_to
be_persisted
expect
(
preferences
.
user_id
).
to
eq
(
user
.
id
)
expect
(
preferences
.
send
(
list_id
)).
to
eq
(
subject
.
id
)
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