Commit 376d5f9a authored by Diana Zubova's avatar Diana Zubova Committed by Igor Drozdov

Exchange buy_ci_minutes links

parent cdeccbce
- link = buy_minutes_subscriptions_url(selected_group: @namespace.id)
%p %p
- name_link = link_to @namespace.name, group_url(@namespace) - name_link = link_to @namespace.name, group_url(@namespace)
= html_escape(_('%{name_with_link} namespace has run out of Shared Runner Pipeline minutes. No new jobs or pipelines in its projects will run.')) % { name_with_link: name_link.html_safe } = html_escape(_('%{name_with_link} namespace has run out of Shared Runner Pipeline minutes. No new jobs or pipelines in its projects will run.')) % { name_with_link: name_link.html_safe }
%p %p
= _('We recommend that you buy additional Pipeline minutes to resume normal service.') = _('We recommend that you buy additional Pipeline minutes to resume normal service.')
%p %p
#{link_to('Buy more Pipeline minutes →', EE::SUBSCRIPTIONS_MORE_MINUTES_URL)} = link_to sprintf('%{link_label} →', { link_label: _('Buy more Pipeline minutes') }), link
...@@ -2,5 +2,4 @@ ...@@ -2,5 +2,4 @@
<%= _('We recommend that you buy additional Pipeline minutes to resume normal service.') %> <%= _('We recommend that you buy additional Pipeline minutes to resume normal service.') %>
<%= _('Buy more Pipeline minutes') %><%= buy_minutes_subscriptions_url(selected_group: @namespace.id) %>
Buy more Pipeline minutes → <%= EE::SUBSCRIPTIONS_MORE_MINUTES_URL %>
- link = buy_minutes_subscriptions_url(selected_group: @namespace.id)
%p %p
- name_link = link_to @namespace.name, group_url(@namespace) - name_link = link_to @namespace.name, group_url(@namespace)
= html_escape(_('%{name_with_link} namespace has %{percent} or less Shared Runner Pipeline minutes remaining. Once it runs out, no new jobs or pipelines in its projects will run.')) % { name_with_link: name_link.html_safe, percent: "#{@percentage_of_available_mins}%" } = html_escape(_('%{name_with_link} namespace has %{percent} or less Shared Runner Pipeline minutes remaining. Once it runs out, no new jobs or pipelines in its projects will run.')) % { name_with_link: name_link.html_safe, percent: "#{@percentage_of_available_mins}%" }
%p %p
= _('We recommend that you buy additional Pipeline minutes to avoid any interruption of service.') = _('We recommend that you buy additional Pipeline minutes to avoid any interruption of service.')
%p %p
#{link_to('Buy more Pipeline minutes →', EE::SUBSCRIPTIONS_MORE_MINUTES_URL)} = link_to sprintf('%{link_label} →', { link_label: _('Buy more Pipeline minutes') }), link
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
<%= _('We recommend that you buy additional Pipeline minutes to avoid any interruption of service.') %> <%= _('We recommend that you buy additional Pipeline minutes to avoid any interruption of service.') %>
Buy more Pipeline minutes → <%= EE::SUBSCRIPTIONS_MORE_MINUTES_URL %> <%= _('Buy more Pipeline minutes') %><%= buy_minutes_subscriptions_url(selected_group: @namespace.id) %>
- notification = ::Ci::Minutes::Notification.new(local_assigns.dig(:project), local_assigns.dig(:namespace)) - notification = ::Ci::Minutes::Notification.new(local_assigns.dig(:project), local_assigns.dig(:namespace))
- namespace ||= project.namespace
- return unless notification.show?(current_user, cookies) - return unless notification.show?(current_user, cookies)
%div{ class: [(classes if defined? classes)] } %div{ class: [(classes if defined? classes)] }
.shared-runner-quota-message.gl-pt-5.gl-pb-3 .shared-runner-quota-message.gl-pt-5.gl-pb-3
.js-vue-alert{ 'v-cloak': true, data: { variant: notification.style, .js-vue-alert{ 'v-cloak': true, data: { variant: notification.style,
primary_button_text: _('Buy more Pipeline minutes'), primary_button_text: _('Buy more Pipeline minutes'),
primary_button_link: ::EE::SUBSCRIPTIONS_MORE_MINUTES_URL, primary_button_link: buy_additional_minutes_path(namespace),
dismissible: 'true', dismissible: 'true',
dismiss_cookie_name: notification.dismiss_cookie_id, dismiss_cookie_name: notification.dismiss_cookie_id,
dismiss_cookie_expire: 30 } } dismiss_cookie_expire: 30 } }
......
...@@ -167,7 +167,7 @@ RSpec.describe 'CI shared runner limits' do ...@@ -167,7 +167,7 @@ RSpec.describe 'CI shared runner limits' do
page.within('.shared-runner-quota-message') do page.within('.shared-runner-quota-message') do
expect(page).to have_content(message) expect(page).to have_content(message)
expect(page).to have_link 'Buy more Pipeline minutes' expect(page).to have_link 'Buy more Pipeline minutes', href: buy_minutes_subscriptions_path(selected_group: group.id)
end end
end end
......
...@@ -13,6 +13,7 @@ RSpec.describe CiMinutesUsageMailer do ...@@ -13,6 +13,7 @@ RSpec.describe CiMinutesUsageMailer do
it { is_expected.to bcc_to recipients } it { is_expected.to bcc_to recipients }
it { is_expected.to have_body_text "#{group_path namespace}" } it { is_expected.to have_body_text "#{group_path namespace}" }
it { is_expected.to have_body_text body_text } it { is_expected.to have_body_text body_text }
it { is_expected.to have_body_text "#{buy_minutes_subscriptions_url(selected_group: namespace.id)}" }
end end
describe '#notify' do describe '#notify' do
......
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