Commit 6bc6bc5d authored by Mark Florian's avatar Mark Florian

Merge branch '221063-dot-notification-subtext' into 'master'

Add buy pipelines link subtext

See merge request gitlab-org/gitlab!34305
parents fc4d4d5f 107314d0
- return unless show_buy_pipeline_minutes?(project, namespace)
- link_text = s_("CurrentUser|Buy Pipeline minutes")
- link_emoji = emoji_icon('clock9', 'aria-hidden': true)
%li
= link_to profile_usage_quotas_path,
class: 'ci-minutes-emoji js-buy-pipeline-minutes-link',
data: { 'track-event': 'click_buy_ci_minutes', 'track-label': current_user.namespace.actual_plan_name, 'track-property': 'user_dropdown' } do
= s_("CurrentUser|Buy Pipeline minutes")
= emoji_icon('clock9', 'aria-hidden': true)
- if show_pipeline_minutes_notification_dot?(project, namespace)
.gl-pb-2
= link_text
= link_emoji
%span.small.gl-pb-3.gl-text-orange-800
= s_("CurrentUser|One of your groups is running out")
- else
= link_text
= link_emoji
......@@ -7,11 +7,13 @@ RSpec.describe 'layouts/header/_current_user_dropdown' do
describe 'Buy Pipeline Minutes link in user dropdown' do
let(:need_minutes) { true }
let(:show_notification_dot) { false }
before do
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:show_upgrade_link?).and_return(false)
allow(view).to receive(:show_buy_pipeline_minutes?).and_return(need_minutes)
allow(view).to receive(:show_pipeline_minutes_notification_dot?).and_return(show_notification_dot)
render
end
......@@ -24,6 +26,16 @@ RSpec.describe 'layouts/header/_current_user_dropdown' do
expect(subject).to have_selector("[data-track-label='#{user.namespace.actual_plan_name}']")
expect(subject).to have_selector('[data-track-property="user_dropdown"]')
expect(subject).to have_link('Buy Pipeline minutes')
expect(subject).not_to have_content('One of your groups is running out')
end
end
context 'when pipeline minutes need bought and there is a notification dot' do
let(:show_notification_dot) { true }
it 'has "Buy Pipeline minutes" link with correct text', :aggregate_failures do
expect(subject).to have_link('Buy Pipeline minutes')
expect(subject).to have_content('One of your groups is running out')
end
end
......
......@@ -6783,6 +6783,9 @@ msgstr ""
msgid "CurrentUser|Buy Pipeline minutes"
msgstr ""
msgid "CurrentUser|One of your groups is running out"
msgstr ""
msgid "CurrentUser|Profile"
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment