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
53a095bf
Commit
53a095bf
authored
Jan 14, 2022
by
Andrew Smith
Committed by
Andrew Smith
Jan 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Order child epics in roadmap by configured sort order
Changelog: fixed EE: true
parent
0dc65764
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
ee/app/assets/javascripts/roadmap/store/actions.js
ee/app/assets/javascripts/roadmap/store/actions.js
+8
-2
ee/spec/frontend/roadmap/store/actions_spec.js
ee/spec/frontend/roadmap/store/actions_spec.js
+34
-0
No files found.
ee/app/assets/javascripts/roadmap/store/actions.js
View file @
53a095bf
...
...
@@ -69,12 +69,18 @@ const fetchGroupEpics = (
export
const
fetchChildrenEpics
=
(
state
,
{
parentItem
})
=>
{
const
{
iid
,
group
}
=
parentItem
;
const
{
filterParams
,
epicsState
}
=
state
;
const
{
filterParams
,
epicsState
,
sortedBy
}
=
state
;
return
epicUtils
.
gqClient
.
query
({
query
:
epicChildEpics
,
variables
:
{
iid
,
fullPath
:
group
?.
fullPath
,
state
:
epicsState
,
...
filterParams
},
variables
:
{
iid
,
fullPath
:
group
?.
fullPath
,
state
:
epicsState
,
sort
:
sortedBy
,
...
filterParams
,
},
})
.
then
(({
data
})
=>
{
const
edges
=
data
?.
group
?.
epic
?.
children
?.
edges
||
[];
...
...
ee/spec/frontend/roadmap/store/actions_spec.js
View file @
53a095bf
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
DATE_RANGES
,
PRESET_TYPES
}
from
'
ee/roadmap/constants
'
;
import
groupMilestones
from
'
ee/roadmap/queries/groupMilestones.query.graphql
'
;
import
epicChildEpics
from
'
ee/roadmap/queries/epicChildEpics.query.graphql
'
;
import
*
as
actions
from
'
ee/roadmap/store/actions
'
;
import
*
as
types
from
'
ee/roadmap/store/mutation_types
'
;
import
defaultState
from
'
ee/roadmap/store/state
'
;
...
...
@@ -29,6 +30,7 @@ import {
mockMilestone
,
mockFormattedMilestone
,
mockPageInfo
,
mockEpic
,
}
from
'
../mock_data
'
;
jest
.
mock
(
'
~/flash
'
);
...
...
@@ -75,6 +77,38 @@ describe('Roadmap Vuex Actions', () => {
});
});
describe
(
'
fetchChildrenEpics
'
,
()
=>
{
it
(
'
should fetch children epics for provided epic iid along with other parameters
'
,
()
=>
{
jest
.
spyOn
(
epicUtils
.
gqClient
,
'
query
'
).
mockReturnValue
(
Promise
.
resolve
({
data
:
mockEpicChildEpicsQueryResponse
.
data
,
}),
);
const
mockState
=
{
fullPath
:
'
gitlab-org
'
,
sortedBy
:
mockSortedBy
,
epicsState
:
'
opened
'
,
};
return
actions
.
fetchChildrenEpics
(
mockState
,
{
parentItem
:
mockEpic
,
})
.
then
(()
=>
{
expect
(
epicUtils
.
gqClient
.
query
).
toHaveBeenCalledWith
({
query
:
epicChildEpics
,
variables
:
{
iid
:
mockEpic
.
iid
,
fullPath
:
'
/groups/gitlab-org/
'
,
sort
:
mockState
.
sortedBy
,
state
:
mockState
.
epicsState
,
},
});
});
});
});
describe
(
'
receiveEpicsSuccess
'
,
()
=>
{
it
(
'
should set formatted epics array and epicId to IDs array in state based on provided epics list
'
,
()
=>
{
return
testAction
(
...
...
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