Commit c1cb3fe1 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'jswain_plan_specific_expired_banner_message' into 'master'

Expring Subscription banner has plan specific text

See merge request gitlab-org/gitlab!31777
parents 40085e94 92ec49ad
---
title: Expring Subscription banner has plan specific text
merge_request: 31777
author:
type: changed
...@@ -97,7 +97,24 @@ module Gitlab ...@@ -97,7 +97,24 @@ module Gitlab
if auto_renew? if auto_renew?
_('We will automatically renew your %{strong}%{plan_name}%{strong_close} subscription for %{strong}%{namespace_name}%{strong_close} on %{strong}%{expires_on}%{strong_close}. There\'s nothing that you need to do, we\'ll let you know when the renewal is complete. Need more seats, a higher plan or just want to review your payment method?') % { expires_on: subscribable.expires_at.strftime("%Y-%m-%d"), plan_name: plan_name, strong: strong, strong_close: strong_close, namespace_name: namespace.name } _('We will automatically renew your %{strong}%{plan_name}%{strong_close} subscription for %{strong}%{namespace_name}%{strong_close} on %{strong}%{expires_on}%{strong_close}. There\'s nothing that you need to do, we\'ll let you know when the renewal is complete. Need more seats, a higher plan or just want to review your payment method?') % { expires_on: subscribable.expires_at.strftime("%Y-%m-%d"), plan_name: plan_name, strong: strong, strong_close: strong_close, namespace_name: namespace.name }
else else
_('Your %{strong}%{plan_name}%{strong_close} subscription for %{strong}%{namespace_name}%{strong_close} will expire on %{strong}%{expires_on}%{strong_close}. After that, you will not to be able to create issues or merge requests as well as many other features.') % { expires_on: subscribable.expires_at.strftime("%Y-%m-%d"), plan_name: plan_name, strong: strong, strong_close: strong_close, namespace_name: namespace.name } message = []
message << _('Your %{strong}%{plan_name}%{strong_close} subscription for %{strong}%{namespace_name}%{strong_close} will expire on %{strong}%{expires_on}%{strong_close}.') % { expires_on: subscribable.expires_at.strftime("%Y-%m-%d"), plan_name: plan_name, strong: strong, strong_close: strong_close, namespace_name: namespace.name }
message << expiring_features_message
message.join(' ')
end
end
def expiring_features_message
case plan_name
when 'Gold'
_('After that, you will not to be able to use merge approvals or epics as well as many security features.')
when 'Silver'
_('After that, you will not to be able to use merge approvals or epics as well as many other features.')
else
_('After that, you will not to be able to use merge approvals or code quality as well as many other features.')
end end
end end
...@@ -116,7 +133,7 @@ module Gitlab ...@@ -116,7 +133,7 @@ module Gitlab
end end
def plan_name def plan_name
subscribable.plan.titleize @plan_name ||= subscribable.plan.titleize
end end
def strong def strong
......
...@@ -157,9 +157,27 @@ describe Gitlab::ExpiringSubscriptionMessage do ...@@ -157,9 +157,27 @@ describe Gitlab::ExpiringSubscriptionMessage do
context 'with namespace' do context 'with namespace' do
let(:namespace) { double(:namespace, name: 'No Limit Records') } let(:namespace) { double(:namespace, name: 'No Limit Records') }
it 'has an expiration blocking message' do it 'has gold plan specific messaging' do
allow(subscribable).to receive(:plan).and_return('gold')
Timecop.freeze(today) do
expect(subject).to include('Your Gold subscription for No Limit Records will expire on 2020-03-09. After that, you will not to be able to use merge approvals or epics as well as many security features.')
end
end
it 'has silver plan specific messaging' do
allow(subscribable).to receive(:plan).and_return('silver')
Timecop.freeze(today) do
expect(subject).to include('Your Silver subscription for No Limit Records will expire on 2020-03-09. After that, you will not to be able to use merge approvals or epics as well as many other features.')
end
end
it 'has bronze plan specific messaging' do
allow(subscribable).to receive(:plan).and_return('bronze')
Timecop.freeze(today) do Timecop.freeze(today) do
expect(subject).to include('Your Ultimate subscription for No Limit Records will expire on 2020-03-09. After that, you will not to be able to create issues or merge requests as well as many other features.') expect(subject).to include('Your Bronze subscription for No Limit Records will expire on 2020-03-09. After that, you will not to be able to use merge approvals or code quality as well as many other features.')
end end
end end
......
...@@ -1725,6 +1725,15 @@ msgstr "" ...@@ -1725,6 +1725,15 @@ msgstr ""
msgid "After a successful password update, you will be redirected to the login page where you can log in with your new password." msgid "After a successful password update, you will be redirected to the login page where you can log in with your new password."
msgstr "" msgstr ""
msgid "After that, you will not to be able to use merge approvals or code quality as well as many other features."
msgstr ""
msgid "After that, you will not to be able to use merge approvals or epics as well as many other features."
msgstr ""
msgid "After that, you will not to be able to use merge approvals or epics as well as many security features."
msgstr ""
msgid "Alert" msgid "Alert"
msgid_plural "Alerts" msgid_plural "Alerts"
msgstr[0] "" msgstr[0] ""
...@@ -25014,7 +25023,7 @@ msgstr "" ...@@ -25014,7 +25023,7 @@ msgstr ""
msgid "YouTube" msgid "YouTube"
msgstr "" msgstr ""
msgid "Your %{strong}%{plan_name}%{strong_close} subscription for %{strong}%{namespace_name}%{strong_close} will expire on %{strong}%{expires_on}%{strong_close}. After that, you will not to be able to create issues or merge requests as well as many other features." msgid "Your %{strong}%{plan_name}%{strong_close} subscription for %{strong}%{namespace_name}%{strong_close} will expire on %{strong}%{expires_on}%{strong_close}."
msgstr "" msgstr ""
msgid "Your %{strong}%{plan_name}%{strong_close} subscription will expire on %{strong}%{expires_on}%{strong_close}. After that, you will not to be able to create issues or merge requests as well as many other features." msgid "Your %{strong}%{plan_name}%{strong_close} subscription will expire on %{strong}%{expires_on}%{strong_close}. After that, you will not to be able to create issues or merge requests as well as many other features."
......
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