Commit cef5b4f1 authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets

Merge branch 'jswain_add_renewal_link_to_expiration_banner' into 'master'

Add license FAQ link to license expired message

See merge request gitlab-org/gitlab!23835
parents e178d5e5 b48fe2d8
---
title: Add license FAQ link to license expired message
merge_request:
author:
type: added
...@@ -48,6 +48,13 @@ module LicenseHelper ...@@ -48,6 +48,13 @@ module LicenseHelper
message << 'service.' message << 'service.'
end end
unless is_trial
renewal_faq_url = 'https://about.gitlab.com/pricing/licensing-faq/#self-managed-gitlab'
renewal_faq_link_start = "<a href='#{renewal_faq_url}' target='_blank'>".html_safe
link_end = '</a>'.html_safe
message << _('For renewal instructions %{link_start}view our Licensing FAQ.%{link_end}') % { link_start: renewal_faq_link_start, link_end: link_end }
end
message.join(' ').html_safe message.join(' ').html_safe
end end
......
...@@ -9,6 +9,32 @@ describe LicenseHelper do ...@@ -9,6 +9,32 @@ describe LicenseHelper do
end end
describe '#license_message' do describe '#license_message' do
context 'license installed' do
subject { license_message(signed_in: true, is_admin: false) }
let(:license) { double('License') }
let(:faq_link_regex) { /For renewal instructions <a href.*>view our Licensing FAQ\.<\/a>/ }
before do
allow(License).to receive(:current).and_return(license)
allow(license).to receive(:notify_users?).and_return(true)
allow(license).to receive(:expired?).and_return(false)
allow(license).to receive(:remaining_days).and_return(4)
end
it 'does NOT have a license faq link if license is a trial' do
allow(license).to receive(:trial?).and_return(true)
expect(subject).not_to match(faq_link_regex)
end
it 'has license faq link if license is not a trial' do
allow(license).to receive(:trial?).and_return(false)
expect(subject).to match(faq_link_regex)
end
end
context 'no license installed' do context 'no license installed' do
before do before do
allow(License).to receive(:current).and_return(nil) allow(License).to receive(:current).and_return(nil)
......
...@@ -8450,6 +8450,9 @@ msgstr "" ...@@ -8450,6 +8450,9 @@ msgstr ""
msgid "For public projects, anyone can view pipelines and access job details (output logs and artifacts)" msgid "For public projects, anyone can view pipelines and access job details (output logs and artifacts)"
msgstr "" msgstr ""
msgid "For renewal instructions %{link_start}view our Licensing FAQ.%{link_end}"
msgstr ""
msgid "Forgot your password?" msgid "Forgot your password?"
msgstr "" 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