Commit aaeecb01 authored by Angelo Gulina's avatar Angelo Gulina Committed by Etienne Baqué

Expose Customers Portal URL to Vue app

parent 994d1ad6
...@@ -54,11 +54,12 @@ module LicenseHelper ...@@ -54,11 +54,12 @@ module LicenseHelper
def cloud_license_view_data def cloud_license_view_data
{ {
has_active_license: (has_active_license? ? 'true' : 'false'),
free_trial_path: new_trial_url,
buy_subscription_path: ::EE::SUBSCRIPTIONS_PLANS_URL, buy_subscription_path: ::EE::SUBSCRIPTIONS_PLANS_URL,
subscription_sync_path: sync_seat_link_admin_license_path, customers_portal_url: ::EE::SUBSCRIPTIONS_MANAGE_URL,
license_upload_path: new_admin_license_path free_trial_path: new_trial_url,
has_active_license: (has_active_license? ? 'true' : 'false'),
license_upload_path: new_admin_license_path,
subscription_sync_path: sync_seat_link_admin_license_path
} }
end end
......
...@@ -6,6 +6,7 @@ module EE ...@@ -6,6 +6,7 @@ module EE
SUBSCRIPTIONS_GRAPHQL_URL = "#{SUBSCRIPTIONS_URL}/graphql" SUBSCRIPTIONS_GRAPHQL_URL = "#{SUBSCRIPTIONS_URL}/graphql"
SUBSCRIPTIONS_MORE_MINUTES_URL = "#{SUBSCRIPTIONS_URL}/buy_pipeline_minutes" SUBSCRIPTIONS_MORE_MINUTES_URL = "#{SUBSCRIPTIONS_URL}/buy_pipeline_minutes"
SUBSCRIPTIONS_MORE_STORAGE_URL = "#{SUBSCRIPTIONS_URL}/buy_storage" SUBSCRIPTIONS_MORE_STORAGE_URL = "#{SUBSCRIPTIONS_URL}/buy_storage"
SUBSCRIPTIONS_MANAGE_URL = "#{SUBSCRIPTIONS_URL}/subscriptions"
SUBSCRIPTIONS_PLANS_URL = "#{SUBSCRIPTIONS_URL}/plans" SUBSCRIPTIONS_PLANS_URL = "#{SUBSCRIPTIONS_URL}/plans"
SUBSCRIPTION_PORTAL_ADMIN_EMAIL = ENV.fetch('SUBSCRIPTION_PORTAL_ADMIN_EMAIL', 'gl_com_api@gitlab.com') SUBSCRIPTION_PORTAL_ADMIN_EMAIL = ENV.fetch('SUBSCRIPTION_PORTAL_ADMIN_EMAIL', 'gl_com_api@gitlab.com')
SUBSCRIPTION_PORTAL_ADMIN_TOKEN = ENV.fetch('SUBSCRIPTION_PORTAL_ADMIN_TOKEN', 'customer_admin_token') SUBSCRIPTION_PORTAL_ADMIN_TOKEN = ENV.fetch('SUBSCRIPTION_PORTAL_ADMIN_TOKEN', 'customer_admin_token')
......
...@@ -81,6 +81,7 @@ RSpec.describe LicenseHelper do ...@@ -81,6 +81,7 @@ 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_PLANS_URL', 'subscriptions_plans_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')
...@@ -93,6 +94,7 @@ RSpec.describe LicenseHelper do ...@@ -93,6 +94,7 @@ RSpec.describe LicenseHelper do
allow(License).to receive(:current).and_return(license) allow(License).to receive(:current).and_return(license)
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',
free_trial_path: 'new_trial_url', free_trial_path: 'new_trial_url',
buy_subscription_path: 'subscriptions_plans_url', buy_subscription_path: 'subscriptions_plans_url',
subscription_sync_path: sync_seat_link_admin_license_path, subscription_sync_path: sync_seat_link_admin_license_path,
...@@ -105,6 +107,7 @@ RSpec.describe LicenseHelper do ...@@ -105,6 +107,7 @@ RSpec.describe LicenseHelper do
allow(License).to receive(:current).and_return(nil) allow(License).to receive(:current).and_return(nil)
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',
free_trial_path: 'new_trial_url', free_trial_path: 'new_trial_url',
buy_subscription_path: 'subscriptions_plans_url', buy_subscription_path: 'subscriptions_plans_url',
subscription_sync_path: sync_seat_link_admin_license_path, subscription_sync_path: sync_seat_link_admin_license_path,
......
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