Commit b0610d12 authored by Phil Hughes's avatar Phil Hughes

Merge branch '332838_change_route_for_cloud_licenses_in_admin_area' into 'master'

Change Admin controller CloudLicenses to Subscriptions

See merge request gitlab-org/gitlab!64000
parents d9a473cd e722d377
......@@ -3,7 +3,7 @@ import VueApollo from 'vue-apollo';
import { helpPagePath } from '~/helpers/help_page_helper';
import createDefaultClient from '~/lib/graphql';
import { parseBoolean } from '~/lib/utils/common_utils';
import CloudLicenseShowApp from '../components/app.vue';
import CloudLicenseShowApp from './components/app.vue';
Vue.use(VueApollo);
......@@ -17,7 +17,7 @@ const apolloProvider = new VueApollo({
});
export default () => {
const el = document.getElementById('js-show-cloud-license-page');
const el = document.getElementById('js-show-subscription-page');
if (!el) {
return null;
......
import initShowCloudLicense from './mount_cloud_licenses';
initShowCloudLicense();
import { initQrtlyReconciliationAlert } from 'ee/admin/init_qrtly_reconciliation_alert';
import { initQrtlyReconciliationAlert } from 'ee/admin/qrtly_reconciliation_alert/init_qrtly_reconciliation_alert';
initQrtlyReconciliationAlert();
import { initQrtlyReconciliationAlert } from 'ee/admin/init_qrtly_reconciliation_alert';
import { initQrtlyReconciliationAlert } from 'ee/admin/qrtly_reconciliation_alert/init_qrtly_reconciliation_alert';
initQrtlyReconciliationAlert();
import initShowCloudLicense from 'ee/admin/subscriptions/show/mount_cloud_licenses';
initShowCloudLicense();
......@@ -82,7 +82,7 @@ class Admin::LicensesController < Admin::ApplicationController
end
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
def license_params
......
# frozen_string_literal: true
class Admin::CloudLicensesController < Admin::ApplicationController
class Admin::SubscriptionsController < Admin::ApplicationController
respond_to :html
feature_category :license
......
......@@ -3,7 +3,7 @@
module Admin
module NavbarHelper
def navbar_controller_path
cloud_license_enabled? ? 'admin/cloud_licenses' : 'admin/licenses'
cloud_license_enabled? ? 'admin/subscriptions' : 'admin/licenses'
end
def navbar_item_name
......@@ -11,7 +11,7 @@ module Admin
end
def navbar_item_path
cloud_license_enabled? ? admin_cloud_license_path : admin_license_path
cloud_license_enabled? ? admin_subscription_path : admin_license_path
end
private
......
- 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
resource :usage_export, controller: 'licenses/usage_exports', only: [:show]
end
resource :cloud_license, only: [:show]
resource :subscription, only: [:show]
# using `only: []` to keep duplicate routes from being created
resource :application_settings, only: [] do
......
......@@ -103,7 +103,7 @@ RSpec.describe Admin::LicensesController do
get :show
expect(response).to redirect_to(admin_cloud_license_path)
expect(response).to redirect_to(admin_subscription_path)
end
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe 'Admin views Cloud License', :js do
RSpec.describe 'Admin views Subscription', :js do
let_it_be(:admin) { create(:admin) }
before do
......@@ -16,7 +16,7 @@ RSpec.describe 'Admin views Cloud License', :js do
context 'with a cloud license only' do
before do
visit(admin_cloud_license_path)
visit(admin_subscription_path)
end
it 'displays the subscription details' 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) }
before do
visit(admin_cloud_license_path)
visit(admin_subscription_path)
end
context 'when removing the a legacy license' do
......@@ -108,7 +108,7 @@ RSpec.describe 'Admin views Cloud License', :js do
before do
allow(License).to receive(:current).and_return(license)
visit(admin_cloud_license_path)
visit(admin_subscription_path)
end
it 'displays a message signaling there is not active subscription' do
......
import { GlAlert } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import Cookie from 'js-cookie';
import QrtlyReconciliationAlert from 'ee/admin/components/qrtly_reconciliation_alert.vue';
import QrtlyReconciliationAlert from 'ee/admin/qrtly_reconciliation_alert/components/qrtly_reconciliation_alert.vue';
jest.mock('js-cookie', () => ({
set: jest.fn(),
......
import { createLocalVue, shallowMount } from '@vue/test-utils';
import VueApollo from 'vue-apollo';
import SubscriptionManagementApp from 'ee/pages/admin/cloud_licenses/components/app.vue';
import SubscriptionActivationCard from 'ee/pages/admin/cloud_licenses/components/subscription_activation_card.vue';
import SubscriptionBreakdown from 'ee/pages/admin/cloud_licenses/components/subscription_breakdown.vue';
import SubscriptionManagementApp from 'ee/admin/subscriptions/show/components/app.vue';
import SubscriptionActivationCard from 'ee/admin/subscriptions/show/components/subscription_activation_card.vue';
import SubscriptionBreakdown from 'ee/admin/subscriptions/show/components/subscription_breakdown.vue';
import {
noActiveSubscription,
subscriptionActivationNotificationText,
subscriptionHistoryQueries,
subscriptionMainTitle,
subscriptionQueries,
} from 'ee/pages/admin/cloud_licenses/constants';
} from 'ee/admin/subscriptions/show/constants';
import createMockApollo from 'helpers/mock_apollo_helper';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import { license, subscriptionHistory } from '../mock_data';
......
......@@ -2,12 +2,12 @@ import { GlCard, GlSprintf } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import SubscriptionActivationCard, {
activateSubscriptionUrl,
} from 'ee/pages/admin/cloud_licenses/components/subscription_activation_card.vue';
import SubscriptionActivationErrors from 'ee/pages/admin/cloud_licenses/components/subscription_activation_errors.vue';
} from 'ee/admin/subscriptions/show/components/subscription_activation_card.vue';
import SubscriptionActivationErrors from 'ee/admin/subscriptions/show/components/subscription_activation_errors.vue';
import SubscriptionActivationForm, {
SUBSCRIPTION_ACTIVATION_FAILURE_EVENT,
} from 'ee/pages/admin/cloud_licenses/components/subscription_activation_form.vue';
import { CONNECTIVITY_ERROR, uploadLicenseFile } from 'ee/pages/admin/cloud_licenses/constants';
} from 'ee/admin/subscriptions/show/components/subscription_activation_form.vue';
import { CONNECTIVITY_ERROR, uploadLicenseFile } from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
describe('CloudLicenseApp', () => {
......
......@@ -3,7 +3,7 @@ import { shallowMount } from '@vue/test-utils';
import SubscriptionActivationErrors, {
subscriptionActivationHelpLink,
troubleshootingHelpLink,
} from 'ee/pages/admin/cloud_licenses/components/subscription_activation_errors.vue';
} from 'ee/admin/subscriptions/show/components/subscription_activation_errors.vue';
import {
CONNECTIVITY_ERROR,
generalActivationErrorMessage,
......@@ -11,7 +11,7 @@ import {
invalidActivationCode,
INVALID_CODE_ERROR,
supportLink,
} from 'ee/pages/admin/cloud_licenses/constants';
} from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
describe('SubscriptionActivationErrors', () => {
......
......@@ -4,13 +4,13 @@ import VueApollo from 'vue-apollo';
import SubscriptionActivationForm, {
SUBSCRIPTION_ACTIVATION_FAILURE_EVENT,
SUBSCRIPTION_ACTIVATION_SUCCESS_EVENT,
} from 'ee/pages/admin/cloud_licenses/components/subscription_activation_form.vue';
} from 'ee/admin/subscriptions/show/components/subscription_activation_form.vue';
import {
CONNECTIVITY_ERROR,
fieldRequiredMessage,
INVALID_CODE_ERROR,
subscriptionQueries,
} from 'ee/pages/admin/cloud_licenses/constants';
} from 'ee/admin/subscriptions/show/constants';
import createMockApollo from 'helpers/mock_apollo_helper';
import { stubComponent } from 'helpers/stub_component';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
......
import { GlModal } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import SubscriptionActivationErrors from 'ee/pages/admin/cloud_licenses/components/subscription_activation_errors.vue';
import SubscriptionActivationErrors from 'ee/admin/subscriptions/show/components/subscription_activation_errors.vue';
import SubscriptionActivationForm, {
SUBSCRIPTION_ACTIVATION_FAILURE_EVENT,
SUBSCRIPTION_ACTIVATION_SUCCESS_EVENT,
} from 'ee/pages/admin/cloud_licenses/components/subscription_activation_form.vue';
import SubscriptionActivationModal from 'ee/pages/admin/cloud_licenses/components/subscription_activation_modal.vue';
} from 'ee/admin/subscriptions/show/components/subscription_activation_form.vue';
import SubscriptionActivationModal from 'ee/admin/subscriptions/show/components/subscription_activation_modal.vue';
import {
activateSubscription,
CONNECTIVITY_ERROR,
subscriptionActivationInsertCode,
} from 'ee/pages/admin/cloud_licenses/constants';
} from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import { preventDefault } from '../../test_helpers';
......
......@@ -2,24 +2,24 @@ import { GlCard } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import AxiosMockAdapter from 'axios-mock-adapter';
import { nextTick } from 'vue';
import SubscriptionActivationModal from 'ee/pages/admin/cloud_licenses/components/subscription_activation_modal.vue';
import SubscriptionActivationModal from 'ee/admin/subscriptions/show/components/subscription_activation_modal.vue';
import SubscriptionBreakdown, {
licensedToFields,
modalId,
subscriptionDetailsFields,
} from 'ee/pages/admin/cloud_licenses/components/subscription_breakdown.vue';
import SubscriptionDetailsCard from 'ee/pages/admin/cloud_licenses/components/subscription_details_card.vue';
import SubscriptionDetailsHistory from 'ee/pages/admin/cloud_licenses/components/subscription_details_history.vue';
import SubscriptionDetailsUserInfo from 'ee/pages/admin/cloud_licenses/components/subscription_details_user_info.vue';
} from 'ee/admin/subscriptions/show/components/subscription_breakdown.vue';
import SubscriptionDetailsCard from 'ee/admin/subscriptions/show/components/subscription_details_card.vue';
import SubscriptionDetailsHistory from 'ee/admin/subscriptions/show/components/subscription_details_history.vue';
import SubscriptionDetailsUserInfo from 'ee/admin/subscriptions/show/components/subscription_details_user_info.vue';
import SubscriptionSyncNotifications, {
SUCCESS_ALERT_DISMISSED_EVENT,
} from 'ee/pages/admin/cloud_licenses/components/subscription_sync_notifications.vue';
} from 'ee/admin/subscriptions/show/components/subscription_sync_notifications.vue';
import {
licensedToHeaderText,
subscriptionSyncStatus,
subscriptionDetailsHeaderText,
subscriptionTypes,
} from 'ee/pages/admin/cloud_licenses/constants';
} from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises';
import axios from '~/lib/utils/axios_utils';
......
import { GlCard } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import { subscriptionDetailsFields } from 'ee/pages/admin/cloud_licenses/components/subscription_breakdown.vue';
import SubscriptionDetailsCard from 'ee/pages/admin/cloud_licenses/components/subscription_details_card.vue';
import SubscriptionDetailsTable from 'ee/pages/admin/cloud_licenses/components/subscription_details_table.vue';
import { subscriptionDetailsFields } from 'ee/admin/subscriptions/show/components/subscription_breakdown.vue';
import SubscriptionDetailsCard from 'ee/admin/subscriptions/show/components/subscription_details_card.vue';
import SubscriptionDetailsTable from 'ee/admin/subscriptions/show/components/subscription_details_table.vue';
import { useFakeDate } from 'helpers/fake_date';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import { license } from '../mock_data';
......
import { GlBadge } from '@gitlab/ui';
import { mount } from '@vue/test-utils';
import SubscriptionDetailsHistory from 'ee/pages/admin/cloud_licenses/components/subscription_details_history.vue';
import { cloudLicenseText } from 'ee/pages/admin/cloud_licenses/constants';
import SubscriptionDetailsHistory from 'ee/admin/subscriptions/show/components/subscription_details_history.vue';
import { cloudLicenseText } from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import { license, subscriptionHistory } from '../mock_data';
......
import { GlSkeletonLoader } from '@gitlab/ui';
import { mount } from '@vue/test-utils';
import SubscriptionDetailsTable from 'ee/pages/admin/cloud_licenses/components/subscription_details_table.vue';
import { detailsLabels } from 'ee/pages/admin/cloud_licenses/constants';
import SubscriptionDetailsTable from 'ee/admin/subscriptions/show/components/subscription_details_table.vue';
import { detailsLabels } from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
......
......@@ -3,7 +3,7 @@ import { shallowMount } from '@vue/test-utils';
import SubscriptionDetailsUserInfo, {
billableUsersURL,
trueUpURL,
} from 'ee/pages/admin/cloud_licenses/components/subscription_details_user_info.vue';
} from 'ee/admin/subscriptions/show/components/subscription_details_user_info.vue';
import {
billableUsersText,
billableUsersTitle,
......@@ -13,7 +13,7 @@ import {
usersInSubscriptionTitle,
usersOverSubscriptionText,
usersOverSubscriptionTitle,
} from 'ee/pages/admin/cloud_licenses/constants';
} from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import { license } from '../mock_data';
......
import { shallowMount } from '@vue/test-utils';
import SubscriptionPurchaseCard from 'ee/pages/admin/cloud_licenses/components/subscription_purchase_card.vue';
import { buySubscriptionCard } from 'ee/pages/admin/cloud_licenses/constants';
import SubscriptionPurchaseCard from 'ee/admin/subscriptions/show/components/subscription_purchase_card.vue';
import { buySubscriptionCard } from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
describe('SubscriptionPurchaseCard', () => {
......
......@@ -2,12 +2,12 @@ import { GlAlert, GlLink, GlSprintf } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import SubscriptionSyncNotifications, {
SUCCESS_ALERT_DISMISSED_EVENT,
} from 'ee/pages/admin/cloud_licenses/components/subscription_sync_notifications.vue';
} from 'ee/admin/subscriptions/show/components/subscription_sync_notifications.vue';
import {
connectivityIssue,
manualSyncSuccessfulTitle,
subscriptionSyncStatus,
} from 'ee/pages/admin/cloud_licenses/constants';
} from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
describe('Subscription Sync Notifications', () => {
......
import { shallowMount } from '@vue/test-utils';
import SubscriptionTrialCard from 'ee/pages/admin/cloud_licenses/components/subscription_trial_card.vue';
import { trialCard } from 'ee/pages/admin/cloud_licenses/constants';
import SubscriptionTrialCard from 'ee/admin/subscriptions/show/components/subscription_trial_card.vue';
import { trialCard } from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
describe('SubscriptionTrialCard', () => {
......
......@@ -2,7 +2,7 @@ import {
getErrorsAsData,
getLicenseFromData,
updateSubscriptionAppCache,
} from 'ee/pages/admin/cloud_licenses/graphql/utils';
} from 'ee/admin/subscriptions/show/graphql/utils';
import { activateLicenseMutationResponse } from '../mock_data';
describe('graphQl utils', () => {
......
import { CONNECTIVITY_ERROR, subscriptionTypes } from 'ee/pages/admin/cloud_licenses/constants';
import { CONNECTIVITY_ERROR, subscriptionTypes } from 'ee/admin/subscriptions/show/constants';
export const license = {
ULTIMATE: {
......
......@@ -11,7 +11,7 @@ RSpec.describe Admin::NavbarHelper do
end
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
it 'returns the correct navbar item name' do
......@@ -19,7 +19,7 @@ RSpec.describe Admin::NavbarHelper do
end
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
......
......@@ -2,10 +2,10 @@
require 'spec_helper'
RSpec.describe Admin::CloudLicensesController, :cloud_licenses do
RSpec.describe Admin::SubscriptionsController, :cloud_licenses do
include AdminModeHelper
describe 'GET /cloud_licenses' do
describe 'GET /subscriptions' do
context 'when the user is not admin' do
let_it_be(:user) { create(:user) }
......@@ -47,13 +47,13 @@ RSpec.describe Admin::CloudLicensesController, :cloud_licenses do
send_request
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
def send_request
get admin_cloud_license_path
get admin_subscription_path
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