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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
0421fbcd
Commit
0421fbcd
authored
May 09, 2018
by
Paul Slaughter
Committed by
Clement Ho
May 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor 'cycle_analytics' to use axios
parent
149e91b5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js
...ets/javascripts/cycle_analytics/cycle_analytics_bundle.js
+0
-2
app/assets/javascripts/cycle_analytics/cycle_analytics_service.js
...ts/javascripts/cycle_analytics/cycle_analytics_service.js
+17
-13
No files found.
app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js
View file @
0421fbcd
...
@@ -82,7 +82,6 @@ export default () => {
...
@@ -82,7 +82,6 @@ export default () => {
this
.
service
this
.
service
.
fetchCycleAnalyticsData
(
fetchOptions
)
.
fetchCycleAnalyticsData
(
fetchOptions
)
.
then
(
resp
=>
resp
.
json
())
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
this
.
store
.
setCycleAnalyticsData
(
response
);
this
.
store
.
setCycleAnalyticsData
(
response
);
this
.
selectDefaultStage
();
this
.
selectDefaultStage
();
...
@@ -116,7 +115,6 @@ export default () => {
...
@@ -116,7 +115,6 @@ export default () => {
stage
,
stage
,
startDate
:
this
.
startDate
,
startDate
:
this
.
startDate
,
})
})
.
then
(
resp
=>
resp
.
json
())
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
this
.
isEmptyStage
=
!
response
.
events
.
length
;
this
.
isEmptyStage
=
!
response
.
events
.
length
;
this
.
store
.
setStageEvents
(
response
.
events
,
stage
);
this
.
store
.
setStageEvents
(
response
.
events
,
stage
);
...
...
app/assets/javascripts/cycle_analytics/cycle_analytics_service.js
View file @
0421fbcd
import
Vue
from
'
vue
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
VueResource
from
'
vue-resource
'
;
Vue
.
use
(
VueResource
);
export
default
class
CycleAnalyticsService
{
export
default
class
CycleAnalyticsService
{
constructor
(
options
)
{
constructor
(
options
)
{
this
.
requestPath
=
options
.
requestPath
;
this
.
axios
=
axios
.
create
({
this
.
cycleAnalytics
=
Vue
.
resource
(
this
.
requestPath
);
baseURL
:
options
.
requestPath
,
});
}
}
fetchCycleAnalyticsData
(
options
=
{
startDate
:
30
})
{
fetchCycleAnalyticsData
(
options
=
{
startDate
:
30
})
{
return
this
.
cycleAnalytics
.
get
({
cycle_analytics
:
{
start_date
:
options
.
startDate
}
});
return
this
.
axios
.
get
(
''
,
{
params
:
{
'
cycle_analytics[start_date]
'
:
options
.
startDate
,
},
})
.
then
(
x
=>
x
.
data
);
}
}
fetchStageData
(
options
)
{
fetchStageData
(
options
)
{
...
@@ -19,12 +23,12 @@ export default class CycleAnalyticsService {
...
@@ -19,12 +23,12 @@ export default class CycleAnalyticsService {
startDate
,
startDate
,
}
=
options
;
}
=
options
;
return
Vue
.
http
.
get
(
`
${
this
.
requestPath
}
/events/
${
stage
.
name
}
.json`
,
{
return
this
.
axios
.
get
(
`events/
${
stage
.
name
}
.json`
,
{
params
:
{
params
:
{
cycle_analytics
:
{
'
cycle_analytics[start_date]
'
:
startDate
,
start_date
:
startDate
,
},
},
},
});
})
.
then
(
x
=>
x
.
data
);
}
}
}
}
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