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
Léo-Paul Géneau
gitlab-ce
Commits
9d5bdb5d
Commit
9d5bdb5d
authored
Jul 27, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve prefer-template and quotes eslint violations
parent
ce4e8910
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
app/assets/javascripts/users/activity_calendar.js
app/assets/javascripts/users/activity_calendar.js
+14
-7
No files found.
app/assets/javascripts/users/activity_calendar.js
View file @
9d5bdb5d
/* eslint-disable no-var, vars-on-top, eqeqeq, newline-per-chained-call, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line,
prefer-template, quotes,
no-unused-vars, no-else-return, max-len, class-methods-use-this */
/* eslint-disable no-var, vars-on-top, eqeqeq, newline-per-chained-call, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, no-unused-vars, no-else-return, max-len, class-methods-use-this */
import
d3
from
'
d3
'
;
import
d3
from
'
d3
'
;
...
@@ -54,6 +54,7 @@ export default class ActivityCalendar {
...
@@ -54,6 +54,7 @@ export default class ActivityCalendar {
// Init color functions
// Init color functions
this
.
colorKey
=
this
.
initColorKey
();
this
.
colorKey
=
this
.
initColorKey
();
this
.
color
=
this
.
initColor
();
this
.
color
=
this
.
initColor
();
// Init the svg element
// Init the svg element
this
.
renderSvg
(
group
);
this
.
renderSvg
(
group
);
this
.
renderDays
();
this
.
renderDays
();
...
@@ -100,7 +101,7 @@ export default class ActivityCalendar {
...
@@ -100,7 +101,7 @@ export default class ActivityCalendar {
}
}
}
}
});
});
return
"
translate(
"
+
((
this
.
daySizeWithSpace
*
i
)
+
1
+
this
.
daySizeWithSpace
)
+
"
, 18)
"
;
return
`translate(
${(
this
.
daySizeWithSpace
*
i
)
+
1
+
this
.
daySizeWithSpace
}
, 18)`
;
})
})
.
selectAll
(
'
rect
'
)
.
selectAll
(
'
rect
'
)
.
data
(
stamp
=>
stamp
)
.
data
(
stamp
=>
stamp
)
...
@@ -115,10 +116,10 @@ export default class ActivityCalendar {
...
@@ -115,10 +116,10 @@ export default class ActivityCalendar {
date
=
new
Date
(
stamp
.
date
);
date
=
new
Date
(
stamp
.
date
);
contribText
=
'
No contributions
'
;
contribText
=
'
No contributions
'
;
if
(
stamp
.
count
>
0
)
{
if
(
stamp
.
count
>
0
)
{
contribText
=
stamp
.
count
+
"
contribution
"
+
(
stamp
.
count
>
1
?
'
s
'
:
''
)
;
contribText
=
`
${
stamp
.
count
}
contribution
${
stamp
.
count
>
1
?
'
s
'
:
''
}
`
;
}
}
dateText
=
date
.
format
(
'
mmm d, yyyy
'
);
dateText
=
date
.
format
(
'
mmm d, yyyy
'
);
return
contribText
+
"
<br />
"
+
(
gl
.
utils
.
getDayName
(
date
))
+
"
"
+
dateText
;
return
`
${
contribText
}
<br />
${
gl
.
utils
.
getDayName
(
date
)}
${
dateText
}
`
;
})
})
.
attr
(
'
class
'
,
'
user-contrib-cell js-tooltip
'
).
attr
(
'
fill
'
,
(
stamp
)
=>
{
.
attr
(
'
class
'
,
'
user-contrib-cell js-tooltip
'
).
attr
(
'
fill
'
,
(
stamp
)
=>
{
if
(
stamp
.
count
!==
0
)
{
if
(
stamp
.
count
!==
0
)
{
...
@@ -202,8 +203,14 @@ export default class ActivityCalendar {
...
@@ -202,8 +203,14 @@ export default class ActivityCalendar {
clickDay
(
stamp
)
{
clickDay
(
stamp
)
{
if
(
this
.
currentSelectedDate
!==
stamp
.
date
)
{
if
(
this
.
currentSelectedDate
!==
stamp
.
date
)
{
this
.
currentSelectedDate
=
stamp
.
date
;
this
.
currentSelectedDate
=
stamp
.
date
;
const
date
=
this
.
currentSelectedDate
.
getFullYear
()
+
"
-
"
+
(
this
.
currentSelectedDate
.
getMonth
()
+
1
)
+
"
-
"
+
this
.
currentSelectedDate
.
getDate
();
return
$
.
ajax
({
const
date
=
[
this
.
currentSelectedDate
.
getFullYear
(),
this
.
currentSelectedDate
.
getMonth
()
+
1
,
this
.
currentSelectedDate
.
getDate
(),
].
join
(
'
-
'
);
$
.
ajax
({
url
:
this
.
calendarActivitiesPath
,
url
:
this
.
calendarActivitiesPath
,
data
:
{
date
},
data
:
{
date
},
cache
:
false
,
cache
:
false
,
...
@@ -213,7 +220,7 @@ export default class ActivityCalendar {
...
@@ -213,7 +220,7 @@ export default class ActivityCalendar {
});
});
}
else
{
}
else
{
this
.
currentSelectedDate
=
''
;
this
.
currentSelectedDate
=
''
;
return
$
(
'
.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