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
9709b5ed
Commit
9709b5ed
authored
Jan 31, 2018
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace $.ajax in activity calendar with axios
parent
560c93e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
app/assets/javascripts/users/activity_calendar.js
app/assets/javascripts/users/activity_calendar.js
+14
-9
No files found.
app/assets/javascripts/users/activity_calendar.js
View file @
9709b5ed
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
{
scaleLinear
,
scaleThreshold
}
from
'
d3-scale
'
;
import
{
scaleLinear
,
scaleThreshold
}
from
'
d3-scale
'
;
import
{
select
}
from
'
d3-selection
'
;
import
{
select
}
from
'
d3-selection
'
;
import
{
getDayName
,
getDayDifference
}
from
'
../lib/utils/datetime_utility
'
;
import
{
getDayName
,
getDayDifference
}
from
'
~/lib/utils/datetime_utility
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
flash
from
'
~/flash
'
;
import
{
__
}
from
'
~/locale
'
;
const
d3
=
{
select
,
scaleLinear
,
scaleThreshold
};
const
d3
=
{
select
,
scaleLinear
,
scaleThreshold
};
...
@@ -221,14 +224,16 @@ export default class ActivityCalendar {
...
@@ -221,14 +224,16 @@ export default class ActivityCalendar {
this
.
currentSelectedDate
.
getDate
(),
this
.
currentSelectedDate
.
getDate
(),
].
join
(
'
-
'
);
].
join
(
'
-
'
);
$
.
ajax
({
$
(
'
.user-calendar-activities
'
).
html
(
LOADING_HTML
);
url
:
this
.
calendarActivitiesPath
,
data
:
{
date
},
axios
.
get
(
this
.
calendarActivitiesPath
,
{
cache
:
false
,
params
:
{
dataType
:
'
html
'
,
date
,
beforeSend
:
()
=>
$
(
'
.user-calendar-activities
'
).
html
(
LOADING_HTML
),
},
success
:
data
=>
$
(
'
.user-calendar-activities
'
).
html
(
data
),
responseType
:
'
text
'
,
});
})
.
then
(({
data
})
=>
$
(
'
.user-calendar-activities
'
).
html
(
data
))
.
catch
(()
=>
flash
(
__
(
'
An error occurred while retrieving calendar activity
'
)));
}
else
{
}
else
{
this
.
currentSelectedDate
=
''
;
this
.
currentSelectedDate
=
''
;
$
(
'
.user-calendar-activities
'
).
html
(
''
);
$
(
'
.user-calendar-activities
'
).
html
(
''
);
...
...
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