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
62561263
Commit
62561263
authored
Jul 24, 2020
by
Ezekiel Kigbo
Committed by
Kushal Pandya
Jul 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix extra cycle analytics data request
parent
8be71768
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
14 deletions
+28
-14
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
...javascripts/analytics/cycle_analytics/components/base.vue
+0
-1
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
...ts/javascripts/analytics/cycle_analytics/store/actions.js
+2
-7
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/filters/actions.js
...nalytics/cycle_analytics/store/modules/filters/actions.js
+8
-3
ee/changelogs/unreleased/225660-fix-duplicate-fetch-data-request.yml
...gs/unreleased/225660-fix-duplicate-fetch-data-request.yml
+5
-0
ee/spec/frontend/analytics/cycle_analytics/store/modules/filters/actions_spec.js
...ics/cycle_analytics/store/modules/filters/actions_spec.js
+13
-3
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
View file @
62561263
...
...
@@ -157,7 +157,6 @@ export default {
'
removeStage
'
,
'
updateStage
'
,
'
reorderStage
'
,
'
setSelectedFilters
'
,
]),
...
mapActions
(
'
customStages
'
,
[
'
hideForm
'
,
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
View file @
62561263
...
...
@@ -91,6 +91,7 @@ export const fetchStageMedianValues = ({ dispatch, getters }) => {
};
export
const
requestCycleAnalyticsData
=
({
commit
})
=>
commit
(
types
.
REQUEST_CYCLE_ANALYTICS_DATA
);
export
const
receiveCycleAnalyticsDataSuccess
=
({
commit
,
dispatch
})
=>
{
commit
(
types
.
RECEIVE_CYCLE_ANALYTICS_DATA_SUCCESS
);
dispatch
(
'
typeOfWork/fetchTopRankedGroupLabels
'
);
...
...
@@ -237,14 +238,8 @@ export const removeStage = ({ dispatch, state }, stageId) => {
.
catch
(
error
=>
dispatch
(
'
receiveRemoveStageError
'
,
error
));
};
export
const
setSelectedFilters
=
({
commit
,
dispatch
,
getters
},
filters
=
{})
=>
{
export
const
setSelectedFilters
=
({
commit
},
filters
=
{})
=>
commit
(
types
.
SET_SELECTED_FILTERS
,
filters
);
const
{
currentGroupPath
}
=
getters
;
if
(
currentGroupPath
)
{
return
dispatch
(
'
fetchCycleAnalyticsData
'
);
}
return
Promise
.
resolve
();
};
export
const
initializeCycleAnalyticsSuccess
=
({
commit
})
=>
commit
(
types
.
INITIALIZE_CYCLE_ANALYTICS_SUCCESS
);
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/filters/actions.js
View file @
62561263
...
...
@@ -76,10 +76,15 @@ export const fetchAssignees = ({ commit, rootGetters }, query = '') => {
});
};
export
const
setFilters
=
({
dispatch
},
nextFilters
)
=>
dispatch
(
'
setSelectedFilters
'
,
nextFilters
,
{
root
:
true
});
export
const
setFilters
=
({
dispatch
},
nextFilters
)
=>
{
return
Promise
.
resolve
()
.
then
(()
=>
dispatch
(
'
setSelectedFilters
'
,
nextFilters
,
{
root
:
true
}))
.
then
(()
=>
dispatch
(
'
fetchCycleAnalyticsData
'
,
null
,
{
root
:
true
}));
};
export
const
initialize
=
({
dispatch
,
commit
},
initialFilters
)
=>
{
commit
(
types
.
INITIALIZE
,
initialFilters
);
return
dispatch
(
'
setPaths
'
,
initialFilters
).
then
(()
=>
dispatch
(
'
setFilters
'
,
initialFilters
));
return
Promise
.
resolve
()
.
then
(()
=>
dispatch
(
'
setPaths
'
,
initialFilters
))
.
then
(()
=>
dispatch
(
'
setSelectedFilters
'
,
initialFilters
,
{
root
:
true
}));
};
ee/changelogs/unreleased/225660-fix-duplicate-fetch-data-request.yml
0 → 100644
View file @
62561263
---
title
:
Fix duplicate dispatch of 'fetchCycleAnalyticsData' action
merge_request
:
37458
author
:
type
:
fixed
ee/spec/frontend/analytics/cycle_analytics/store/modules/filters/actions_spec.js
View file @
62561263
...
...
@@ -39,7 +39,7 @@ describe('Filters actions', () => {
selectedMilestone
:
'
NEXT
'
,
};
it
(
'
dispatches setPaths, setFilters
'
,
()
=>
{
it
(
'
dispatches setPaths, set
Selected
Filters
'
,
()
=>
{
return
actions
.
initialize
(
{
...
...
@@ -52,7 +52,9 @@ describe('Filters actions', () => {
.
then
(()
=>
{
expect
(
mockDispatch
).
toHaveBeenCalledTimes
(
2
);
expect
(
mockDispatch
).
toHaveBeenCalledWith
(
'
setPaths
'
,
initialData
);
expect
(
mockDispatch
).
toHaveBeenCalledWith
(
'
setFilters
'
,
initialData
);
expect
(
mockDispatch
).
toHaveBeenCalledWith
(
'
setSelectedFilters
'
,
initialData
,
{
root
:
true
,
});
});
});
...
...
@@ -78,7 +80,7 @@ describe('Filters actions', () => {
selectedMilestone
:
'
NEXT
'
,
};
it
(
'
dispatches the root/setSelectedFilters a
ction
'
,
()
=>
{
it
(
'
dispatches the root/setSelectedFilters a
nd root/fetchCycleAnalyticsData actions
'
,
()
=>
{
return
testAction
(
actions
.
setFilters
,
nextFilters
,
...
...
@@ -89,6 +91,10 @@ describe('Filters actions', () => {
type
:
'
setSelectedFilters
'
,
payload
:
nextFilters
,
},
{
type
:
'
fetchCycleAnalyticsData
'
,
payload
:
null
,
},
],
);
});
...
...
@@ -107,6 +113,10 @@ describe('Filters actions', () => {
selectedLabels
:
[
filterLabels
[
1
].
title
],
},
},
{
type
:
'
fetchCycleAnalyticsData
'
,
payload
:
null
,
},
],
);
});
...
...
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