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
980fa2b3
Commit
980fa2b3
authored
Nov 25, 2019
by
Brandon Labuschagne
Committed by
Phil Hughes
Nov 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add CA duration chart endpoint
parent
ab3c3fed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
ee/app/assets/javascripts/api.js
ee/app/assets/javascripts/api.js
+10
-0
ee/spec/frontend/api_spec.js
ee/spec/frontend/api_spec.js
+24
-0
No files found.
ee/app/assets/javascripts/api.js
View file @
980fa2b3
...
@@ -23,6 +23,7 @@ export default {
...
@@ -23,6 +23,7 @@ export default {
cycleAnalyticsGroupStagesAndEventsPath
:
'
/-/analytics/cycle_analytics/stages
'
,
cycleAnalyticsGroupStagesAndEventsPath
:
'
/-/analytics/cycle_analytics/stages
'
,
cycleAnalyticsStageEventsPath
:
'
/groups/:group_id/-/cycle_analytics/events/:stage_id.json
'
,
cycleAnalyticsStageEventsPath
:
'
/groups/:group_id/-/cycle_analytics/events/:stage_id.json
'
,
cycleAnalyticsStagePath
:
'
/-/analytics/cycle_analytics/stages/:stage_id
'
,
cycleAnalyticsStagePath
:
'
/-/analytics/cycle_analytics/stages/:stage_id
'
,
cycleAnalyticsDurationChartPath
:
'
/-/analytics/cycle_analytics/stages/:stage_id/duration_chart
'
,
userSubscription
(
namespaceId
)
{
userSubscription
(
namespaceId
)
{
const
url
=
Api
.
buildUrl
(
this
.
subscriptionPath
).
replace
(
'
:id
'
,
encodeURIComponent
(
namespaceId
));
const
url
=
Api
.
buildUrl
(
this
.
subscriptionPath
).
replace
(
'
:id
'
,
encodeURIComponent
(
namespaceId
));
...
@@ -154,6 +155,7 @@ export default {
...
@@ -154,6 +155,7 @@ export default {
cycleAnalyticsGroupStagesAndEvents
(
groupId
,
params
=
{})
{
cycleAnalyticsGroupStagesAndEvents
(
groupId
,
params
=
{})
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsGroupStagesAndEventsPath
);
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsGroupStagesAndEventsPath
);
return
axios
.
get
(
url
,
{
return
axios
.
get
(
url
,
{
params
:
{
group_id
:
groupId
,
...
params
},
params
:
{
group_id
:
groupId
,
...
params
},
});
});
...
@@ -194,4 +196,12 @@ export default {
...
@@ -194,4 +196,12 @@ export default {
params
:
{
group_id
:
groupId
},
params
:
{
group_id
:
groupId
},
});
});
},
},
cycleAnalyticsDurationChart
(
stageSlug
,
params
=
{})
{
const
url
=
Api
.
buildUrl
(
this
.
cycleAnalyticsDurationChartPath
).
replace
(
'
:stage_id
'
,
stageSlug
);
return
axios
.
get
(
url
,
{
params
,
});
},
};
};
ee/spec/frontend/api_spec.js
View file @
980fa2b3
...
@@ -477,5 +477,29 @@ describe('Api', () => {
...
@@ -477,5 +477,29 @@ describe('Api', () => {
.
catch
(
done
.
fail
);
.
catch
(
done
.
fail
);
});
});
});
});
describe
(
'
cycleAnalyticsDurationChart
'
,
()
=>
{
it
(
'
fetches stage duration data
'
,
done
=>
{
const
response
=
[];
const
params
=
{
group_id
:
groupId
,
created_after
:
createdAfter
,
created_before
:
createdBefore
,
};
const
expectedUrl
=
`
${
dummyUrlRoot
}
/-/analytics/cycle_analytics/stages/thursday/duration_chart`
;
mock
.
onGet
(
expectedUrl
).
reply
(
200
,
response
);
Api
.
cycleAnalyticsDurationChart
(
stageId
,
params
)
.
then
(
responseObj
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
params
,
expectedUrl
,
}),
)
.
then
(
done
)
.
catch
(
done
.
fail
);
});
});
});
});
});
});
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