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
2f9231ac
Commit
2f9231ac
authored
Jul 28, 2020
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix creating a custom stage
Updates the route for creating a custom stage
parent
1db40d61
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
34 deletions
+62
-34
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
...ts/javascripts/analytics/cycle_analytics/store/actions.js
+20
-9
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/duration_chart/actions.js
...s/cycle_analytics/store/modules/duration_chart/actions.js
+14
-3
ee/app/assets/javascripts/api.js
ee/app/assets/javascripts/api.js
+28
-22
No files found.
ee/app/assets/javascripts/analytics/cycle_analytics/store/actions.js
View file @
2f9231ac
...
...
@@ -42,15 +42,16 @@ export const receiveStageDataError = ({ commit }) => {
createFlash
(
__
(
'
There was an error fetching data for the selected stage
'
));
};
export
const
fetchStageData
=
({
state
,
dispatch
,
getters
},
slug
)
=>
{
const
{
cycleAnalyticsRequestParams
=
{}
}
=
getters
;
const
{
selectedGroup
:
{
fullPath
},
}
=
state
;
export
const
fetchStageData
=
({
dispatch
,
getters
},
slug
)
=>
{
const
{
cycleAnalyticsRequestParams
=
{},
currentValueStreamId
,
currentGroupPath
}
=
getters
;
dispatch
(
'
requestStageData
'
);
return
Api
.
cycleAnalyticsStageEvents
(
fullPath
,
slug
,
cycleAnalyticsRequestParams
)
return
Api
.
cycleAnalyticsStageEvents
(
currentGroupPath
,
currentValueStreamId
,
slug
,
cycleAnalyticsRequestParams
,
)
.
then
(({
data
})
=>
dispatch
(
'
receiveStageDataSuccess
'
,
data
))
.
catch
(
error
=>
dispatch
(
'
receiveStageDataError
'
,
error
));
};
...
...
@@ -72,13 +73,23 @@ const fetchStageMedian = (currentGroupPath, stageId, params) =>
}));
export
const
fetchStageMedianValues
=
({
dispatch
,
getters
})
=>
{
const
{
currentGroupPath
,
cycleAnalyticsRequestParams
,
activeStages
}
=
getters
;
const
{
currentGroupPath
,
cycleAnalyticsRequestParams
,
activeStages
,
currentValueStreamId
,
}
=
getters
;
const
stageIds
=
activeStages
.
map
(
s
=>
s
.
slug
);
dispatch
(
'
requestStageMedianValues
'
);
return
Promise
.
all
(
stageIds
.
map
(
stageId
=>
fetchStageMedian
(
currentGroupPath
,
stageId
,
cycleAnalyticsRequestParams
),
fetchStageMedian
(
currentGroupPath
,
currentValueStreamId
,
stageId
,
cycleAnalyticsRequestParams
,
),
),
)
.
then
(
data
=>
dispatch
(
'
receiveStageMedianValuesSuccess
'
,
data
))
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/modules/duration_chart/actions.js
View file @
2f9231ac
...
...
@@ -23,13 +23,19 @@ export const receiveDurationDataError = ({ commit }) => {
export
const
fetchDurationData
=
({
dispatch
,
rootGetters
})
=>
{
dispatch
(
'
requestDurationData
'
);
const
{
cycleAnalyticsRequestParams
,
activeStages
,
currentGroupPath
}
=
rootGetters
;
const
{
cycleAnalyticsRequestParams
,
activeStages
,
currentGroupPath
,
currentValueStreamId
,
}
=
rootGetters
;
return
Promise
.
all
(
activeStages
.
map
(
stage
=>
{
const
{
slug
}
=
stage
;
return
Api
.
cycleAnalyticsDurationChart
(
currentGroupPath
,
currentValueStreamId
,
slug
,
cycleAnalyticsRequestParams
,
).
then
(({
data
})
=>
({
...
...
@@ -53,7 +59,12 @@ export const receiveDurationMedianDataError = ({ commit }) => {
export
const
fetchDurationMedianData
=
({
dispatch
,
rootState
,
rootGetters
})
=>
{
const
{
startDate
,
endDate
}
=
rootState
;
const
{
cycleAnalyticsRequestParams
,
activeStages
,
currentGroupPath
}
=
rootGetters
;
const
{
cycleAnalyticsRequestParams
,
activeStages
,
currentGroupPath
,
currentValueStreamId
,
}
=
rootGetters
;
const
offsetValue
=
getDayDifference
(
new
Date
(
startDate
),
new
Date
(
endDate
));
const
offsetCreatedAfter
=
getDateInPast
(
new
Date
(
startDate
),
offsetValue
);
...
...
@@ -63,7 +74,7 @@ export const fetchDurationMedianData = ({ dispatch, rootState, rootGetters }) =>
activeStages
.
map
(
stage
=>
{
const
{
slug
}
=
stage
;
return
Api
.
cycleAnalyticsDurationChart
(
currentGroupPath
,
slug
,
{
return
Api
.
cycleAnalyticsDurationChart
(
currentGroupPath
,
currentValueStreamId
,
slug
,
{
...
cycleAnalyticsRequestParams
,
created_after
:
dateFormat
(
offsetCreatedAfter
,
dateFormats
.
isoDate
),
created_before
:
dateFormat
(
offsetCreatedBefore
,
dateFormats
.
isoDate
),
...
...
ee/app/assets/javascripts/api.js
View file @
2f9231ac
...
...
@@ -16,15 +16,17 @@ export default {
cycleAnalyticsTimeSummaryDataPath
:
'
/groups/:id/-/analytics/value_stream_analytics/time_summary
'
,
cycleAnalyticsGroupStagesAndEventsPath
:
'
/groups/:id/-/analytics/value_stream_analytics/stages
'
,
cycleAnalyticsValueStreamGroupStagesAndEventsPath
:
'
/groups/:id/-/analytics/value_stream_analytics/value_streams/:value_stream_id/stages
'
,
cycleAnalyticsValueStreamsPath
:
'
/groups/:id/-/analytics/value_stream_analytics/value_streams
'
,
'
/groups/:group_id/-/analytics/value_stream_analytics/value_streams/:value_stream_id/stages
'
,
cycleAnalyticsValueStreamsPath
:
'
/groups/:group_id/-/analytics/value_stream_analytics/value_streams
'
,
cycleAnalyticsStageEventsPath
:
'
/groups/:
id/-/analytics/value_stream_analytics
/stages/:stage_id/records
'
,
'
/groups/:
group_id/-/analytics/value_stream_analytics/value_streams/:value_stream_id
/stages/:stage_id/records
'
,
cycleAnalyticsStageMedianPath
:
'
/groups/:id/-/analytics/value_stream_analytics/stages/:stage_id/median
'
,
cycleAnalyticsStagePath
:
'
/groups/:id/-/analytics/value_stream_analytics/stages/:stage_id
'
,
'
/groups/:group_id/-/analytics/value_stream_analytics/value_streams/:value_stream_id/stages/:stage_id/median
'
,
cycleAnalyticsStagePath
:
'
/groups/:group_id/-/analytics/value_stream_analytics/value_streams/:value_stream_id/stages/:stage_id
'
,
cycleAnalyticsDurationChartPath
:
'
/groups/:
id/-/analytics/value_stream_analytics
/stages/:stage_id/duration_chart
'
,
'
/groups/:
group_id/-/analytics/value_stream_analytics/value_streams/:value_stream_id
/stages/:stage_id/duration_chart
'
,
cycleAnalyticsGroupLabelsPath
:
'
/groups/:namespace_path/-/labels.json
'
,
codeReviewAnalyticsPath
:
'
/api/:version/analytics/code_review
'
,
groupActivityIssuesPath
:
'
/api/:version/analytics/group_activity/issues_count
'
,
...
...
@@ -146,23 +148,25 @@ export default {
cycleAnalyticsValueStreamGroupStagesAndEvents
(
groupId
,
valueStreamId
,
params
=
{})
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsValueStreamGroupStagesAndEventsPath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:
group_
id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
);
return
axios
.
get
(
url
,
{
params
});
},
cycleAnalyticsStageEvents
(
groupId
,
stageId
,
params
=
{})
{
cycleAnalyticsStageEvents
(
groupId
,
valueStreamId
,
stageId
,
params
=
{})
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsStageEventsPath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
.
replace
(
'
:group_id
'
,
groupId
)
.
replace
(
'
:stage_id
'
,
stageId
);
return
axios
.
get
(
url
,
{
params
});
},
cycleAnalyticsStageMedian
(
groupId
,
stageId
,
params
=
{})
{
cycleAnalyticsStageMedian
(
groupId
,
valueStreamId
,
stageId
,
params
=
{})
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsStageMedianPath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:group_id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
.
replace
(
'
:stage_id
'
,
stageId
);
return
axios
.
get
(
url
,
{
params
:
{
...
params
}
});
...
...
@@ -170,43 +174,45 @@ export default {
cycleAnalyticsCreateStage
(
groupId
,
valueStreamId
,
data
)
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsValueStreamGroupStagesAndEventsPath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:
group_
id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
);
return
axios
.
post
(
url
,
data
);
},
cycleAnalyticsCreateValueStream
(
groupId
,
data
)
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsValueStreamsPath
).
replace
(
'
:id
'
,
groupId
);
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsValueStreamsPath
).
replace
(
'
:
group_
id
'
,
groupId
);
return
axios
.
post
(
url
,
data
);
},
cycleAnalyticsValueStreams
(
groupId
,
data
)
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsValueStreamsPath
).
replace
(
'
:id
'
,
groupId
);
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsValueStreamsPath
).
replace
(
'
:
group_
id
'
,
groupId
);
return
axios
.
get
(
url
,
data
);
},
cycleAnalyticsStageUrl
(
stageId
,
group
Id
)
{
cycleAnalyticsStageUrl
(
groupId
,
valueStreamId
,
stage
Id
)
{
return
Api
.
buildUrl
(
this
.
cycleAnalyticsStagePath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:group_id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
.
replace
(
'
:stage_id
'
,
stageId
);
},
cycleAnalyticsUpdateStage
(
stageId
,
group
Id
,
data
)
{
const
url
=
this
.
cycleAnalyticsStageUrl
(
stageId
,
groupId
);
cycleAnalyticsUpdateStage
(
groupId
,
valueStreamId
,
stage
Id
,
data
)
{
const
url
=
this
.
cycleAnalyticsStageUrl
(
valueStreamId
,
stageId
,
groupId
);
return
axios
.
put
(
url
,
data
);
},
cycleAnalyticsRemoveStage
(
stageId
,
group
Id
)
{
const
url
=
this
.
cycleAnalyticsStageUrl
(
stageId
,
group
Id
);
cycleAnalyticsRemoveStage
(
groupId
,
valueStreamId
,
stage
Id
)
{
const
url
=
this
.
cycleAnalyticsStageUrl
(
groupId
,
valueStreamId
,
stage
Id
);
return
axios
.
delete
(
url
);
},
cycleAnalyticsDurationChart
(
groupId
,
stageSlug
,
params
=
{})
{
cycleAnalyticsDurationChart
(
groupId
,
valueStreamId
,
stageSlug
,
params
=
{})
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsDurationChartPath
)
.
replace
(
'
:id
'
,
groupId
)
.
replace
(
'
:group_id
'
,
groupId
)
.
replace
(
'
:value_stream_id
'
,
valueStreamId
)
.
replace
(
'
:stage_id
'
,
stageSlug
);
return
axios
.
get
(
url
,
{
...
...
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