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
46e37c85
Commit
46e37c85
authored
Jul 07, 2021
by
Eulyeon Ko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply reviewer suggestions
parent
89de38a6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
13 deletions
+6
-13
doc/user/project/issues/sorting_issue_lists.md
doc/user/project/issues/sorting_issue_lists.md
+1
-1
ee/app/graphql/ee/types/issue_type.rb
ee/app/graphql/ee/types/issue_type.rb
+1
-4
ee/spec/graphql/ee/resolvers/issues_resolver_spec.rb
ee/spec/graphql/ee/resolvers/issues_resolver_spec.rb
+2
-4
spec/graphql/resolvers/issues_resolver_spec.rb
spec/graphql/resolvers/issues_resolver_spec.rb
+2
-4
No files found.
doc/user/project/issues/sorting_issue_lists.md
View file @
46e37c85
...
...
@@ -8,7 +8,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
You can sort a list of issues several ways, including by:
-
Blocking
(descending sort only)
**(PREMIUM)**
-
Blocking
**(PREMIUM)**
-
Created date
-
Due date
-
Label priority
...
...
ee/app/graphql/ee/types/issue_type.rb
View file @
46e37c85
...
...
@@ -19,6 +19,7 @@ module EE
description:
'Indicates the issue is blocked.'
field
:blocking_count
,
GraphQL
::
INT_TYPE
,
null:
false
,
method: :blocking_issues_count
,
description:
'Count of issues this issue is blocking.'
field
:blocked_by_count
,
GraphQL
::
INT_TYPE
,
null:
true
,
...
...
@@ -48,10 +49,6 @@ module EE
object
.
weight_available?
?
object
.
weight
:
nil
end
def
blocking_count
object
.
blocking_issues_count
end
def
blocked
::
Gitlab
::
Graphql
::
Aggregations
::
Issues
::
LazyBlockAggregate
.
new
(
context
,
object
.
id
)
do
|
count
|
(
count
||
0
)
>
0
...
...
ee/spec/graphql/ee/resolvers/issues_resolver_spec.rb
View file @
46e37c85
...
...
@@ -66,13 +66,11 @@ RSpec.describe Resolvers::IssuesResolver do
end
context
'when sorting by blocking issues count (ties broken by id in desc order)'
do
it
'sorts issues ascending'
,
:aggregate_failures
do
expect
(
issue1
.
id
).
to
be
<
(
issue2
.
id
)
it
'sorts issues ascending'
do
expect
(
resolve_issues
(
sort: :blocking_issues_asc
).
to_a
).
to
eq
[
issue4
,
issue2
,
issue1
,
issue3
]
end
it
'sorts issues descending'
,
:aggregate_failures
do
expect
(
issue1
.
id
).
to
be
<
(
issue2
.
id
)
it
'sorts issues descending'
do
expect
(
resolve_issues
(
sort: :blocking_issues_desc
).
to_a
).
to
eq
[
issue3
,
issue2
,
issue1
,
issue4
]
end
end
...
...
spec/graphql/resolvers/issues_resolver_spec.rb
View file @
46e37c85
...
...
@@ -305,13 +305,11 @@ RSpec.describe Resolvers::IssuesResolver do
create
(
:award_emoji
,
:upvote
,
awardable:
issue4
)
end
it
'sorts issues ascending (ties broken by id in desc order)'
,
:aggregate_failures
do
expect
(
issue1
.
id
).
to
be
<
(
issue4
.
id
)
it
'sorts issues ascending (ties broken by id in desc order)'
do
expect
(
resolve_issues
(
sort: :popularity_asc
).
to_a
).
to
eq
([
issue3
,
issue4
,
issue1
,
issue2
])
end
it
'sorts issues descending (ties broken by id in desc order)'
,
:aggregate_failures
do
expect
(
issue1
.
id
).
to
be
<
(
issue4
.
id
)
it
'sorts issues descending (ties broken by id in desc order)'
do
expect
(
resolve_issues
(
sort: :popularity_desc
).
to_a
).
to
eq
([
issue2
,
issue4
,
issue1
,
issue3
])
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