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
529fb359
Commit
529fb359
authored
May 06, 2021
by
Ezekiel Kigbo
Committed by
Natalia Tepluhina
May 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Apply VSA filters to records endpoint
parent
0db5382b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
27 deletions
+59
-27
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
...javascripts/analytics/cycle_analytics/components/base.vue
+1
-3
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
...ts/javascripts/analytics/cycle_analytics/store/actions.js
+17
-7
ee/app/assets/javascripts/analytics/cycle_analytics/store/getters.js
...ts/javascripts/analytics/cycle_analytics/store/getters.js
+9
-1
ee/changelogs/unreleased/ek-fix-apply-label-url-params-onload.yml
...elogs/unreleased/ek-fix-apply-label-url-params-onload.yml
+5
-0
ee/spec/frontend/analytics/cycle_analytics/store/actions_spec.js
.../frontend/analytics/cycle_analytics/store/actions_spec.js
+27
-16
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/components/base.vue
View file @
529fb359
...
...
@@ -82,6 +82,7 @@ export default {
'
enableCustomOrdering
'
,
'
cycleAnalyticsRequestParams
'
,
'
pathNavigationData
'
,
'
isOverviewStageSelected
'
,
]),
...
mapGetters
(
'
customStages
'
,
[
'
customStageFormActive
'
]),
shouldRenderEmptyState
()
{
...
...
@@ -90,9 +91,6 @@ export default {
shouldDisplayFilters
()
{
return
!
this
.
errorCode
;
},
isOverviewStageSelected
()
{
return
this
.
selectedStage
?.
id
===
OVERVIEW_STAGE_ID
;
},
shouldDisplayDurationChart
()
{
return
(
!
this
.
featureFlags
.
hasPathNavigation
||
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
View file @
529fb359
...
...
@@ -36,11 +36,12 @@ export const setSelectedStage = ({ commit, getters: { paginationParams } }, stag
commit
(
types
.
SET_PAGINATION
,
{
...
paginationParams
,
page
:
1
,
hasNextPage
:
null
});
};
export
const
setDateRange
=
({
commit
,
dispatch
},
{
skipFetch
=
false
,
startDate
,
endDate
})
=>
{
export
const
setDateRange
=
(
{
commit
,
dispatch
,
getters
:
{
isOverviewStageSelected
},
state
:
{
selectedStage
}
},
{
startDate
,
endDate
},
)
=>
{
commit
(
types
.
SET_DATE_RANGE
,
{
startDate
,
endDate
});
if
(
skipFetch
)
return
false
;
if
(
selectedStage
&&
!
isOverviewStageSelected
)
dispatch
(
'
fetchStageData
'
,
selectedStage
.
id
);
return
dispatch
(
'
fetchCycleAnalyticsData
'
);
};
...
...
@@ -341,7 +342,6 @@ export const initializeCycleAnalytics = ({ dispatch, commit }, initialData = {})
selectedStage
?
dispatch
(
'
setSelectedStage
'
,
selectedStage
)
:
dispatch
(
'
setDefaultSelectedStage
'
),
selectedStage
?.
id
?
dispatch
(
'
fetchStageData
'
,
selectedStage
.
id
)
:
Promise
.
resolve
(),
dispatch
(
'
setPaths
'
,
{
groupPath
:
group
.
fullPath
,
milestonesPath
,
labelsPath
}),
dispatch
(
'
filters/initialize
'
,
{
selectedAuthor
,
...
...
@@ -352,7 +352,12 @@ export const initializeCycleAnalytics = ({ dispatch, commit }, initialData = {})
dispatch
(
'
durationChart/setLoading
'
,
true
),
dispatch
(
'
typeOfWork/setLoading
'
,
true
),
])
.
then
(()
=>
dispatch
(
'
fetchCycleAnalyticsData
'
))
.
then
(()
=>
Promise
.
all
([
selectedStage
?.
id
?
dispatch
(
'
fetchStageData
'
,
selectedStage
.
id
)
:
Promise
.
resolve
(),
dispatch
(
'
fetchCycleAnalyticsData
'
),
]),
)
.
then
(()
=>
dispatch
(
'
initializeCycleAnalyticsSuccess
'
));
}
...
...
@@ -477,7 +482,12 @@ export const fetchValueStreams = ({ commit, dispatch, getters }) => {
});
};
export
const
setFilters
=
({
dispatch
})
=>
{
export
const
setFilters
=
({
dispatch
,
getters
:
{
isOverviewStageSelected
},
state
:
{
selectedStage
},
})
=>
{
if
(
selectedStage
&&
!
isOverviewStageSelected
)
dispatch
(
'
fetchStageData
'
,
selectedStage
.
id
);
return
dispatch
(
'
fetchCycleAnalyticsData
'
);
};
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/getters.js
View file @
529fb359
...
...
@@ -4,7 +4,12 @@ import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import
httpStatus
from
'
~/lib/utils/http_status
'
;
import
{
filterToQueryObject
}
from
'
~/vue_shared/components/filtered_search_bar/filtered_search_utils
'
;
import
{
dateFormats
}
from
'
../../shared/constants
'
;
import
{
DEFAULT_VALUE_STREAM_ID
,
OVERVIEW_STAGE_CONFIG
,
PAGINATION_TYPE
}
from
'
../constants
'
;
import
{
DEFAULT_VALUE_STREAM_ID
,
OVERVIEW_STAGE_CONFIG
,
PAGINATION_TYPE
,
OVERVIEW_STAGE_ID
,
}
from
'
../constants
'
;
import
{
transformStagesForPathNavigation
}
from
'
../utils
'
;
export
const
hasNoAccessError
=
(
state
)
=>
state
.
errorCode
===
httpStatus
.
FORBIDDEN
;
...
...
@@ -63,6 +68,9 @@ export const enableCustomOrdering = ({ stages, errorSavingStageOrder }) =>
export
const
customStageFormActive
=
({
isCreatingCustomStage
,
isEditingCustomStage
})
=>
Boolean
(
isCreatingCustomStage
||
isEditingCustomStage
);
export
const
isOverviewStageSelected
=
({
selectedStage
})
=>
selectedStage
?.
id
===
OVERVIEW_STAGE_ID
;
/**
* Until there are controls in place to edit stages outside of the stage table,
* the path navigation component will only display active stages.
...
...
ee/changelogs/unreleased/ek-fix-apply-label-url-params-onload.yml
0 → 100644
View file @
529fb359
---
title
:
Refetch VSA stage data when filters change
merge_request
:
60991
author
:
type
:
fixed
ee/spec/frontend/analytics/cycle_analytics/store/actions_spec.js
View file @
529fb359
...
...
@@ -140,20 +140,6 @@ describe('Value Stream Analytics actions', () => {
});
});
describe
(
'
setDateRange
'
,
()
=>
{
const
payload
=
{
startDate
,
endDate
};
it
(
'
dispatches the fetchCycleAnalyticsData action
'
,
()
=>
{
return
testAction
(
actions
.
setDateRange
,
payload
,
state
,
[{
type
:
types
.
SET_DATE_RANGE
,
payload
:
{
startDate
,
endDate
}
}],
[{
type
:
'
fetchCycleAnalyticsData
'
}],
);
});
});
describe
(
'
fetchStageData
'
,
()
=>
{
const
headers
=
{
'
X-Next-Page
'
:
2
,
...
...
@@ -1363,9 +1349,34 @@ describe('Value Stream Analytics actions', () => {
});
});
describe
(
'
setFilters
'
,
()
=>
{
describe
.
each
`
targetAction | payload | mutations
${
actions
.
setDateRange
}
|
${{
startDate
,
endDate
}
} |
${[{
type
:
'
SET_DATE_RANGE
'
,
payload
:
{
startDate
,
endDate
}
}]}
$
{
actions
.
setFilters
}
|
${
''
}
|
${[]}
`
(
'
$action
'
,
({
targetAction
,
payload
,
mutations
})
=>
{
let
stateWithOverview
=
null
;
beforeEach
(()
=>
{
stateWithOverview
=
{
...
state
,
isOverviewStageSelected
:
()
=>
true
};
});
it
(
'
dispatches the fetchCycleAnalyticsData action
'
,
()
=>
{
return
testAction
(
actions
.
setFilters
,
null
,
state
,
[],
[{
type
:
'
fetchCycleAnalyticsData
'
}]);
return
testAction
(
targetAction
,
payload
,
stateWithOverview
,
mutations
,
[
{
type
:
'
fetchCycleAnalyticsData
'
},
]);
});
describe
(
'
with a stage selected
'
,
()
=>
{
beforeEach
(()
=>
{
stateWithOverview
=
{
...
state
,
selectedStage
};
});
it
(
'
dispatches the fetchStageData action
'
,
()
=>
{
return
testAction
(
targetAction
,
payload
,
stateWithOverview
,
mutations
,
[
{
type
:
'
fetchStageData
'
,
payload
:
selectedStage
.
id
},
{
type
:
'
fetchCycleAnalyticsData
'
},
]);
});
});
});
});
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