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
fe959906
Commit
fe959906
authored
Mar 26, 2020
by
Doug Stull
Committed by
Shinya Maeda
Mar 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add buy ci minutes notification on dropdown
- prepping for experiment
parent
48c93b93
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
72 additions
and
0 deletions
+72
-0
app/assets/stylesheets/framework/header.scss
app/assets/stylesheets/framework/header.scss
+1
-0
app/views/layouts/header/_current_user_dropdown.html.haml
app/views/layouts/header/_current_user_dropdown.html.haml
+1
-0
ee/app/helpers/ee/runners_helper.rb
ee/app/helpers/ee/runners_helper.rb
+4
-0
ee/app/views/layouts/header/_buy_ci_minutes.html.haml
ee/app/views/layouts/header/_buy_ci_minutes.html.haml
+6
-0
ee/spec/helpers/ee/runners_helper_spec.rb
ee/spec/helpers/ee/runners_helper_spec.rb
+20
-0
ee/spec/views/layouts/header/_current_user_dropdown.html.haml_spec.rb
...s/layouts/header/_current_user_dropdown.html.haml_spec.rb
+31
-0
lib/gitlab/experimentation.rb
lib/gitlab/experimentation.rb
+6
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
app/assets/stylesheets/framework/header.scss
View file @
fe959906
...
...
@@ -553,6 +553,7 @@
vertical-align
:
text-top
;
}
a
.ci-minutes-emoji
gl-emoji
,
a
.trial-link
gl-emoji
{
font-size
:
$gl-font-size
;
vertical-align
:
baseline
;
...
...
app/views/layouts/header/_current_user_dropdown.html.haml
View file @
fe959906
...
...
@@ -26,6 +26,7 @@
-
if
current_user_menu?
(
:settings
)
%li
=
link_to
s_
(
"CurrentUser|Settings"
),
profile_path
,
data:
{
qa_selector:
'settings_link'
}
=
render_if_exists
'layouts/header/buy_ci_minutes'
-
if
current_user_menu?
(
:help
)
%li
.divider.d-md-none
...
...
ee/app/helpers/ee/runners_helper.rb
View file @
fe959906
...
...
@@ -15,6 +15,10 @@ module EE
message
.
join
(
' '
).
html_safe
end
def
show_buy_ci_minutes?
experiment_enabled?
(
:buy_ci_minutes_version_a
)
end
private
def
purchase_shared_runner_minutes_link
...
...
ee/app/views/layouts/header/_buy_ci_minutes.html.haml
0 → 100644
View file @
fe959906
-
return
unless
show_buy_ci_minutes?
%li
=
link_to
profile_pipeline_quota_path
,
class:
'ci-minutes-emoji'
do
=
s_
(
"CurrentUser|Buy CI minutes"
)
=
emoji_icon
(
'clock9'
)
ee/spec/helpers/ee/runners_helper_spec.rb
View file @
fe959906
...
...
@@ -138,4 +138,24 @@ describe EE::RunnersHelper do
end
end
end
describe
'.show_buy_ci_minutes?'
do
subject
{
helper
.
show_buy_ci_minutes?
}
context
'when experiment is disabled'
do
before
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:buy_ci_minutes_version_a
).
and_return
(
false
)
end
it
{
is_expected
.
to
be_falsey
}
end
context
'when experiment is enabled'
do
before
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:buy_ci_minutes_version_a
).
and_return
(
true
)
end
it
{
is_expected
.
to
be_truthy
}
end
end
end
ee/spec/views/layouts/header/_current_user_dropdown.html.haml_spec.rb
0 → 100644
View file @
fe959906
# frozen_string_literal: true
require
'spec_helper'
describe
'layouts/header/_current_user_dropdown'
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:need_minutes
)
{
true
}
before
do
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
view
).
to
receive
(
:show_buy_ci_minutes?
).
and_return
(
need_minutes
)
render
end
subject
{
rendered
}
context
'when ci minutes need bought'
do
it
'has "Buy CI minutes" link'
do
expect
(
subject
).
to
have_link
(
'Buy CI minutes'
)
end
end
context
'when ci minutes do not need bought'
do
let
(
:need_minutes
)
{
false
}
it
'has no "Buy CI minutes" link'
do
expect
(
subject
).
not_to
have_link
(
'Buy CI minutes'
)
end
end
end
lib/gitlab/experimentation.rb
View file @
fe959906
...
...
@@ -34,6 +34,12 @@ module Gitlab
environment:
::
Gitlab
.
dev_env_or_com?
,
enabled_ratio:
0.1
,
tracking_category:
'Growth::Expansion::Experiment::CiNotificationDot'
},
buy_ci_minutes_version_a:
{
feature_toggle: :buy_ci_minutes_version_a
,
environment:
::
Gitlab
.
dev_env_or_com?
,
enabled_ratio:
0.2
,
tracking_category:
'Growth::Expansion::Experiment::BuyCiMinutesVersionA'
}
}.
freeze
...
...
locale/gitlab.pot
View file @
fe959906
...
...
@@ -5992,6 +5992,9 @@ msgstr ""
msgid "Current vulnerabilities count"
msgstr ""
msgid "CurrentUser|Buy CI minutes"
msgstr ""
msgid "CurrentUser|Profile"
msgstr ""
...
...
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