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
468d4683
Commit
468d4683
authored
Nov 14, 2019
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
View closed issues in epic
parent
c11d8c81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
ee/app/assets/javascripts/related_items_tree/utils/epic_utils.js
...assets/javascripts/related_items_tree/utils/epic_utils.js
+10
-4
No files found.
ee/app/assets/javascripts/related_items_tree/utils/epic_utils.js
View file @
468d4683
...
@@ -30,6 +30,14 @@ export const sortChildren = (childA, childB) => childA.relativePosition - childB
...
@@ -30,6 +30,14 @@ export const sortChildren = (childA, childB) => childA.relativePosition - childB
const
stateOrder
=
[
'
opened
'
,
'
closed
'
];
const
stateOrder
=
[
'
opened
'
,
'
closed
'
];
export
const
sortByState
=
(
a
,
b
)
=>
stateOrder
.
indexOf
(
a
.
state
)
-
stateOrder
.
indexOf
(
b
.
state
);
export
const
sortByState
=
(
a
,
b
)
=>
stateOrder
.
indexOf
(
a
.
state
)
-
stateOrder
.
indexOf
(
b
.
state
);
/**
* Returns sorted array, using sortChildren and sortByState
* Used to sort epics and issues
*
* @param {Array} items
*/
export
const
applySorts
=
array
=>
array
.
sort
(
sortChildren
).
sort
(
sortByState
);
/**
/**
* Returns formatted child item to include additional
* Returns formatted child item to include additional
* flags and properties to use while rendering tree.
* flags and properties to use while rendering tree.
...
@@ -85,11 +93,9 @@ export const extractChildIssues = issues =>
...
@@ -85,11 +93,9 @@ export const extractChildIssues = issues =>
* Parses Graph query response and updates
* Parses Graph query response and updates
* children array to include issues within it
* children array to include issues within it
* and then sorts everything based on `relativePosition`
* and then sorts everything based on `relativePosition`
* and state
*
*
* @param {Object} responseRoot
* @param {Object} responseRoot
*/
*/
export
const
processQueryResponse
=
({
epic
})
=>
export
const
processQueryResponse
=
({
epic
})
=>
[]
applySorts
([...
extractChildEpics
(
epic
.
children
),
...
extractChildIssues
(
epic
.
issues
)]);
.
concat
(
extractChildEpics
(
epic
.
children
),
extractChildIssues
(
epic
.
issues
))
.
sort
(
sortChildren
)
.
sort
(
sortByState
);
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