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
941c2341
Commit
941c2341
authored
Jun 24, 2020
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor review comments
Removed an unecessary returned promise and update related specs
parent
419bf867
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
18 deletions
+45
-18
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
...javascripts/analytics/cycle_analytics/components/base.vue
+2
-0
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
...ts/javascripts/analytics/cycle_analytics/store/actions.js
+3
-3
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/filters/actions.js
...nalytics/cycle_analytics/store/modules/filters/actions.js
+3
-2
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
...rontend/analytics/cycle_analytics/components/base_spec.js
+1
-1
ee/spec/frontend/analytics/cycle_analytics/store/modules/filters/actions_spec.js
...ics/cycle_analytics/store/modules/filters/actions_spec.js
+36
-12
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
View file @
941c2341
...
...
@@ -108,6 +108,8 @@ export default {
return
this
.
featureFlags
.
hasPathNavigation
&&
!
this
.
hasNoAccessError
&&
this
.
selectedStage
;
},
shouldDisplayFilterBar
()
{
// TODO: After we remove instance VSA currentGroupPath will be always set
// https://gitlab.com/gitlab-org/gitlab/-/issues/223735
return
this
.
featureFlags
.
hasFilterBar
&&
this
.
currentGroupPath
;
},
isLoadingTypeOfWork
()
{
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
View file @
941c2341
...
...
@@ -268,9 +268,9 @@ export const initializeCycleAnalytics = ({ dispatch, commit }, initialData = {})
});
}
return
Promise
.
resolve
()
.
then
(()
=>
dispatch
(
'
fetchCycleAnalyticsData
'
))
.
then
(()
=>
dispatch
(
'
initializeCycleAnalyticsSuccess
'
)
);
return
dispatch
(
'
fetchCycleAnalyticsData
'
).
then
(()
=>
dispatch
(
'
initializeCycleAnalyticsSuccess
'
),
);
}
return
dispatch
(
'
initializeCycleAnalyticsSuccess
'
);
};
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/filters/actions.js
View file @
941c2341
...
...
@@ -6,6 +6,8 @@ import * as types from './mutation_types';
const
appendExtension
=
path
=>
(
path
.
indexOf
(
'
.
'
)
>
-
1
?
path
:
`
${
path
}
.json`
);
// TODO: After we remove instance VSA we can rely on the paths from the BE
// https://gitlab.com/gitlab-org/gitlab/-/issues/223735
export
const
setPaths
=
({
commit
},
{
groupPath
=
''
,
milestonesPath
=
''
,
labelsPath
=
''
})
=>
{
const
ms
=
milestonesPath
||
`/groups/
${
groupPath
}
/-/milestones`
;
const
ls
=
labelsPath
||
`/groups/
${
groupPath
}
/-/labels`
;
...
...
@@ -88,8 +90,7 @@ export const setFilters = ({ dispatch }, nextFilters) =>
export
const
initialize
=
({
dispatch
,
commit
},
initialFilters
)
=>
{
commit
(
types
.
INITIALIZE
,
initialFilters
);
return
Promise
.
resolve
()
.
then
(()
=>
dispatch
(
'
setPaths
'
,
initialFilters
))
return
dispatch
(
'
setPaths
'
,
initialFilters
)
.
then
(()
=>
dispatch
(
'
setFilters
'
,
initialFilters
))
.
then
(()
=>
dispatch
(
'
fetchTokenData
'
));
};
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
View file @
941c2341
...
...
@@ -98,7 +98,7 @@ function createComponent({
});
if
(
withStageSelected
)
{
comp
.
vm
.
$store
.
dispatch
(
'
setSelectedGroup
'
,
{
comp
.
vm
.
$store
.
commit
(
'
SET_SELECTED_GROUP
'
,
{
...
selectedGroup
,
});
...
...
ee/spec/frontend/analytics/cycle_analytics/store/modules/filters/actions_spec.js
View file @
941c2341
...
...
@@ -16,10 +16,15 @@ jest.mock('~/flash', () => jest.fn());
describe
(
'
Filters actions
'
,
()
=>
{
let
state
;
let
mock
;
let
mockDispatch
;
let
mockCommit
;
beforeEach
(()
=>
{
state
=
initialState
();
mock
=
new
MockAdapter
(
axios
);
mockDispatch
=
jest
.
fn
().
mockResolvedValue
();
mockCommit
=
jest
.
fn
();
});
afterEach
(()
=>
{
...
...
@@ -34,18 +39,37 @@ describe('Filters actions', () => {
selectedMilestone
:
'
NEXT
'
,
};
it
(
'
initializes the state and dispatches setPaths, setFilters and fetchTokenData
'
,
()
=>
{
return
testAction
(
actions
.
initialize
,
initialData
,
state
,
[{
type
:
types
.
INITIALIZE
,
payload
:
initialData
}],
[
{
type
:
'
setPaths
'
,
payload
:
initialData
},
{
type
:
'
setFilters
'
,
payload
:
initialData
},
{
type
:
'
fetchTokenData
'
},
],
);
it
(
'
dispatches setPaths, setFilters and fetchTokenData
'
,
()
=>
{
return
actions
.
initialize
(
{
state
,
dispatch
:
mockDispatch
,
commit
:
mockCommit
,
},
initialData
,
)
.
then
(()
=>
{
expect
(
mockDispatch
).
toHaveBeenCalledTimes
(
3
);
expect
(
mockDispatch
).
toHaveBeenCalledWith
(
'
setPaths
'
,
initialData
);
expect
(
mockDispatch
).
toHaveBeenCalledWith
(
'
setFilters
'
,
initialData
);
expect
(
mockDispatch
).
toHaveBeenCalledWith
(
'
fetchTokenData
'
);
});
});
it
(
`commits the
${
types
.
INITIALIZE
}
`
,
()
=>
{
return
actions
.
initialize
(
{
state
,
dispatch
:
mockDispatch
,
commit
:
mockCommit
,
},
initialData
,
)
.
then
(()
=>
{
expect
(
mockCommit
).
toHaveBeenCalledWith
(
types
.
INITIALIZE
,
initialData
);
});
});
});
...
...
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