Commit fda4e30c authored by Corinna Wiesner's avatar Corinna Wiesner

Change Admin controller CloudLicenses to Licenses

The Admin::CloudLicensesController is renamed to
Admin::SubscriptionsController to make its naming for neutral for the
two use cases of licenses.
parent dd89f16d
...@@ -17,7 +17,7 @@ const apolloProvider = new VueApollo({ ...@@ -17,7 +17,7 @@ const apolloProvider = new VueApollo({
}); });
export default () => { export default () => {
const el = document.getElementById('js-show-cloud-license-page'); const el = document.getElementById('js-show-subscription-page');
if (!el) { if (!el) {
return null; return null;
......
...@@ -82,7 +82,7 @@ class Admin::LicensesController < Admin::ApplicationController ...@@ -82,7 +82,7 @@ class Admin::LicensesController < Admin::ApplicationController
end end
def check_cloud_license def check_cloud_license
redirect_to admin_cloud_license_path if Gitlab::CurrentSettings.cloud_license_enabled? redirect_to admin_subscription_path if Gitlab::CurrentSettings.cloud_license_enabled?
end end
def license_params def license_params
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::CloudLicensesController < Admin::ApplicationController class Admin::SubscriptionsController < Admin::ApplicationController
respond_to :html respond_to :html
feature_category :license feature_category :license
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Admin module Admin
module NavbarHelper module NavbarHelper
def navbar_controller_path def navbar_controller_path
cloud_license_enabled? ? 'admin/cloud_licenses' : 'admin/licenses' cloud_license_enabled? ? 'admin/subscriptions' : 'admin/licenses'
end end
def navbar_item_name def navbar_item_name
...@@ -11,7 +11,7 @@ module Admin ...@@ -11,7 +11,7 @@ module Admin
end end
def navbar_item_path def navbar_item_path
cloud_license_enabled? ? admin_cloud_license_path : admin_license_path cloud_license_enabled? ? admin_subscription_path : admin_license_path
end end
private private
......
- page_title _('Subscription') - page_title _('Subscription')
#js-show-cloud-license-page{ data: cloud_license_view_data } #js-show-subscription-page{ data: cloud_license_view_data }
...@@ -33,7 +33,7 @@ namespace :admin do ...@@ -33,7 +33,7 @@ namespace :admin do
resource :usage_export, controller: 'licenses/usage_exports', only: [:show] resource :usage_export, controller: 'licenses/usage_exports', only: [:show]
end end
resource :cloud_license, only: [:show] resource :subscription, only: [:show]
# using `only: []` to keep duplicate routes from being created # using `only: []` to keep duplicate routes from being created
resource :application_settings, only: [] do resource :application_settings, only: [] do
......
...@@ -103,7 +103,7 @@ RSpec.describe Admin::LicensesController do ...@@ -103,7 +103,7 @@ RSpec.describe Admin::LicensesController do
get :show get :show
expect(response).to redirect_to(admin_cloud_license_path) expect(response).to redirect_to(admin_subscription_path)
end end
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe 'Admin views Cloud License', :js do RSpec.describe 'Admin views Subscription', :js do
let_it_be(:admin) { create(:admin) } let_it_be(:admin) { create(:admin) }
before do before do
...@@ -16,7 +16,7 @@ RSpec.describe 'Admin views Cloud License', :js do ...@@ -16,7 +16,7 @@ RSpec.describe 'Admin views Cloud License', :js do
context 'with a cloud license only' do context 'with a cloud license only' do
before do before do
visit(admin_cloud_license_path) visit(admin_subscription_path)
end end
it 'displays the subscription details' do it 'displays the subscription details' do
...@@ -51,7 +51,7 @@ RSpec.describe 'Admin views Cloud License', :js do ...@@ -51,7 +51,7 @@ RSpec.describe 'Admin views Cloud License', :js do
let!(:license) { create_current_license(cloud_licensing_enabled: false, plan: License::ULTIMATE_PLAN) } let!(:license) { create_current_license(cloud_licensing_enabled: false, plan: License::ULTIMATE_PLAN) }
before do before do
visit(admin_cloud_license_path) visit(admin_subscription_path)
end end
context 'when removing the a legacy license' do context 'when removing the a legacy license' do
...@@ -108,7 +108,7 @@ RSpec.describe 'Admin views Cloud License', :js do ...@@ -108,7 +108,7 @@ RSpec.describe 'Admin views Cloud License', :js do
before do before do
allow(License).to receive(:current).and_return(license) allow(License).to receive(:current).and_return(license)
visit(admin_cloud_license_path) visit(admin_subscription_path)
end end
it 'displays a message signaling there is not active subscription' do it 'displays a message signaling there is not active subscription' do
......
...@@ -11,7 +11,7 @@ RSpec.describe Admin::NavbarHelper do ...@@ -11,7 +11,7 @@ RSpec.describe Admin::NavbarHelper do
end end
it 'returns the correct controller path' do it 'returns the correct controller path' do
expect(helper.navbar_controller_path).to eq('admin/cloud_licenses') expect(helper.navbar_controller_path).to eq('admin/subscriptions')
end end
it 'returns the correct navbar item name' do it 'returns the correct navbar item name' do
...@@ -19,7 +19,7 @@ RSpec.describe Admin::NavbarHelper do ...@@ -19,7 +19,7 @@ RSpec.describe Admin::NavbarHelper do
end end
it 'returns the correct navbar item path' do it 'returns the correct navbar item path' do
expect(helper.navbar_item_path).to eq(admin_cloud_license_path) expect(helper.navbar_item_path).to eq(admin_subscription_path)
end end
end end
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Admin::CloudLicensesController, :cloud_licenses do RSpec.describe Admin::SubscriptionsController, :cloud_licenses do
include AdminModeHelper include AdminModeHelper
describe 'GET /cloud_licenses' do describe 'GET /subscriptions' do
context 'when the user is not admin' do context 'when the user is not admin' do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
...@@ -47,13 +47,13 @@ RSpec.describe Admin::CloudLicensesController, :cloud_licenses do ...@@ -47,13 +47,13 @@ RSpec.describe Admin::CloudLicensesController, :cloud_licenses do
send_request send_request
expect(response).to render_template(:show) expect(response).to render_template(:show)
expect(response.body).to include('js-show-cloud-license-page') expect(response.body).to include('js-show-subscription-page')
end end
end end
end end
end end
def send_request def send_request
get admin_cloud_license_path get admin_subscription_path
end end
end end
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