Commit 5dbbf551 authored by Etienne Baqué's avatar Etienne Baqué

Merge branch '348750-deprioritize-legacy-license-upload' into 'master'

Remove legacy license link from subscription page

See merge request gitlab-org/gitlab!77311
parents 7a3a4c0b 2e39fcc0
...@@ -118,3 +118,4 @@ ...@@ -118,3 +118,4 @@
= render 'admin/application_settings/snowplow' = render 'admin/application_settings/snowplow'
= render 'admin/application_settings/eks' = render 'admin/application_settings/eks'
= render 'admin/application_settings/floc' = render 'admin/application_settings/floc'
= render_if_exists 'admin/application_settings/license_file'
...@@ -50,13 +50,14 @@ If you receive a license file from GitLab (for example a new trial), you can upl ...@@ -50,13 +50,14 @@ If you receive a license file from GitLab (for example a new trial), you can upl
The first time you visit your GitLab EE installation signed in as an administrator, The first time you visit your GitLab EE installation signed in as an administrator,
you should see a note urging you to upload a license with a link that takes you you should see a note urging you to upload a license with a link that takes you
to the **Subscription** area. to the **Upload license** page.
Otherwise, to manually go to the **Subscription** area: Otherwise, to manually go to the **Upload license** page:
1. Sign in to your GitLab self-managed instance. 1. Sign in to your GitLab self-managed instance.
1. From the top menu, select the Admin Area **{admin}**. 1. From the top menu, select the Admin Area **{admin}**.
1. From the left sidebar, select **Subscription**, and select **Upload a license file**. 1. On the left sidebar, select **Settings**.
1. In the **License file** section, select **Upload a license**.
- *If you've received a `.gitlab-license` file:* - *If you've received a `.gitlab-license` file:*
1. Download the license file to your local machine. 1. Download the license file to your local machine.
......
...@@ -4,7 +4,6 @@ import { helpPagePath } from '~/helpers/help_page_helper'; ...@@ -4,7 +4,6 @@ import { helpPagePath } from '~/helpers/help_page_helper';
import { import {
activateSubscription, activateSubscription,
howToActivateSubscription, howToActivateSubscription,
uploadLicenseFile,
SUBSCRIPTION_ACTIVATION_FAILURE_EVENT, SUBSCRIPTION_ACTIVATION_FAILURE_EVENT,
SUBSCRIPTION_ACTIVATION_SUCCESS_EVENT, SUBSCRIPTION_ACTIVATION_SUCCESS_EVENT,
} from '../constants'; } from '../constants';
...@@ -20,7 +19,6 @@ export default { ...@@ -20,7 +19,6 @@ export default {
i18n: { i18n: {
activateSubscription, activateSubscription,
howToActivateSubscription, howToActivateSubscription,
uploadLicenseFile,
}, },
components: { components: {
GlCard, GlCard,
...@@ -29,7 +27,6 @@ export default { ...@@ -29,7 +27,6 @@ export default {
SubscriptionActivationErrors, SubscriptionActivationErrors,
SubscriptionActivationForm, SubscriptionActivationForm,
}, },
inject: ['licenseUploadPath'],
links: { links: {
activateSubscriptionUrl, activateSubscriptionUrl,
}, },
...@@ -79,14 +76,5 @@ export default { ...@@ -79,14 +76,5 @@ export default {
</gl-sprintf> </gl-sprintf>
</p> </p>
<subscription-activation-form class="gl-p-5" v-on="$options.activationListeners" /> <subscription-activation-form class="gl-p-5" v-on="$options.activationListeners" />
<template #footer>
<gl-link
v-if="licenseUploadPath"
data-testid="upload-license-link"
data-qa-selector="license_upload_link"
:href="licenseUploadPath"
>{{ $options.i18n.uploadLicenseFile }}
</gl-link>
</template>
</gl-card> </gl-card>
</template> </template>
...@@ -12,7 +12,6 @@ import { ...@@ -12,7 +12,6 @@ import {
subscriptionDetailsHeaderText, subscriptionDetailsHeaderText,
subscriptionTypes, subscriptionTypes,
syncSubscriptionButtonText, syncSubscriptionButtonText,
uploadLicense,
} from '../constants'; } from '../constants';
import SubscriptionActivationBanner from './subscription_activation_banner.vue'; import SubscriptionActivationBanner from './subscription_activation_banner.vue';
import SubscriptionActivationModal from './subscription_activation_modal.vue'; import SubscriptionActivationModal from './subscription_activation_modal.vue';
...@@ -33,7 +32,6 @@ export default { ...@@ -33,7 +32,6 @@ export default {
removeLicenseConfirm, removeLicenseConfirm,
subscriptionDetailsHeaderText, subscriptionDetailsHeaderText,
syncSubscriptionButtonText, syncSubscriptionButtonText,
uploadLicense,
}, },
modal: { modal: {
id: modalId, id: modalId,
...@@ -55,7 +53,6 @@ export default { ...@@ -55,7 +53,6 @@ export default {
inject: [ inject: [
'customersPortalUrl', 'customersPortalUrl',
'licenseRemovePath', 'licenseRemovePath',
'licenseUploadPath',
'subscriptionSyncPath', 'subscriptionSyncPath',
'subscriptionActivationBannerCalloutName', 'subscriptionActivationBannerCalloutName',
], ],
...@@ -89,9 +86,6 @@ export default { ...@@ -89,9 +86,6 @@ export default {
canSyncSubscription() { canSyncSubscription() {
return this.subscriptionSyncPath && this.isCloudType; return this.subscriptionSyncPath && this.isCloudType;
}, },
canUploadLicense() {
return this.licenseUploadPath && this.isLicenseFileType;
},
canRemoveLicense() { canRemoveLicense() {
return this.licenseRemovePath; return this.licenseRemovePath;
}, },
...@@ -112,8 +106,7 @@ export default { ...@@ -112,8 +106,7 @@ export default {
this.canActivateSubscription || this.canActivateSubscription ||
this.canRemoveLicense || this.canRemoveLicense ||
this.canManageSubscription || this.canManageSubscription ||
this.canSyncSubscription || this.canSyncSubscription
this.canUploadLicense
); );
}, },
subscriptionHistory() { subscriptionHistory() {
...@@ -207,16 +200,6 @@ export default { ...@@ -207,16 +200,6 @@ export default {
> >
{{ $options.i18n.activateCloudLicense }} {{ $options.i18n.activateCloudLicense }}
</gl-button> </gl-button>
<gl-button
v-if="canUploadLicense"
:href="licenseUploadPath"
category="secondary"
variant="confirm"
data-testid="license-upload-action"
data-qa-selector="license_upload_link"
>
{{ $options.i18n.uploadLicense }}
</gl-button>
<gl-button <gl-button
v-if="canManageSubscription" v-if="canManageSubscription"
:href="customersPortalUrl" :href="customersPortalUrl"
......
...@@ -25,7 +25,6 @@ export default () => { ...@@ -25,7 +25,6 @@ export default () => {
freeTrialPath, freeTrialPath,
hasActiveLicense, hasActiveLicense,
licenseRemovePath, licenseRemovePath,
licenseUploadPath,
subscriptionActivationBannerCalloutName, subscriptionActivationBannerCalloutName,
subscriptionSyncPath, subscriptionSyncPath,
licenseUsageFilePath, licenseUsageFilePath,
...@@ -44,7 +43,6 @@ export default () => { ...@@ -44,7 +43,6 @@ export default () => {
customersPortalUrl, customersPortalUrl,
freeTrialPath, freeTrialPath,
licenseRemovePath, licenseRemovePath,
licenseUploadPath,
subscriptionActivationBannerCalloutName, subscriptionActivationBannerCalloutName,
subscriptionSyncPath, subscriptionSyncPath,
}, },
......
...@@ -60,7 +60,6 @@ module LicenseHelper ...@@ -60,7 +60,6 @@ module LicenseHelper
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'),
license_upload_path: new_admin_license_path,
license_remove_path: admin_license_path, license_remove_path: admin_license_path,
subscription_sync_path: sync_seat_link_admin_license_path, subscription_sync_path: sync_seat_link_admin_license_path,
congratulation_svg_path: image_path('illustrations/illustration-congratulation-purchase.svg'), congratulation_svg_path: image_path('illustrations/illustration-congratulation-purchase.svg'),
......
%section.settings.expanded
.settings-header
%h4
= _('License file')
.settings-content
- link_start = '<a href="%{url}" data-qa-selector="license_upload_link">'.html_safe % { url: new_admin_license_path }
%p
= s_('%{link_start}Upload a license%{link_end} file or enter the license key you have received from GitLab Inc.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
...@@ -407,6 +407,12 @@ RSpec.describe 'Admin updates EE-only settings' do ...@@ -407,6 +407,12 @@ RSpec.describe 'Admin updates EE-only settings' do
end end
end end
end end
context 'License file link' do
it 'provides a link to upload License file' do
expect(page).to have_link(text: 'Upload a license', href: new_admin_license_path)
end
end
end end
def current_settings def current_settings
......
...@@ -216,9 +216,9 @@ RSpec.describe 'Admin views Subscription', :js do ...@@ -216,9 +216,9 @@ RSpec.describe 'Admin views Subscription', :js do
end end
context 'when uploading a license file' do context 'when uploading a license file' do
it 'shows a link to upload a license file' do it 'does not show a link to upload a license file' do
page.within(find('#content-body', match: :first)) do page.within(find('#content-body', match: :first)) do
expect(page).to have_link('Upload a license file', href: new_admin_license_path) expect(page).not_to have_link('Upload a license file', href: new_admin_license_path)
end end
end end
end end
......
import { GlCard, GlSprintf } from '@gitlab/ui'; import { GlCard } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import SubscriptionActivationCard, { import SubscriptionActivationCard from 'ee/admin/subscriptions/show/components/subscription_activation_card.vue';
activateSubscriptionUrl,
} from 'ee/admin/subscriptions/show/components/subscription_activation_card.vue';
import SubscriptionActivationErrors from 'ee/admin/subscriptions/show/components/subscription_activation_errors.vue'; import SubscriptionActivationErrors from 'ee/admin/subscriptions/show/components/subscription_activation_errors.vue';
import SubscriptionActivationForm from 'ee/admin/subscriptions/show/components/subscription_activation_form.vue'; import SubscriptionActivationForm from 'ee/admin/subscriptions/show/components/subscription_activation_form.vue';
import { import {
CONNECTIVITY_ERROR, CONNECTIVITY_ERROR,
SUBSCRIPTION_ACTIVATION_FAILURE_EVENT, SUBSCRIPTION_ACTIVATION_FAILURE_EVENT,
SUBSCRIPTION_ACTIVATION_SUCCESS_EVENT, SUBSCRIPTION_ACTIVATION_SUCCESS_EVENT,
uploadLicenseFile,
} from 'ee/admin/subscriptions/show/constants'; } from 'ee/admin/subscriptions/show/constants';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import { license } from '../mock_data'; import { license } from '../mock_data';
...@@ -17,11 +14,9 @@ import { license } from '../mock_data'; ...@@ -17,11 +14,9 @@ import { license } from '../mock_data';
describe('CloudLicenseApp', () => { describe('CloudLicenseApp', () => {
let wrapper; let wrapper;
const licenseUploadPath = 'license/upload';
const findSubscriptionActivationForm = () => wrapper.findComponent(SubscriptionActivationForm); const findSubscriptionActivationForm = () => wrapper.findComponent(SubscriptionActivationForm);
const findSubscriptionActivationErrors = () => const findSubscriptionActivationErrors = () =>
wrapper.findComponent(SubscriptionActivationErrors); wrapper.findComponent(SubscriptionActivationErrors);
const findActivateSubscriptionLink = () => wrapper.findByTestId('activate-subscription-link');
const findUploadLink = () => wrapper.findByTestId('upload-license-link'); const findUploadLink = () => wrapper.findByTestId('upload-license-link');
const createComponent = ({ props = {}, stubs = {}, provide = {} } = {}) => { const createComponent = ({ props = {}, stubs = {}, provide = {} } = {}) => {
...@@ -30,10 +25,7 @@ describe('CloudLicenseApp', () => { ...@@ -30,10 +25,7 @@ describe('CloudLicenseApp', () => {
propsData: { propsData: {
...props, ...props,
}, },
provide: { provide,
licenseUploadPath,
...provide,
},
stubs, stubs,
}), }),
); );
...@@ -55,30 +47,13 @@ describe('CloudLicenseApp', () => { ...@@ -55,30 +47,13 @@ describe('CloudLicenseApp', () => {
expect(findSubscriptionActivationErrors().exists()).toBe(false); expect(findSubscriptionActivationErrors().exists()).toBe(false);
}); });
describe('with an upload legacy license link', () => { it('does not show upload legacy license link', () => {
beforeEach(() => { expect(findUploadLink().exists()).toBe(false);
createComponent({ stubs: { GlCard, GlSprintf } });
});
it('shows a link when provided', () => {
expect(findUploadLink().text()).toBe(uploadLicenseFile);
});
it('shows an help link', () => {
expect(findActivateSubscriptionLink().attributes('href')).toBe(activateSubscriptionUrl);
});
it('provides the correct path', () => {
expect(findUploadLink().attributes('href')).toBe(licenseUploadPath);
});
}); });
it('does not show a link when legacy license link is not provided', () => { it('does not show a link when legacy license link is not provided', () => {
createComponent({ createComponent({
stubs: { GlCard }, stubs: { GlCard },
provide: {
licenseUploadPath: '',
},
}); });
expect(findUploadLink().exists()).toBe(false); expect(findUploadLink().exists()).toBe(false);
......
...@@ -40,7 +40,6 @@ describe('Subscription Breakdown', () => { ...@@ -40,7 +40,6 @@ describe('Subscription Breakdown', () => {
const connectivityHelpURL = 'connectivity/help/url'; const connectivityHelpURL = 'connectivity/help/url';
const customersPortalUrl = 'customers.dot'; const customersPortalUrl = 'customers.dot';
const licenseRemovePath = '/license/remove/'; const licenseRemovePath = '/license/remove/';
const licenseUploadPath = '/license/upload/';
const subscriptionActivationBannerCalloutName = 'banner_callout_name'; const subscriptionActivationBannerCalloutName = 'banner_callout_name';
const subscriptionSyncPath = '/sync/path/'; const subscriptionSyncPath = '/sync/path/';
...@@ -82,7 +81,6 @@ describe('Subscription Breakdown', () => { ...@@ -82,7 +81,6 @@ describe('Subscription Breakdown', () => {
congratulationSvgPath, congratulationSvgPath,
connectivityHelpURL, connectivityHelpURL,
customersPortalUrl, customersPortalUrl,
licenseUploadPath,
licenseRemovePath, licenseRemovePath,
subscriptionActivationBannerCalloutName, subscriptionActivationBannerCalloutName,
subscriptionSyncPath, subscriptionSyncPath,
...@@ -195,7 +193,6 @@ describe('Subscription Breakdown', () => { ...@@ -195,7 +193,6 @@ describe('Subscription Breakdown', () => {
const provide = { const provide = {
connectivityHelpURL: '', connectivityHelpURL: '',
customersPortalUrl: '', customersPortalUrl: '',
licenseUploadPath: '',
licenseRemovePath: '', licenseRemovePath: '',
subscriptionSyncPath: url, subscriptionSyncPath: url,
}; };
...@@ -207,31 +204,11 @@ describe('Subscription Breakdown', () => { ...@@ -207,31 +204,11 @@ describe('Subscription Breakdown', () => {
}, },
); );
it.each` it('does not show upload legacy license button', () => {
url | type | shouldShow createComponent();
${licenseUploadPath} | ${subscriptionTypes.LICENSE_FILE} | ${true}
${licenseUploadPath} | ${subscriptionTypes.CLOUD} | ${false}
${''} | ${subscriptionTypes.LICENSE_FILE} | ${false}
${''} | ${subscriptionTypes.CLOUD} | ${false}
${undefined} | ${subscriptionTypes.LICENSE_FILE} | ${false}
${undefined} | ${subscriptionTypes.CLOUD} | ${false}
`(
'with url is $url and type is $type the upload button is shown: $shouldShow',
({ url, type, shouldShow }) => {
const provide = {
connectivityHelpURL: '',
customersPortalUrl: '',
licenseRemovePath: '',
subscriptionSyncPath: '',
licenseUploadPath: url,
};
const props = { subscription: { ...license.ULTIMATE, type } };
const stubs = { GlCard, SubscriptionDetailsCard };
createComponent({ props, provide, stubs });
expect(findLicenseUploadAction().exists()).toBe(shouldShow); expect(findLicenseUploadAction().exists()).toBe(false);
}, });
);
it.each` it.each`
url | shouldShow url | shouldShow
...@@ -241,7 +218,6 @@ describe('Subscription Breakdown', () => { ...@@ -241,7 +218,6 @@ describe('Subscription Breakdown', () => {
`('with url is $url the manage button is shown: $shouldShow', ({ url, shouldShow }) => { `('with url is $url the manage button is shown: $shouldShow', ({ url, shouldShow }) => {
const provide = { const provide = {
connectivityHelpURL: '', connectivityHelpURL: '',
licenseUploadPath: '',
licenseRemovePath: '', licenseRemovePath: '',
subscriptionSyncPath: '', subscriptionSyncPath: '',
customersPortalUrl: url, customersPortalUrl: url,
...@@ -266,7 +242,6 @@ describe('Subscription Breakdown', () => { ...@@ -266,7 +242,6 @@ describe('Subscription Breakdown', () => {
const provide = { const provide = {
connectivityHelpURL: '', connectivityHelpURL: '',
customersPortalUrl: '', customersPortalUrl: '',
licenseUploadPath: '',
subscriptionSyncPath: '', subscriptionSyncPath: '',
licenseRemovePath: url, licenseRemovePath: url,
}; };
......
...@@ -98,7 +98,6 @@ RSpec.describe LicenseHelper do ...@@ -98,7 +98,6 @@ RSpec.describe LicenseHelper do
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,
license_upload_path: new_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'),
subscription_activation_banner_callout_name: ::EE::Users::CalloutsHelper::CL_SUBSCRIPTION_ACTIVATION, subscription_activation_banner_callout_name: ::EE::Users::CalloutsHelper::CL_SUBSCRIPTION_ACTIVATION,
...@@ -115,7 +114,6 @@ RSpec.describe LicenseHelper do ...@@ -115,7 +114,6 @@ RSpec.describe LicenseHelper do
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,
license_upload_path: new_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'),
subscription_activation_banner_callout_name: ::EE::Users::CalloutsHelper::CL_SUBSCRIPTION_ACTIVATION, subscription_activation_banner_callout_name: ::EE::Users::CalloutsHelper::CL_SUBSCRIPTION_ACTIVATION,
......
...@@ -731,6 +731,9 @@ msgstr "" ...@@ -731,6 +731,9 @@ msgstr ""
msgid "%{link_start}Start the title with %{draft_snippet}%{link_end} to prevent a merge request draft from merging before it's ready." msgid "%{link_start}Start the title with %{draft_snippet}%{link_end} to prevent a merge request draft from merging before it's ready."
msgstr "" msgstr ""
msgid "%{link_start}Upload a license%{link_end} file or enter the license key you have received from GitLab Inc."
msgstr ""
msgid "%{link_start}What information does GitLab Inc. collect?%{link_end}" msgid "%{link_start}What information does GitLab Inc. collect?%{link_end}"
msgstr "" msgstr ""
......
...@@ -5,7 +5,7 @@ module QA ...@@ -5,7 +5,7 @@ module QA
module Page module Page
module Admin module Admin
class License < QA::Page::Base class License < QA::Page::Base
view 'ee/app/assets/javascripts/admin/subscriptions/show/components/subscription_activation_card.vue' do view 'ee/app/views/admin/application_settings/_license_file.html.haml' do
element :license_upload_link element :license_upload_link
end end
......
...@@ -10,7 +10,11 @@ module QA ...@@ -10,7 +10,11 @@ module QA
QA::Page::Admin::Menu.perform(&:click_subscription_menu_link) QA::Page::Admin::Menu.perform(&:click_subscription_menu_link)
EE::Page::Admin::License.perform do |license_page| EE::Page::Admin::License.perform do |license_page|
license_page.add_new_license(license) unless license_page.license? unless license_page.license?
QA::Page::Admin::Menu.perform(&:go_to_general_settings)
license_page.add_new_license(license)
end
end end
QA::Page::Main::Menu.perform(&:sign_out_if_signed_in) QA::Page::Main::Menu.perform(&:sign_out_if_signed_in)
......
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