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
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
Show 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
{
scaleLinear
,
scaleThreshold
}
from
'
d3-scale
'
;
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
};
...
...
@@ -221,14 +224,16 @@ export default class ActivityCalendar {
this
.
currentSelectedDate
.
getDate
(),
].
join
(
'
-
'
);
$
.
ajax
({
url
:
this
.
calendarActivitiesPath
,
data
:
{
date
},
cache
:
false
,
dataType
:
'
html
'
,
beforeSend
:
()
=>
$
(
'
.user-calendar-activities
'
).
html
(
LOADING_HTML
),
success
:
data
=>
$
(
'
.user-calendar-activities
'
).
html
(
data
),
});
$
(
'
.user-calendar-activities
'
).
html
(
LOADING_HTML
);
axios
.
get
(
this
.
calendarActivitiesPath
,
{
params
:
{
date
,
},
responseType
:
'
text
'
,
})
.
then
(({
data
})
=>
$
(
'
.user-calendar-activities
'
).
html
(
data
))
.
catch
(()
=>
flash
(
__
(
'
An error occurred while retrieving calendar activity
'
)));
}
else
{
this
.
currentSelectedDate
=
''
;
$
(
'
.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