Commit e6728e8c authored by David O'Regan's avatar David O'Regan

Merge branch '345110-replac-about-url-to-variable' into 'master'

Fix: replace about page url host to variable

See merge request gitlab-org/gitlab!73914
parents 278073d0 9a726fbd
...@@ -16,6 +16,7 @@ import { ...@@ -16,6 +16,7 @@ import {
import * as Sentry from '@sentry/browser'; import * as Sentry from '@sentry/browser';
import { isEqual, isEmpty, omit } from 'lodash'; import { isEqual, isEmpty, omit } from 'lodash';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import { PROMO_URL } from 'jh_else_ce/lib/utils/url_utility';
import { import {
integrationTypes, integrationTypes,
integrationSteps, integrationSteps,
...@@ -129,6 +130,7 @@ export default { ...@@ -129,6 +130,7 @@ export default {
name: true, name: true,
apiUrl: true, apiUrl: true,
}, },
pricingLink: `${PROMO_URL}/pricing`,
}; };
}, },
computed: { computed: {
...@@ -436,7 +438,7 @@ export default { ...@@ -436,7 +438,7 @@ export default {
disabled="true" disabled="true"
class="gl-display-inline-block gl-my-4" class="gl-display-inline-block gl-my-4"
:message="$options.i18n.integrationFormSteps.selectType.enterprise" :message="$options.i18n.integrationFormSteps.selectType.enterprise"
link="https://about.gitlab.com/pricing" :link="pricingLink"
data-testid="multi-integrations-not-supported" data-testid="multi-integrations-not-supported"
/> />
</gl-form-group> </gl-form-group>
......
...@@ -5,6 +5,12 @@ const PATH_SEPARATOR_LEADING_REGEX = new RegExp(`^${PATH_SEPARATOR}+`); ...@@ -5,6 +5,12 @@ const PATH_SEPARATOR_LEADING_REGEX = new RegExp(`^${PATH_SEPARATOR}+`);
const PATH_SEPARATOR_ENDING_REGEX = new RegExp(`${PATH_SEPARATOR}+$`); const PATH_SEPARATOR_ENDING_REGEX = new RegExp(`${PATH_SEPARATOR}+$`);
const SHA_REGEX = /[\da-f]{40}/gi; const SHA_REGEX = /[\da-f]{40}/gi;
// About GitLab default host (overwrite in jh)
export const PROMO_HOST = 'about.gitlab.com';
// About Gitlab default url (overwrite in jh)
export const PROMO_URL = `https://${PROMO_HOST}`;
// Reset the cursor in a Regex so that multiple uses before a recompile don't fail // Reset the cursor in a Regex so that multiple uses before a recompile don't fail
function resetRegExp(regex) { function resetRegExp(regex) {
regex.lastIndex = 0; /* eslint-disable-line no-param-reassign */ regex.lastIndex = 0; /* eslint-disable-line no-param-reassign */
......
...@@ -4,7 +4,7 @@ module Projects ...@@ -4,7 +4,7 @@ module Projects
module Security module Security
module ConfigurationHelper module ConfigurationHelper
def security_upgrade_path def security_upgrade_path
'https://about.gitlab.com/pricing/' "https://#{ApplicationHelper.promo_host}/pricing/"
end end
end end
end end
......
...@@ -46,5 +46,5 @@ ...@@ -46,5 +46,5 @@
%button.btn-blank.btn-link.js-trigger-shortcut{ type: 'button' } %button.btn-blank.btn-link.js-trigger-shortcut{ type: 'button' }
= _('Use shortcuts') = _('Use shortcuts')
- unless Gitlab::CurrentSettings.help_page_hide_commercial_content? - unless Gitlab::CurrentSettings.help_page_hide_commercial_content?
%li= link_to _('Get a support subscription'), 'https://about.gitlab.com/pricing/' %li= link_to _('Get a support subscription'), "https://#{ApplicationHelper.promo_host}/pricing/"
%li= link_to _('Compare GitLab editions'), 'https://about.gitlab.com/features/#compare' %li= link_to _('Compare GitLab editions'), "https://#{ApplicationHelper.promo_host}/features/#compare"
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
GlSprintf, GlSprintf,
} from '@gitlab/ui'; } from '@gitlab/ui';
import validation from '~/vue_shared/directives/validation'; import validation from '~/vue_shared/directives/validation';
import { PROMO_URL } from 'jh_else_ce/lib/utils/url_utility';
import { import {
activateLabel, activateLabel,
INVALID_CODE_ERROR, INVALID_CODE_ERROR,
...@@ -79,6 +80,7 @@ export default { ...@@ -79,6 +80,7 @@ export default {
return { return {
form, form,
isLoading: false, isLoading: false,
termsLink: `${PROMO_URL}/terms/`,
}; };
}, },
computed: { computed: {
...@@ -182,9 +184,7 @@ export default { ...@@ -182,9 +184,7 @@ export default {
<span :class="checkboxLabelClass"> <span :class="checkboxLabelClass">
<gl-sprintf :message="$options.i18n.acceptTerms"> <gl-sprintf :message="$options.i18n.acceptTerms">
<template #link="{ content }"> <template #link="{ content }">
<gl-link href="https://about.gitlab.com/terms/" target="_blank">{{ <gl-link :href="termsLink" target="_blank">{{ content }}</gl-link>
content
}}</gl-link>
</template> </template>
</gl-sprintf> </gl-sprintf>
</span> </span>
......
import { __, s__ } from '~/locale'; import { __, s__ } from '~/locale';
import { PROMO_URL } from 'jh_else_ce/lib/utils/url_utility';
import activateSubscriptionMutation from './graphql/mutations/activate_subscription.mutation.graphql'; import activateSubscriptionMutation from './graphql/mutations/activate_subscription.mutation.graphql';
import getCurrentLicense from './graphql/queries/get_current_license.query.graphql'; import getCurrentLicense from './graphql/queries/get_current_license.query.graphql';
import getLicenseHistory from './graphql/queries/get_license_history.query.graphql'; import getLicenseHistory from './graphql/queries/get_license_history.query.graphql';
...@@ -152,7 +153,7 @@ export const connectivityErrorAlert = { ...@@ -152,7 +153,7 @@ export const connectivityErrorAlert = {
'SuperSonics|Get help for the most common connectivity issues by %{linkStart}troubleshooting the activation code%{linkEnd}.', 'SuperSonics|Get help for the most common connectivity issues by %{linkStart}troubleshooting the activation code%{linkEnd}.',
), ),
}; };
export const supportLink = 'https://about.gitlab.com/support/#contact-support'; export const supportLink = `${PROMO_URL}/support/#contact-support`;
export const subscriptionBannerTitle = s__('SuperSonics|Cloud licensing'); export const subscriptionBannerTitle = s__('SuperSonics|Cloud licensing');
export const subscriptionBannerText = s__( export const subscriptionBannerText = s__(
"SuperSonics|Cloud licensing is now available. It's an easier way to activate instances and manage subscriptions. Read more about it in our %{blogPostLinkStart}blog post%{blogPostLinkEnd}. Activation codes are available in the %{portalLinkStart}Customers Portal%{portalLinkEnd}.", "SuperSonics|Cloud licensing is now available. It's an easier way to activate instances and manage subscriptions. Read more about it in our %{blogPostLinkStart}blog post%{blogPostLinkEnd}. Activation codes are available in the %{portalLinkStart}Customers Portal%{portalLinkEnd}.",
......
- page_title _("Upload License") - page_title _("Upload License")
- eula_url = 'https://about.gitlab.com/terms/#subscription' - eula_url = "https://#{ApplicationHelper.promo_host}/terms/#subscription"
- eula_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: eula_url } - eula_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: eula_url }
%h3.page-title= _('Upload License') %h3.page-title= _('Upload License')
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
- has_upgrade = has_upgrade?(plan_offer_type) - has_upgrade = has_upgrade?(plan_offer_type)
- if show_deprecated_plan - if show_deprecated_plan
- plan_name += ' (Legacy)' - plan_name += ' (Legacy)'
- faq_link_url = 'https://about.gitlab.com/pricing/faq-new-product-subscription-tiers' - faq_link_url = "https://#{ApplicationHelper.promo_host}/pricing/faq-new-product-subscription-tiers"
- faq_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: faq_link_url } - faq_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: faq_link_url }
.card-wrapper{ class: ("card-wrapper-has-badge" if has_upgrade), data: { testid: "plan-card-#{plan.code}" } } .card-wrapper{ class: ("card-wrapper-has-badge" if has_upgrade), data: { testid: "plan-card-#{plan.code}" } }
......
...@@ -24,7 +24,7 @@ RSpec.describe "Admin uploads license", :js do ...@@ -24,7 +24,7 @@ RSpec.describe "Admin uploads license", :js do
end end
it 'redirects to current Subscription terms' do it 'redirects to current Subscription terms' do
expect(page).to have_link('Terms of Service', href: 'https://about.gitlab.com/terms/#subscription') expect(page).to have_link('Terms of Service', href: "https://#{ApplicationHelper.promo_host}/terms/#subscription")
end end
it 'enables button "Upload license" when EULA checkbox is selected' do it 'enables button "Upload license" when EULA checkbox is selected' do
......
...@@ -104,6 +104,8 @@ describe('SubscriptionActivationErrors', () => { ...@@ -104,6 +104,8 @@ describe('SubscriptionActivationErrors', () => {
subscriptionActivationHelpLink, subscriptionActivationHelpLink,
); );
expect(supportLink).toMatch(/https:\/\/about.gitlab.(com|cn)\/support\/#contact-support/);
expect(alert.findAllComponents(GlLink).at(1).attributes('href')).toBe(supportLink); expect(alert.findAllComponents(GlLink).at(1).attributes('href')).toBe(supportLink);
}); });
......
import { GlForm, GlFormCheckbox, GlFormInput } from '@gitlab/ui'; import { GlForm, GlFormCheckbox, GlFormInput, GlLink, GlSprintf } from '@gitlab/ui';
import { createLocalVue, mount, shallowMount } from '@vue/test-utils'; import { createLocalVue, mount, shallowMount } from '@vue/test-utils';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import SubscriptionActivationForm from 'ee/admin/subscriptions/show/components/subscription_activation_form.vue'; import SubscriptionActivationForm from 'ee/admin/subscriptions/show/components/subscription_activation_form.vue';
...@@ -41,6 +41,7 @@ describe('SubscriptionActivationForm', () => { ...@@ -41,6 +41,7 @@ describe('SubscriptionActivationForm', () => {
const findActivationCodeFormGroup = () => wrapper.findByTestId('form-group-activation-code'); const findActivationCodeFormGroup = () => wrapper.findByTestId('form-group-activation-code');
const findActivationCodeInput = () => wrapper.findComponent(GlFormInput); const findActivationCodeInput = () => wrapper.findComponent(GlFormInput);
const findActivateSubscriptionForm = () => wrapper.findComponent(GlForm); const findActivateSubscriptionForm = () => wrapper.findComponent(GlForm);
const findTermLink = () => findAgreementCheckboxFormGroup().findComponent(GlLink);
const GlFormInputStub = stubComponent(GlFormInput, { const GlFormInputStub = stubComponent(GlFormInput, {
template: `<input />`, template: `<input />`,
...@@ -61,6 +62,7 @@ describe('SubscriptionActivationForm', () => { ...@@ -61,6 +62,7 @@ describe('SubscriptionActivationForm', () => {
}, },
stubs: { stubs: {
GlFormInput: GlFormInputStub, GlFormInput: GlFormInputStub,
GlSprintf,
}, },
}), }),
); );
...@@ -96,6 +98,11 @@ describe('SubscriptionActivationForm', () => { ...@@ -96,6 +98,11 @@ describe('SubscriptionActivationForm', () => {
it('has the activate button enabled', () => { it('has the activate button enabled', () => {
expect(findActivateButton().props('disabled')).toBe(false); expect(findActivateButton().props('disabled')).toBe(false);
}); });
it('verify terms link url', () => {
const link = findTermLink();
expect(link.attributes('href')).toMatch(/https:\/\/about.gitlab.(com|cn)\/terms\//);
});
}); });
describe('form validation', () => { describe('form validation', () => {
......
...@@ -25,6 +25,6 @@ RSpec.describe EE::Projects::Security::ConfigurationHelper do ...@@ -25,6 +25,6 @@ RSpec.describe EE::Projects::Security::ConfigurationHelper do
context 'when user can not access discover security' do context 'when user can not access discover security' do
let(:can_access_discover_security) { false } let(:can_access_discover_security) { false }
it { is_expected.to eq('https://about.gitlab.com/pricing/') } it { is_expected.to eq("https://#{ApplicationHelper.promo_host}/pricing/") }
end end
end end
import { GlForm, GlFormSelect, GlFormInput, GlToggle, GlFormTextarea, GlTab } from '@gitlab/ui'; import {
GlForm,
GlFormSelect,
GlFormInput,
GlToggle,
GlFormTextarea,
GlTab,
GlLink,
} from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper';
...@@ -101,6 +109,12 @@ describe('AlertsSettingsForm', () => { ...@@ -101,6 +109,12 @@ describe('AlertsSettingsForm', () => {
expect(findFormFields().at(0).attributes('id')).not.toBe('name-integration'); expect(findFormFields().at(0).attributes('id')).not.toBe('name-integration');
}); });
it('verify pricing link url', () => {
createComponent({ props: { canAddIntegration: false } });
const link = findMultiSupportText().findComponent(GlLink);
expect(link.attributes('href')).toMatch(/https:\/\/about.gitlab.(com|cn)\/pricing/);
});
describe('form tabs', () => { describe('form tabs', () => {
it('renders 3 tabs', () => { it('renders 3 tabs', () => {
expect(findTabs()).toHaveLength(3); expect(findTabs()).toHaveLength(3);
......
...@@ -1060,4 +1060,12 @@ describe('URL utility', () => { ...@@ -1060,4 +1060,12 @@ describe('URL utility', () => {
}, },
); );
}); });
describe('defaultPromoUrl', () => {
it('Gitlab about page url', () => {
const url = 'https://about.gitlab.com';
expect(urlUtils.PROMO_URL).toBe(url);
});
});
}); });
...@@ -8,6 +8,6 @@ RSpec.describe Projects::Security::ConfigurationHelper do ...@@ -8,6 +8,6 @@ RSpec.describe Projects::Security::ConfigurationHelper do
describe 'security_upgrade_path' do describe 'security_upgrade_path' do
subject { security_upgrade_path } subject { security_upgrade_path }
it { is_expected.to eq('https://about.gitlab.com/pricing/') } it { is_expected.to eq("https://#{ApplicationHelper.promo_host}/pricing/") }
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