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 {
import * as Sentry from '@sentry/browser';
import { isEqual, isEmpty, omit } from 'lodash';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import { PROMO_URL } from 'jh_else_ce/lib/utils/url_utility';
import {
integrationTypes,
integrationSteps,
......@@ -129,6 +130,7 @@ export default {
name: true,
apiUrl: true,
},
pricingLink: `${PROMO_URL}/pricing`,
};
},
computed: {
......@@ -436,7 +438,7 @@ export default {
disabled="true"
class="gl-display-inline-block gl-my-4"
:message="$options.i18n.integrationFormSteps.selectType.enterprise"
link="https://about.gitlab.com/pricing"
:link="pricingLink"
data-testid="multi-integrations-not-supported"
/>
</gl-form-group>
......
......@@ -5,6 +5,12 @@ const PATH_SEPARATOR_LEADING_REGEX = new RegExp(`^${PATH_SEPARATOR}+`);
const PATH_SEPARATOR_ENDING_REGEX = new RegExp(`${PATH_SEPARATOR}+$`);
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
function resetRegExp(regex) {
regex.lastIndex = 0; /* eslint-disable-line no-param-reassign */
......
......@@ -4,7 +4,7 @@ module Projects
module Security
module ConfigurationHelper
def security_upgrade_path
'https://about.gitlab.com/pricing/'
"https://#{ApplicationHelper.promo_host}/pricing/"
end
end
end
......
......@@ -46,5 +46,5 @@
%button.btn-blank.btn-link.js-trigger-shortcut{ type: 'button' }
= _('Use shortcuts')
- unless Gitlab::CurrentSettings.help_page_hide_commercial_content?
%li= link_to _('Get a support subscription'), 'https://about.gitlab.com/pricing/'
%li= link_to _('Compare GitLab editions'), 'https://about.gitlab.com/features/#compare'
%li= link_to _('Get a support subscription'), "https://#{ApplicationHelper.promo_host}/pricing/"
%li= link_to _('Compare GitLab editions'), "https://#{ApplicationHelper.promo_host}/features/#compare"
......@@ -9,6 +9,7 @@ import {
GlSprintf,
} from '@gitlab/ui';
import validation from '~/vue_shared/directives/validation';
import { PROMO_URL } from 'jh_else_ce/lib/utils/url_utility';
import {
activateLabel,
INVALID_CODE_ERROR,
......@@ -79,6 +80,7 @@ export default {
return {
form,
isLoading: false,
termsLink: `${PROMO_URL}/terms/`,
};
},
computed: {
......@@ -182,9 +184,7 @@ export default {
<span :class="checkboxLabelClass">
<gl-sprintf :message="$options.i18n.acceptTerms">
<template #link="{ content }">
<gl-link href="https://about.gitlab.com/terms/" target="_blank">{{
content
}}</gl-link>
<gl-link :href="termsLink" target="_blank">{{ content }}</gl-link>
</template>
</gl-sprintf>
</span>
......
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 getCurrentLicense from './graphql/queries/get_current_license.query.graphql';
import getLicenseHistory from './graphql/queries/get_license_history.query.graphql';
......@@ -152,7 +153,7 @@ export const connectivityErrorAlert = {
'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 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}.",
......
- 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 }
%h3.page-title= _('Upload License')
......
......@@ -4,7 +4,7 @@
- has_upgrade = has_upgrade?(plan_offer_type)
- if show_deprecated_plan
- 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 }
.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
end
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
it 'enables button "Upload license" when EULA checkbox is selected' do
......
......@@ -104,6 +104,8 @@ describe('SubscriptionActivationErrors', () => {
subscriptionActivationHelpLink,
);
expect(supportLink).toMatch(/https:\/\/about.gitlab.(com|cn)\/support\/#contact-support/);
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 VueApollo from 'vue-apollo';
import SubscriptionActivationForm from 'ee/admin/subscriptions/show/components/subscription_activation_form.vue';
......@@ -41,6 +41,7 @@ describe('SubscriptionActivationForm', () => {
const findActivationCodeFormGroup = () => wrapper.findByTestId('form-group-activation-code');
const findActivationCodeInput = () => wrapper.findComponent(GlFormInput);
const findActivateSubscriptionForm = () => wrapper.findComponent(GlForm);
const findTermLink = () => findAgreementCheckboxFormGroup().findComponent(GlLink);
const GlFormInputStub = stubComponent(GlFormInput, {
template: `<input />`,
......@@ -61,6 +62,7 @@ describe('SubscriptionActivationForm', () => {
},
stubs: {
GlFormInput: GlFormInputStub,
GlSprintf,
},
}),
);
......@@ -96,6 +98,11 @@ describe('SubscriptionActivationForm', () => {
it('has the activate button enabled', () => {
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', () => {
......
......@@ -25,6 +25,6 @@ RSpec.describe EE::Projects::Security::ConfigurationHelper do
context 'when user can not access discover security' do
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
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 { nextTick } from 'vue';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
......@@ -101,6 +109,12 @@ describe('AlertsSettingsForm', () => {
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', () => {
it('renders 3 tabs', () => {
expect(findTabs()).toHaveLength(3);
......
......@@ -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
describe 'security_upgrade_path' do
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
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