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
45a446ea
Commit
45a446ea
authored
Jul 27, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve comma-dangle and object-shorthand eslint violations
parent
69021457
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
23 deletions
+12
-23
app/assets/javascripts/users/activity_calendar.js
app/assets/javascripts/users/activity_calendar.js
+12
-23
No files found.
app/assets/javascripts/users/activity_calendar.js
View file @
45a446ea
/* eslint-disable no-var, vars-on-top,
object-shorthand, comma-dangle,
eqeqeq, no-mixed-operators, no-return-assign, 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, no-mixed-operators, no-return-assign, 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 */
import
d3
from
'
d3
'
;
import
d3
from
'
d3
'
;
...
@@ -18,6 +18,7 @@ export default class ActivityCalendar {
...
@@ -18,6 +18,7 @@ export default class ActivityCalendar {
this
.
daySizeWithSpace
=
this
.
daySize
+
(
this
.
daySpace
*
2
);
this
.
daySizeWithSpace
=
this
.
daySize
+
(
this
.
daySpace
*
2
);
this
.
monthNames
=
[
'
Jan
'
,
'
Feb
'
,
'
Mar
'
,
'
Apr
'
,
'
May
'
,
'
Jun
'
,
'
Jul
'
,
'
Aug
'
,
'
Sep
'
,
'
Oct
'
,
'
Nov
'
,
'
Dec
'
];
this
.
monthNames
=
[
'
Jan
'
,
'
Feb
'
,
'
Mar
'
,
'
Apr
'
,
'
May
'
,
'
Jun
'
,
'
Jul
'
,
'
Aug
'
,
'
Sep
'
,
'
Oct
'
,
'
Nov
'
,
'
Dec
'
];
this
.
months
=
[];
this
.
months
=
[];
// Loop through the timestamps to create a group of objects
// Loop through the timestamps to create a group of objects
// The group of objects will be grouped based on the day of the week they are
// The group of objects will be grouped based on the day of the week they are
this
.
timestampsTmp
=
[];
this
.
timestampsTmp
=
[];
...
@@ -36,7 +37,7 @@ export default class ActivityCalendar {
...
@@ -36,7 +37,7 @@ export default class ActivityCalendar {
date
.
setDate
(
date
.
getDate
()
+
i
);
date
.
setDate
(
date
.
getDate
()
+
i
);
var
day
=
date
.
getDay
();
var
day
=
date
.
getDay
();
var
count
=
timestamps
[
date
.
format
(
'
yyyy-mm-dd
'
)];
var
count
=
timestamps
[
date
.
format
(
'
yyyy-mm-dd
'
)]
||
0
;
// Create a new group array if this is the first day of the week
// Create a new group array if this is the first day of the week
// or if is first object
// or if is first object
...
@@ -45,13 +46,9 @@ export default class ActivityCalendar {
...
@@ -45,13 +46,9 @@ export default class ActivityCalendar {
group
+=
1
;
group
+=
1
;
}
}
var
innerArray
=
this
.
timestampsTmp
[
group
-
1
];
// Push to the inner array the values that will be used to render map
// Push to the inner array the values that will be used to render map
innerArray
.
push
({
var
innerArray
=
this
.
timestampsTmp
[
group
-
1
];
count
:
count
||
0
,
innerArray
.
push
({
count
,
date
,
day
});
date
:
date
,
day
:
day
});
}
}
// Init color functions
// Init color functions
...
@@ -97,15 +94,9 @@ export default class ActivityCalendar {
...
@@ -97,15 +94,9 @@ export default class ActivityCalendar {
lastMonthX
=
lastMonth
.
x
;
lastMonthX
=
lastMonth
.
x
;
}
}
if
(
lastMonth
==
null
)
{
if
(
lastMonth
==
null
)
{
return
this
.
months
.
push
({
return
this
.
months
.
push
({
month
,
x
});
month
:
month
,
x
:
x
});
}
else
if
(
month
!==
lastMonth
.
month
&&
x
-
this
.
daySizeWithSpace
!==
lastMonthX
)
{
}
else
if
(
month
!==
lastMonth
.
month
&&
x
-
this
.
daySizeWithSpace
!==
lastMonthX
)
{
return
this
.
months
.
push
({
return
this
.
months
.
push
({
month
,
x
});
month
:
month
,
x
:
x
});
}
}
}
}
});
});
...
@@ -144,14 +135,14 @@ export default class ActivityCalendar {
...
@@ -144,14 +135,14 @@ export default class ActivityCalendar {
const
days
=
[
const
days
=
[
{
{
text
:
'
M
'
,
text
:
'
M
'
,
y
:
29
+
(
this
.
daySizeWithSpace
*
1
)
y
:
29
+
(
this
.
daySizeWithSpace
*
1
)
,
},
{
},
{
text
:
'
W
'
,
text
:
'
W
'
,
y
:
29
+
(
this
.
daySizeWithSpace
*
3
)
y
:
29
+
(
this
.
daySizeWithSpace
*
3
)
,
},
{
},
{
text
:
'
F
'
,
text
:
'
F
'
,
y
:
29
+
(
this
.
daySizeWithSpace
*
5
)
y
:
29
+
(
this
.
daySizeWithSpace
*
5
)
,
}
}
,
];
];
this
.
svg
.
append
(
'
g
'
)
this
.
svg
.
append
(
'
g
'
)
.
selectAll
(
'
text
'
)
.
selectAll
(
'
text
'
)
...
@@ -227,8 +218,6 @@ export default class ActivityCalendar {
...
@@ -227,8 +218,6 @@ export default class ActivityCalendar {
}
}
initTooltips
()
{
initTooltips
()
{
return
$
(
'
.js-contrib-calendar .js-tooltip
'
).
tooltip
({
$
(
'
.js-contrib-calendar .js-tooltip
'
).
tooltip
({
html
:
true
});
html
:
true
});
}
}
}
}
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