Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
projects.thm.de
GitLab
Commits
26dde5f5
Commit
26dde5f5
authored
May 24, 2017
by
Taurie Davis, Simon Knox and Adam Niedzielski
Committed by
Adam Niedzielski
Jun 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Conversational Development Index page to admin panel
parent
c72abcef
Changes
53
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
1270 additions
and
50 deletions
+1270
-50
app/assets/images/i2p-step.svg
app/assets/images/i2p-step.svg
+4
-0
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+3
-0
app/assets/javascripts/user_callout.js
app/assets/javascripts/user_callout.js
+5
-6
app/assets/stylesheets/framework/variables.scss
app/assets/stylesheets/framework/variables.scss
+7
-0
app/assets/stylesheets/pages/convdev_index.scss
app/assets/stylesheets/pages/convdev_index.scss
+271
-0
app/assets/stylesheets/pages/profile.scss
app/assets/stylesheets/pages/profile.scss
+22
-3
app/controllers/admin/conversational_development_index_controller.rb
...lers/admin/conversational_development_index_controller.rb
+5
-0
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+2
-2
app/helpers/conversational_development_index_helper.rb
app/helpers/conversational_development_index_helper.rb
+16
-0
app/models/conversational_development_index/card.rb
app/models/conversational_development_index/card.rb
+26
-0
app/models/conversational_development_index/idea_to_production_step.rb
...nversational_development_index/idea_to_production_step.rb
+19
-0
app/models/conversational_development_index/metric.rb
app/models/conversational_development_index/metric.rb
+21
-0
app/presenters/conversational_development_index/metric_presenter.rb
...ters/conversational_development_index/metric_presenter.rb
+144
-0
app/services/submit_usage_ping_service.rb
app/services/submit_usage_ping_service.rb
+41
-0
app/views/admin/background_jobs/show.html.haml
app/views/admin/background_jobs/show.html.haml
+1
-1
app/views/admin/conversational_development_index/_callout.html.haml
...admin/conversational_development_index/_callout.html.haml
+13
-0
app/views/admin/conversational_development_index/_card.html.haml
...ws/admin/conversational_development_index/_card.html.haml
+25
-0
app/views/admin/conversational_development_index/_disabled.html.haml
...dmin/conversational_development_index/_disabled.html.haml
+9
-0
app/views/admin/conversational_development_index/_no_data.html.haml
...admin/conversational_development_index/_no_data.html.haml
+7
-0
app/views/admin/conversational_development_index/show.html.haml
...ews/admin/conversational_development_index/show.html.haml
+36
-0
app/views/admin/health_check/show.html.haml
app/views/admin/health_check/show.html.haml
+1
-1
app/views/admin/logs/show.html.haml
app/views/admin/logs/show.html.haml
+1
-1
app/views/admin/monitoring/_head.html.haml
app/views/admin/monitoring/_head.html.haml
+4
-0
app/views/admin/requests_profiles/index.html.haml
app/views/admin/requests_profiles/index.html.haml
+1
-1
app/views/admin/system_info/show.html.haml
app/views/admin/system_info/show.html.haml
+1
-1
app/views/dashboard/projects/index.html.haml
app/views/dashboard/projects/index.html.haml
+1
-1
app/views/layouts/nav/_admin.html.haml
app/views/layouts/nav/_admin.html.haml
+2
-2
app/views/shared/_user_callout.html.haml
app/views/shared/_user_callout.html.haml
+1
-1
app/views/shared/icons/_convdev_no_data.svg
app/views/shared/icons/_convdev_no_data.svg
+40
-0
app/views/shared/icons/_convdev_no_index.svg
app/views/shared/icons/_convdev_no_index.svg
+67
-0
app/views/shared/icons/_convdev_overview.svg
app/views/shared/icons/_convdev_overview.svg
+64
-0
app/views/shared/icons/_i2p_step_1.svg
app/views/shared/icons/_i2p_step_1.svg
+12
-0
app/views/shared/icons/_i2p_step_10.svg
app/views/shared/icons/_i2p_step_10.svg
+12
-0
app/views/shared/icons/_i2p_step_2.svg
app/views/shared/icons/_i2p_step_2.svg
+5
-0
app/views/shared/icons/_i2p_step_3.svg
app/views/shared/icons/_i2p_step_3.svg
+12
-0
app/views/shared/icons/_i2p_step_4.svg
app/views/shared/icons/_i2p_step_4.svg
+6
-0
app/views/shared/icons/_i2p_step_5.svg
app/views/shared/icons/_i2p_step_5.svg
+5
-0
app/views/shared/icons/_i2p_step_6.svg
app/views/shared/icons/_i2p_step_6.svg
+15
-0
app/views/shared/icons/_i2p_step_7.svg
app/views/shared/icons/_i2p_step_7.svg
+7
-0
app/views/shared/icons/_i2p_step_8.svg
app/views/shared/icons/_i2p_step_8.svg
+4
-0
app/views/shared/icons/_i2p_step_9.svg
app/views/shared/icons/_i2p_step_9.svg
+4
-0
app/views/users/show.html.haml
app/views/users/show.html.haml
+1
-1
app/workers/gitlab_usage_ping_worker.rb
app/workers/gitlab_usage_ping_worker.rb
+3
-15
changelogs/unreleased/30469-convdev-index.yml
changelogs/unreleased/30469-convdev-index.yml
+4
-0
config/routes/admin.rb
config/routes/admin.rb
+2
-0
db/fixtures/development/21_conversational_development_index_metrics.rb
...evelopment/21_conversational_development_index_metrics.rb
+40
-0
db/migrate/20170523121229_create_conversational_development_index_metrics.rb
...121229_create_conversational_development_index_metrics.rb
+39
-0
db/schema.rb
db/schema.rb
+25
-0
spec/factories/conversational_development_index_metrics.rb
spec/factories/conversational_development_index_metrics.rb
+33
-0
spec/features/admin/admin_conversational_development_index_spec.rb
...ures/admin/admin_conversational_development_index_spec.rb
+40
-0
spec/presenters/conversational_development_index/metric_presenter_spec.rb
...conversational_development_index/metric_presenter_spec.rb
+36
-0
spec/services/submit_usage_ping_service_spec.rb
spec/services/submit_usage_ping_service_spec.rb
+101
-0
spec/workers/gitlab_usage_ping_worker_spec.rb
spec/workers/gitlab_usage_ping_worker_spec.rb
+4
-14
No files found.
app/assets/images/i2p-step.svg
0 → 100644
View file @
26dde5f5
<?xml version="1.0"?>
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 12 120"
enable-background=
"new 0 0 12 120"
>
<path
d=
"m12 6c0-3.309-2.691-6-6-6s-6 2.691-6 6c0 2.967 2.167 5.431 5 5.91v108.09h2v-108.09c2.833-.479 5-2.943 5-5.91m-6 4c-2.206 0-4-1.794-4-4s1.794-4 4-4 4 1.794 4 4-1.794 4-4 4"
/>
</svg>
app/assets/javascripts/dispatcher.js
View file @
26dde5f5
...
@@ -393,6 +393,9 @@ import ShortcutsBlob from './shortcuts_blob';
...
@@ -393,6 +393,9 @@ import ShortcutsBlob from './shortcuts_blob';
case
'
users:show
'
:
case
'
users:show
'
:
new
UserCallout
();
new
UserCallout
();
break
;
break
;
case
'
admin:conversational_development_index:show
'
:
new
UserCallout
();
break
;
case
'
snippets:show
'
:
case
'
snippets:show
'
:
new
LineHighlighter
();
new
LineHighlighter
();
new
BlobViewer
();
new
BlobViewer
();
...
...
app/assets/javascripts/user_callout.js
View file @
26dde5f5
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
const
USER_CALLOUT_COOKIE
=
'
user_callout_dismissed
'
;
export
default
class
UserCallout
{
export
default
class
UserCallout
{
constructor
()
{
constructor
(
className
=
'
user-callout
'
)
{
this
.
isCalloutDismissed
=
Cookies
.
get
(
USER_CALLOUT_COOKIE
);
this
.
userCalloutBody
=
$
(
`.
${
className
}
`
);
this
.
userCalloutBody
=
$
(
'
.user-callout
'
);
this
.
cookieName
=
this
.
userCalloutBody
.
data
(
'
uid
'
);
this
.
isCalloutDismissed
=
Cookies
.
get
(
this
.
cookieName
);
this
.
init
();
this
.
init
();
}
}
...
@@ -18,7 +17,7 @@ export default class UserCallout {
...
@@ -18,7 +17,7 @@ export default class UserCallout {
dismissCallout
(
e
)
{
dismissCallout
(
e
)
{
const
$currentTarget
=
$
(
e
.
currentTarget
);
const
$currentTarget
=
$
(
e
.
currentTarget
);
Cookies
.
set
(
USER_CALLOUT_COOKIE
,
'
true
'
,
{
expires
:
365
});
Cookies
.
set
(
this
.
cookieName
,
'
true
'
,
{
expires
:
365
});
if
(
$currentTarget
.
hasClass
(
'
close
'
))
{
if
(
$currentTarget
.
hasClass
(
'
close
'
))
{
this
.
userCalloutBody
.
remove
();
this
.
userCalloutBody
.
remove
();
...
...
app/assets/stylesheets/framework/variables.scss
View file @
26dde5f5
...
@@ -569,3 +569,10 @@ $filter-value-selected-color: #d7d7d7;
...
@@ -569,3 +569,10 @@ $filter-value-selected-color: #d7d7d7;
Animation Functions
Animation Functions
*/
*/
$dropdown-animation-timing
:
cubic-bezier
(
0
.23
,
1
,
0
.32
,
1
);
$dropdown-animation-timing
:
cubic-bezier
(
0
.23
,
1
,
0
.32
,
1
);
/*
Convdev Index
*/
$color-high-score
:
$green-400
;
$color-average-score
:
$orange-400
;
$color-low-score
:
$red-400
;
app/assets/stylesheets/pages/convdev_index.scss
0 → 100644
View file @
26dde5f5
$space-between-cards
:
8px
;
.convdev-empty
svg
{
margin
:
64px
auto
32px
;
max-width
:
420px
;
}
.convdev-header
{
margin-top
:
$gl-padding
;
margin-bottom
:
$gl-padding
;
padding
:
0
4px
;
display
:
flex
;
align-items
:
center
;
.convdev-header-title
{
font-size
:
48px
;
line-height
:
1
;
margin
:
0
;
}
.convdev-header-subtitle
{
font-size
:
22px
;
line-height
:
1
;
color
:
$gl-text-color-secondary
;
margin-left
:
8px
;
font-weight
:
500
;
a
{
font-size
:
18px
;
color
:
$gl-text-color-secondary
;
&
:hover
{
color
:
$blue-500
;
}
}
}
}
.convdev-cards
{
display
:
flex
;
justify-content
:
center
;
@media
(
max-width
:
$screen-lg-min
)
{
flex-wrap
:
wrap
;
}
}
.convdev-card-wrapper
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
stretch
;
text-align
:
center
;
width
:
10%
;
border-color
:
$border-color
;
margin
:
0
0
32px
;
padding
:
$space-between-cards
/
2
;
position
:
relative
;
@media
(
max-width
:
$screen-lg-min
)
{
width
:
16
.667%
;
.convdev-card-title
{
max-width
:
100px
;
margin
:
$gl-padding
auto
auto
;
}
.card-scores
{
margin
:
$gl-padding
24px
;
}
}
@media
(
max-width
:
$screen-md-min
)
{
width
:
20%
;
}
@media
(
max-width
:
$screen-sm-min
)
{
width
:
25%
;
}
@media
(
max-width
:
$screen-xs-min
)
{
width
:
50%
;
}
}
.convdev-card
{
border
:
solid
1px
$border-color
;
border-top-width
:
3px
;
border-top-left-radius
:
3px
;
border-top-right-radius
:
3px
;
display
:
flex
;
flex-direction
:
column
;
flex-grow
:
1
;
}
.convdev-card-low
{
border-top-color
:
$color-low-score
;
.card-score-big
{
background-color
:
$red-25
;
}
}
.convdev-card-average
{
border-top-color
:
$color-average-score
;
.card-score-big
{
background-color
:
$orange-25
;
}
}
.convdev-card-high
{
border-top-color
:
$color-high-score
;
.card-score-big
{
background-color
:
$green-25
;
}
}
.convdev-card-title
{
margin-top
:
$gl-padding
;
margin-bottom
:
auto
;
h3
{
font-size
:
14px
;
margin
:
0
0
2px
;
}
.text-light
{
font-size
:
13px
;
line-height
:
1
.25
;
color
:
$gl-text-color-secondary
;
}
}
.card-scores
{
display
:
flex
;
justify-content
:
space-around
;
align-items
:
center
;
margin
:
$gl-padding
$gl-btn-padding
;
line-height
:
1
;
}
.card-score
{
color
:
$gl-text-color-secondary
;
.card-score-name
{
font-size
:
13px
;
margin-top
:
4px
;
}
}
.card-score-value
{
font-size
:
16px
;
color
:
$gl-text-color
;
font-weight
:
500
;
}
.card-score-big
{
border-top
:
2px
solid
$border-color
;
border-bottom
:
1px
solid
$border-color
;
font-size
:
22px
;
padding
:
10px
0
;
font-weight
:
500
;
}
.card-buttons
{
display
:
flex
;
justify-content
:
stretch
;
>
*
{
font-size
:
16px
;
color
:
$gl-text-color-secondary
;
padding
:
10px
;
flex-grow
:
1
;
&
:hover
{
background-color
:
$border-color
;
color
:
$gl-text-color
;
}
+
*
{
border-left
:
solid
1px
$border-color
;
}
}
}
.convdev-steps
{
margin-top
:
$gl-padding
;
height
:
1px
;
min-width
:
100%
;
justify-content
:
space-around
;
position
:
relative
;
background
:
$border-color
;
@media
(
max-width
:
$screen-lg-min
)
{
display
:
none
;
}
}
.convdev-step
{
$step-positions
:
5%
10%
30%
42%
48%
55%
60%
70%
75%
90%
;
@each
$pos
in
$step-positions
{
$i
:
index
(
$step-positions
,
$pos
);
&
:nth-child
(
#{
$i
}
)
{
left
:
$pos
;
}
}
position
:
absolute
;
transform-origin
:
75%
50%
;
padding
:
8px
;
height
:
50px
;
width
:
50px
;
border-radius
:
3px
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
border
:
solid
1px
$border-color
;
background
:
$white-light
;
transform
:
translate
(
-50%
,
-50%
);
color
:
$gl-text-color-secondary
;
fill
:
$gl-text-color-secondary
;
box-shadow
:
0
2px
4px
$dropdown-shadow-color
;
&
:hover
{
padding
:
8px
10px
;
fill
:
currentColor
;
z-index
:
100
;
height
:
auto
;
width
:
auto
;
.convdev-step-title
{
max-height
:
2em
;
opacity
:
1
;
transition
:
opacity
0
.2s
;
}
svg
{
transform
:
scale
(
1
.5
);
margin
:
$gl-btn-padding
;
}
}
svg
{
transition
:
transform
0
.1s
;
width
:
30px
;
height
:
30px
;
}
}
.convdev-step-title
{
max-height
:
0
;
opacity
:
0
;
text-transform
:
uppercase
;
margin
:
$gl-vert-padding
0
0
;
text-align
:
center
;
font-size
:
12px
;
}
.convdev-high-score
{
color
:
$color-high-score
;
}
.convdev-average-score
{
color
:
$color-average-score
;
}
.convdev-low-score
{
color
:
$color-low-score
;
}
app/assets/stylesheets/pages/profile.scss
View file @
26dde5f5
...
@@ -287,6 +287,7 @@ table.u2f-registrations {
...
@@ -287,6 +287,7 @@ table.u2f-registrations {
.user-callout
{
.user-callout
{
margin
:
0
auto
;
margin
:
0
auto
;
max-width
:
$screen-lg-min
;
.bordered-box
{
.bordered-box
{
border
:
1px
solid
$blue-300
;
border
:
1px
solid
$blue-300
;
...
@@ -295,14 +296,15 @@ table.u2f-registrations {
...
@@ -295,14 +296,15 @@ table.u2f-registrations {
position
:
relative
;
position
:
relative
;
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
}
}
.landing
{
.landing
{
margin-top
:
$gl-padding
;
padding
:
32px
;
margin-bottom
:
$gl-padding
;
.close
{
.close
{
position
:
absolute
;
position
:
absolute
;
top
:
20px
;
right
:
20px
;
right
:
20px
;
opacity
:
1
;
opacity
:
1
;
...
@@ -330,11 +332,20 @@ table.u2f-registrations {
...
@@ -330,11 +332,20 @@ table.u2f-registrations {
height
:
110px
;
height
:
110px
;
vertical-align
:
top
;
vertical-align
:
top
;
}
}
&
.convdev
{
margin
:
0
0
0
30px
;
svg
{
height
:
127px
;
}
}
}
}
.user-callout-copy
{
.user-callout-copy
{
display
:
inline-block
;
display
:
inline-block
;
vertical-align
:
top
;
vertical-align
:
top
;
max-width
:
570px
;
}
}
}
}
...
@@ -348,12 +359,20 @@ table.u2f-registrations {
...
@@ -348,12 +359,20 @@ table.u2f-registrations {
.landing
{
.landing
{
.svg-container
,
.svg-container
,
.user-callout-copy
{
.user-callout-copy
{
margin
:
0
;
margin
:
0
auto
;
display
:
block
;
display
:
block
;
svg
{
svg
{
height
:
75px
;
height
:
75px
;
}
}
&
.convdev
{
margin
:
$gl-padding
auto
0
;
svg
{
height
:
120px
;
}
}
}
}
}
}
}
}
...
...
app/controllers/admin/conversational_development_index_controller.rb
0 → 100644
View file @
26dde5f5
class
Admin::ConversationalDevelopmentIndexController
<
Admin
::
ApplicationController
def
show
@metric
=
ConversationalDevelopmentIndex
::
Metric
.
order
(
:created_at
).
last
&
.
present
end
end
app/helpers/application_helper.rb
View file @
26dde5f5
...
@@ -275,8 +275,8 @@ def active_when(condition)
...
@@ -275,8 +275,8 @@ def active_when(condition)
'active'
if
condition
'active'
if
condition
end
end
def
show_
user_
callout?
def
show_callout?
(
name
)
cookies
[
:user_callout_dismissed
].
nil?
cookies
[
name
]
!=
'true'
end
end
def
linkedin_url
(
user
)
def
linkedin_url
(
user
)
...
...
app/helpers/conversational_development_index_helper.rb
0 → 100644
View file @
26dde5f5
module
ConversationalDevelopmentIndexHelper
def
score_level
(
score
)
if
score
<
33.33
'low'
elsif
score
<
66.66
'average'
else
'high'
end
end
def
format_score
(
score
)
precision
=
score
<
1
?
2
:
1
number_with_precision
(
score
,
precision:
precision
)
end
end
app/models/conversational_development_index/card.rb
0 → 100644
View file @
26dde5f5
module
ConversationalDevelopmentIndex
class
Card
attr_accessor
:metric
,
:title
,
:description
,
:feature
,
:blog
,
:docs
def
initialize
(
metric
:,
title
:,
description
:,
feature
:,
blog
:,
docs:
nil
)
self
.
metric
=
metric
self
.
title
=
title
self
.
description
=
description
self
.
feature
=
feature
self
.
blog
=
blog
self
.
docs
=
docs
end
def
instance_score
metric
.
instance_score
(
feature
)
end
def
leader_score
metric
.
leader_score
(
feature
)
end
def
percentage_score
metric
.
percentage_score
(
feature
)
end
end
end
app/models/conversational_development_index/idea_to_production_step.rb
0 → 100644
View file @
26dde5f5
module
ConversationalDevelopmentIndex
class
IdeaToProductionStep
attr_accessor
:metric
,
:title
,
:features
def
initialize
(
metric
:,
title
:,
features
:)
self
.
metric
=
metric
self
.
title
=
title
self
.
features
=
features
end
def
percentage_score
sum
=
features
.
map
do
|
feature
|
metric
.
percentage_score
(
feature
)
end
.
inject
(:
+
)
sum
/
features
.
size
.
to_f
end
end
end
app/models/conversational_development_index/metric.rb
0 → 100644
View file @
26dde5f5
module
ConversationalDevelopmentIndex
class
Metric
<
ActiveRecord
::
Base
include
Presentable
self
.
table_name
=
'conversational_development_index_metrics'
def
instance_score
(
feature
)
self
[
"instance_
#{
feature
}
"
]
end
def
leader_score
(
feature
)
self
[
"leader_
#{
feature
}
"
]
end
def
percentage_score
(
feature
)
return
100
if
leader_score
(
feature
).
zero?
100
*
instance_score
(
feature
)
/
leader_score
(
feature
)
end
end
end
app/presenters/conversational_development_index/metric_presenter.rb
0 → 100644
View file @
26dde5f5
module
ConversationalDevelopmentIndex
class
MetricPresenter
<
Gitlab
::
View
::
Presenter
::
Simple
def
cards
[
Card
.
new
(
metric:
subject
,
title:
'Issues'
,
description:
'created per active user'
,
feature:
'issues'
,
blog:
'https://www2.deloitte.com/content/dam/Deloitte/se/Documents/technology-media-telecommunications/deloitte-digital-collaboration.pdf'
),
Card
.
new
(
metric:
subject
,
title:
'Comments'
,
description:
'created per active user'
,
feature:
'notes'
,
blog:
'http://conversationaldevelopment.com/why/'
),
Card
.
new
(
metric:
subject
,
title:
'Milestones'
,
description:
'created per active user'
,
feature:
'milestones'
,
blog:
'http://conversationaldevelopment.com/shorten-cycle/'
,
docs:
help_page_path
(
'user/project/milestones/index'
)
),
Card
.
new
(
metric:
subject
,
title:
'Boards'
,
description:
'created per active user'
,
feature:
'boards'
,
blog:
'http://jpattonassociates.com/user-story-mapping/'
,
docs:
help_page_path
(
'user/project/issue_board'
)
),
Card
.
new
(
metric:
subject
,
title:
'Merge Requests'
,
description:
'per active user'
,
feature:
'merge_requests'
,
blog:
'https://8thlight.com/blog/uncle-bob/2013/02/01/The-Humble-Craftsman.html'
,
docs:
help_page_path
(
'user/project/merge_requests/index'
)
),
Card
.
new
(
metric:
subject
,
title:
'Pipelines'
,