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
iv
gitlab-ce
Commits
f1a0e882
Commit
f1a0e882
authored
Jun 13, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue with user calendar colors
Closes #18505
parent
06a99cf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
app/assets/javascripts/users/calendar.js.coffee
app/assets/javascripts/users/calendar.js.coffee
+6
-11
No files found.
app/assets/javascripts/users/calendar.js.coffee
View file @
f1a0e882
...
@@ -6,12 +6,6 @@ class @Calendar
...
@@ -6,12 +6,6 @@ class @Calendar
@
daySizeWithSpace
=
@
daySize
+
(
@
daySpace
*
2
)
@
daySizeWithSpace
=
@
daySize
+
(
@
daySpace
*
2
)
@
monthNames
=
[
'Jan'
,
'Feb'
,
'Mar'
,
'Apr'
,
'May'
,
'Jun'
,
'Jul'
,
'Aug'
,
'Sep'
,
'Oct'
,
'Nov'
,
'Dec'
]
@
monthNames
=
[
'Jan'
,
'Feb'
,
'Mar'
,
'Apr'
,
'May'
,
'Jun'
,
'Jul'
,
'Aug'
,
'Sep'
,
'Oct'
,
'Nov'
,
'Dec'
]
@
months
=
[]
@
months
=
[]
@
highestValue
=
0
# Get the highest value from the timestampes
_
.
each
timestamps
,
(
count
)
=>
if
count
>
@
highestValue
@
highestValue
=
count
# 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
...
@@ -39,8 +33,8 @@ class @Calendar
...
@@ -39,8 +33,8 @@ class @Calendar
i
++
i
++
# Init color functions
# Init color functions
@
color
=
@
initColor
()
@
colorKey
=
@
initColorKey
()
@
colorKey
=
@
initColorKey
()
@
color
=
@
initColor
()
# Init the svg element
# Init the svg element
@
renderSvg
(
group
)
@
renderSvg
(
group
)
...
@@ -104,7 +98,7 @@ class @Calendar
...
@@ -104,7 +98,7 @@ class @Calendar
.
attr
'class'
,
'user-contrib-cell js-tooltip'
.
attr
'class'
,
'user-contrib-cell js-tooltip'
.
attr
'fill'
,
(
stamp
)
=>
.
attr
'fill'
,
(
stamp
)
=>
if
stamp
.
count
isnt
0
if
stamp
.
count
isnt
0
@
color
(
stamp
.
count
)
@
color
(
Math
.
min
(
stamp
.
count
,
40
)
)
else
else
'#ededed'
'#ededed'
.
attr
'data-container'
,
'body'
.
attr
'data-container'
,
'body'
...
@@ -164,10 +158,11 @@ class @Calendar
...
@@ -164,10 +158,11 @@ class @Calendar
color
color
initColor
:
->
initColor
:
->
colorRange
=
[
'#ededed'
,
@
colorKey
(
0
),
@
colorKey
(
1
),
@
colorKey
(
2
),
@
colorKey
(
3
)]
d3
.
scale
d3
.
scale
.
linear
()
.
threshold
()
.
range
([
'#acd5f2'
,
'#254e77'
])
.
domain
([
0
,
10
,
20
,
30
])
.
domain
([
0
,
@
highestValue
]
)
.
range
(
colorRange
)
initColorKey
:
->
initColorKey
:
->
d3
.
scale
d3
.
scale
...
...
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