Commit 6c0f5fac authored by Mark Chao's avatar Mark Chao

Merge branch 'dz/330988-expiration-banner' into 'master'

Change wording for expired message

See merge request gitlab-org/gitlab!69454
parents bb795d56 831c4e21
......@@ -8,18 +8,19 @@
= sprite_icon('close', css_class: 'gl-icon js-close')
.gl-display-flex.gl-flex-direction-row.gl-align-items-center
.gl-pr-6.gl-pl-5.gl-pt-3.gl-display-none.gl-sm-display-block
- if subscribable.expired?
- if subscribable.block_changes?
= image_tag('illustrations/subscription-downgraded.svg')
- else
= image_tag('illustrations/subscription-cancelled.svg')
- if subscribable.block_changes?
= image_tag('illustrations/subscription-cancelled.svg')
- elsif subscribable.expired?
= image_tag('illustrations/subscription-downgraded.svg')
- else
= image_tag('illustrations/subscription-warning.svg')
.gl-text-left.gl-pt-3
= message
- if subscribable.block_changes?
= link_to _('Upgrade your plan'), upgrade_subscription_path, class: 'btn gl-button btn-confirm', data: { track_action: 'click_text', track_label: 'subscribable_action', track_property: 'upgrade' }
= link_to s_('Subscription|Renew your subscription'), renew_subscription_path, class: 'btn gl-button btn-confirm gl-mr-3 gl-mb-2', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'renew' }
- elsif subscribable.expired?
= link_to _('Upgrade your plan'), upgrade_subscription_path, class: 'btn gl-button btn-confirm', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'upgrade' }
- else
= link_to _('Renew subscription'), renew_subscription_path, class: 'btn gl-button btn-confirm gl-mr-3 gl-mb-2', data: { track_action: 'click_text', track_label: 'subscribable_action', track_property: 'renew' }
= link_to _("That's OK, I don't want to renew"), '#', data: { track_action: 'click_text', track_label: 'subscribable_action', track_property: 'thats_ok' }, 'aria-label' => 'Dismiss', class: 'btn gl-button btn-info btn-info-secondary js-close gl-mb-2'
= link_to _('Renew subscription'), renew_subscription_path, class: 'btn gl-button btn-confirm gl-mr-3 gl-mb-2', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'renew' }
= link_to _("That's OK, I don't want to renew"), '#', data: { track_event: 'click_text', track_label: 'subscribable_action', track_property: 'thats_ok' }, 'aria-label' => 'Dismiss', class: 'btn gl-button btn-info btn-info-secondary js-close gl-mb-2'
......@@ -40,12 +40,8 @@ module Gitlab
end
def expired_subject
if show_downgrade_messaging? && namespace
if auto_renew
_('Something went wrong with your automatic subscription renewal.')
else
_('Your subscription has been downgraded.')
end
if namespace && auto_renew
_('Something went wrong with your automatic subscription renewal.')
else
_('Your subscription expired!')
end
......@@ -89,7 +85,11 @@ module Gitlab
_('We tried to automatically renew your subscription for %{strong}%{namespace_name}%{strong_close} on %{expires_on} but something went wrong so your subscription was downgraded to the free plan. Don\'t worry, your data is safe. We suggest you check your payment method and get in touch with our support team (%{support_link}). They\'ll gladly help with your subscription renewal.') % { strong: strong, strong_close: strong_close, namespace_name: namespace.name, support_link: support_link, expires_on: expires_at_or_cutoff_at.strftime("%Y-%m-%d") }
else
_('You didn\'t renew your subscription for %{strong}%{namespace_name}%{strong_close} so it was downgraded to the free plan.') % { strong: strong, strong_close: strong_close, namespace_name: namespace.name }
pricing_url = 'https://about.gitlab.com/pricing/'
pricing_link_start = '<a href="%{url}">'.html_safe % { url: pricing_url }
support_email = '<a href="mailto:support@gitlab.com">support@gitlab.com</a>'.html_safe
s_('Subscription|Your subscription for %{strong}%{namespace_name}%{strong_close} has expired and you are now on %{pricing_link_start}the GitLab Free tier%{pricing_link_end}. Don\'t worry, your data is safe. Get in touch with our support team (%{support_email}). They\'ll gladly help with your subscription renewal.') % { strong: strong, strong_close: strong_close, support_email: support_email, pricing_link_start: pricing_link_start, pricing_link_end: '</a>'.html_safe, namespace_name: namespace.name }
end
end
......
......@@ -123,7 +123,7 @@ RSpec.describe Gitlab::ExpiringSubscriptionMessage do
end
it 'has an expiration blocking message' do
expect(subject).to include("You didn't renew your subscription for No Limit Records so it was downgraded to the free plan")
expect(subject).to include("Your subscription for No Limit Records has expired and you are now on the GitLab Free tier. Don't worry, your data is safe. Get in touch with our support team (support@gitlab.com). They'll gladly help with your subscription renewal.")
end
context 'is auto_renew' do
......
......@@ -14,19 +14,28 @@ RSpec.describe 'layouts/header/_ee_subscribable_banner' do
end
shared_examples 'displays the correct link' do
context "when license is expiring" do
let(:license) { build(:gitlab_license, expires_at: Date.current + 1.week) }
it 'shows both renew and dismiss links' do
expect(rendered).to have_link 'Renew subscription', href: view.renew_subscription_path
expect(rendered).to have_link "That's OK, I don't want to renew", href: '#'
end
end
context "when license has expired" do
let(:license) { build(:gitlab_license, expires_at: Date.current - 1.week) }
it 'shows the renew plan link' do
expect(rendered).to have_link 'Renew subscription', href: view.renew_subscription_path
it 'shows the upgrade plan link' do
expect(rendered).to have_link 'Upgrade your plan', href: view.upgrade_subscription_path
end
end
context "when license blocks changes" do
let(:license) { build(:gitlab_license, expires_at: Date.current - 3.weeks) }
context "when license blocks changes" do
let(:license) { build(:gitlab_license, expires_at: Date.current - 3.weeks) }
it 'shows the upgrade plan link' do
expect(rendered).to have_link 'Upgrade your plan', href: view.upgrade_subscription_path
end
it 'shows the renew plan link' do
expect(rendered).to have_link 'Renew your subscription', href: view.renew_subscription_path
end
end
end
......
......@@ -32501,6 +32501,12 @@ msgstr ""
msgid "Subscriptions"
msgstr ""
msgid "Subscription|Renew your subscription"
msgstr ""
msgid "Subscription|Your subscription for %{strong}%{namespace_name}%{strong_close} has expired and you are now on %{pricing_link_start}the GitLab Free tier%{pricing_link_end}. Don't worry, your data is safe. Get in touch with our support team (%{support_email}). They'll gladly help with your subscription renewal."
msgstr ""
msgid "Subtracted"
msgstr ""
......@@ -38632,9 +38638,6 @@ msgstr ""
msgid "You could not create a new trigger."
msgstr ""
msgid "You didn't renew your subscription for %{strong}%{namespace_name}%{strong_close} so it was downgraded to the free plan."
msgstr ""
msgid "You do not have any subscriptions yet"
msgstr ""
......@@ -39223,9 +39226,6 @@ msgstr ""
msgid "Your subscription expired!"
msgstr ""
msgid "Your subscription has been downgraded."
msgstr ""
msgid "Your subscription will expire in %{remaining_days} day."
msgid_plural "Your subscription will expire in %{remaining_days} days."
msgstr[0] ""
......
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