Commit 1fb1c4ae authored by Pavel Shutsin's avatar Pavel Shutsin

Merge branch '3637-clean-up-plans-code' into 'master'

Clean up usages of subscriptions plans url

See merge request gitlab-org/gitlab!78603
parents 966448af a83951a5
...@@ -56,7 +56,7 @@ module LicenseHelper ...@@ -56,7 +56,7 @@ module LicenseHelper
# EE:Self Managed # EE:Self Managed
def cloud_license_view_data def cloud_license_view_data
{ {
buy_subscription_path: ::EE::SUBSCRIPTIONS_PLANS_URL, buy_subscription_path: Gitlab::Saas.about_pricing_url,
customers_portal_url: ::EE::SUBSCRIPTIONS_MANAGE_URL, customers_portal_url: ::EE::SUBSCRIPTIONS_MANAGE_URL,
free_trial_path: new_trial_url, free_trial_path: new_trial_url,
has_active_license: (has_active_license? ? 'true' : 'false'), has_active_license: (has_active_license? ? 'true' : 'false'),
......
- if show_upgrade_link?(current_user) - if show_upgrade_link?(current_user)
%li %li
= link_to EE::SUBSCRIPTIONS_PLANS_URL, = link_to Gitlab::Saas.about_pricing_url,
class: 'upgrade-plan-link js-upgrade-plan-link', class: 'upgrade-plan-link js-upgrade-plan-link',
data: { 'track-action': 'click_upgrade_link', 'track-label': current_user.namespace.actual_plan_name, 'track-property': 'user_dropdown' } do data: { 'track-action': 'click_upgrade_link', 'track-label': current_user.namespace.actual_plan_name, 'track-property': 'user_dropdown' } do
= s_("CurrentUser|Upgrade") = s_("CurrentUser|Upgrade")
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
= s_('Promotions|When you have a lot of issues, it can be hard to get an overview. By adding a weight to your issues, you can get a better idea of the effort, cost, required time, or value of each, and so better manage them.') = s_('Promotions|When you have a lot of issues, it can be hard to get an overview. By adding a weight to your issues, you can get a better idea of the effort, cost, required time, or value of each, and so better manage them.')
%p %p
- if Gitlab::CurrentSettings.should_check_namespace_plan? - if Gitlab::CurrentSettings.should_check_namespace_plan?
- subscription_link_url = EE::SUBSCRIPTIONS_PLANS_URL - subscription_link_url = Gitlab::Saas.about_pricing_url
- subscription_link_start = '<a href="%{url}" target="_blank" class="btn-link tr-issue-weights-bronze-features-cta">'.html_safe % { url: subscription_link_url } - subscription_link_start = '<a href="%{url}" target="_blank" class="btn-link tr-issue-weights-bronze-features-cta">'.html_safe % { url: subscription_link_url }
= s_("Promotions|See the other features in the %{subscription_link_start}Premium plan%{subscription_link_end}").html_safe % { subscription_link_start: subscription_link_start, subscription_link_end: '</a>'.html_safe } = s_("Promotions|See the other features in the %{subscription_link_start}Premium plan%{subscription_link_end}").html_safe % { subscription_link_start: subscription_link_start, subscription_link_end: '</a>'.html_safe }
- else - else
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
- elsif current_user&.admin? - elsif current_user&.admin?
-# EE:Self Managed -# EE:Self Managed
- if License.current&.expired? - if License.current&.expired?
= link_to (!short_form ? s_('Promotions|Buy GitLab Enterprise Edition') : s_('Promotions|Buy EE')), ::EE::SUBSCRIPTIONS_PLANS_URL, class: 'btn gl-button btn-confirm' = link_to (!short_form ? s_('Promotions|Buy GitLab Enterprise Edition') : s_('Promotions|Buy EE')), Gitlab::Saas.about_pricing_url, class: 'btn gl-button btn-confirm'
- else - else
= link_to s_('Promotions|Start GitLab Ultimate trial'), new_trial_url, class: 'gl-button btn btn-confirm gl-mb-3' = link_to s_('Promotions|Start GitLab Ultimate trial'), new_trial_url, class: 'gl-button btn btn-confirm gl-mb-3'
- else - else
......
...@@ -7,7 +7,6 @@ module EE ...@@ -7,7 +7,6 @@ module EE
SUBSCRIPTIONS_MORE_MINUTES_URL = ::Gitlab::SubscriptionPortal.subscriptions_more_minutes_url.freeze SUBSCRIPTIONS_MORE_MINUTES_URL = ::Gitlab::SubscriptionPortal.subscriptions_more_minutes_url.freeze
SUBSCRIPTIONS_MORE_STORAGE_URL = ::Gitlab::SubscriptionPortal.subscriptions_more_storage_url.freeze SUBSCRIPTIONS_MORE_STORAGE_URL = ::Gitlab::SubscriptionPortal.subscriptions_more_storage_url.freeze
SUBSCRIPTIONS_MANAGE_URL = ::Gitlab::SubscriptionPortal.subscriptions_manage_url.freeze SUBSCRIPTIONS_MANAGE_URL = ::Gitlab::SubscriptionPortal.subscriptions_manage_url.freeze
SUBSCRIPTIONS_PLANS_URL = ::Gitlab::SubscriptionPortal.subscriptions_plans_url.freeze
SUBSCRIPTIONS_GITLAB_PLANS_URL = ::Gitlab::SubscriptionPortal.subscriptions_gitlab_plans_url.freeze SUBSCRIPTIONS_GITLAB_PLANS_URL = ::Gitlab::SubscriptionPortal.subscriptions_gitlab_plans_url.freeze
SUBSCRIPTIONS_EDIT_ACCOUNT_URL = ::Gitlab::SubscriptionPortal.edit_account_url.freeze SUBSCRIPTIONS_EDIT_ACCOUNT_URL = ::Gitlab::SubscriptionPortal.edit_account_url.freeze
SUBSCRIPTION_PORTAL_ADMIN_EMAIL = ::Gitlab::SubscriptionPortal.subscription_portal_admin_email.freeze SUBSCRIPTION_PORTAL_ADMIN_EMAIL = ::Gitlab::SubscriptionPortal.subscription_portal_admin_email.freeze
......
...@@ -82,7 +82,6 @@ RSpec.describe LicenseHelper do ...@@ -82,7 +82,6 @@ RSpec.describe LicenseHelper do
describe '#cloud_license_view_data' do describe '#cloud_license_view_data' do
before do before do
stub_const('::EE::SUBSCRIPTIONS_MANAGE_URL', 'subscriptions_manage_url') stub_const('::EE::SUBSCRIPTIONS_MANAGE_URL', 'subscriptions_manage_url')
stub_const('::EE::SUBSCRIPTIONS_PLANS_URL', 'subscriptions_plans_url')
allow(helper).to receive(:new_trial_url).and_return('new_trial_url') allow(helper).to receive(:new_trial_url).and_return('new_trial_url')
end end
...@@ -96,7 +95,7 @@ RSpec.describe LicenseHelper do ...@@ -96,7 +95,7 @@ RSpec.describe LicenseHelper do
expect(helper.cloud_license_view_data).to eq({ has_active_license: 'true', expect(helper.cloud_license_view_data).to eq({ has_active_license: 'true',
customers_portal_url: 'subscriptions_manage_url', customers_portal_url: 'subscriptions_manage_url',
free_trial_path: 'new_trial_url', free_trial_path: 'new_trial_url',
buy_subscription_path: 'subscriptions_plans_url', buy_subscription_path: Gitlab::Saas.about_pricing_url,
subscription_sync_path: sync_seat_link_admin_license_path, subscription_sync_path: sync_seat_link_admin_license_path,
license_remove_path: admin_license_path, license_remove_path: admin_license_path,
congratulation_svg_path: helper.image_path('illustrations/illustration-congratulation-purchase.svg'), congratulation_svg_path: helper.image_path('illustrations/illustration-congratulation-purchase.svg'),
...@@ -112,7 +111,7 @@ RSpec.describe LicenseHelper do ...@@ -112,7 +111,7 @@ RSpec.describe LicenseHelper do
expect(helper.cloud_license_view_data).to eq({ has_active_license: 'false', expect(helper.cloud_license_view_data).to eq({ has_active_license: 'false',
customers_portal_url: 'subscriptions_manage_url', customers_portal_url: 'subscriptions_manage_url',
free_trial_path: 'new_trial_url', free_trial_path: 'new_trial_url',
buy_subscription_path: 'subscriptions_plans_url', buy_subscription_path: Gitlab::Saas.about_pricing_url,
subscription_sync_path: sync_seat_link_admin_license_path, subscription_sync_path: sync_seat_link_admin_license_path,
license_remove_path: admin_license_path, license_remove_path: admin_license_path,
congratulation_svg_path: helper.image_path('illustrations/illustration-congratulation-purchase.svg'), congratulation_svg_path: helper.image_path('illustrations/illustration-congratulation-purchase.svg'),
......
...@@ -42,10 +42,6 @@ module Gitlab ...@@ -42,10 +42,6 @@ module Gitlab
"#{self.subscriptions_url}/subscriptions" "#{self.subscriptions_url}/subscriptions"
end end
def self.subscriptions_plans_url
Gitlab::Saas.about_pricing_url
end
def self.subscriptions_gitlab_plans_url def self.subscriptions_gitlab_plans_url
"#{self.subscriptions_url}/gitlab_plans" "#{self.subscriptions_url}/gitlab_plans"
end end
......
...@@ -61,7 +61,6 @@ RSpec.describe ::Gitlab::SubscriptionPortal do ...@@ -61,7 +61,6 @@ RSpec.describe ::Gitlab::SubscriptionPortal do
:subscriptions_more_minutes_url | 'https://customers.staging.gitlab.com/buy_pipeline_minutes' :subscriptions_more_minutes_url | 'https://customers.staging.gitlab.com/buy_pipeline_minutes'
:subscriptions_more_storage_url | 'https://customers.staging.gitlab.com/buy_storage' :subscriptions_more_storage_url | 'https://customers.staging.gitlab.com/buy_storage'
:subscriptions_manage_url | 'https://customers.staging.gitlab.com/subscriptions' :subscriptions_manage_url | 'https://customers.staging.gitlab.com/subscriptions'
:subscriptions_plans_url | 'https://about.gitlab.com/pricing/'
:subscriptions_instance_review_url | 'https://customers.staging.gitlab.com/instance_review' :subscriptions_instance_review_url | 'https://customers.staging.gitlab.com/instance_review'
:subscriptions_gitlab_plans_url | 'https://customers.staging.gitlab.com/gitlab_plans' :subscriptions_gitlab_plans_url | 'https://customers.staging.gitlab.com/gitlab_plans'
:edit_account_url | 'https://customers.staging.gitlab.com/customers/edit' :edit_account_url | 'https://customers.staging.gitlab.com/customers/edit'
......
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