Commit b1ff6fb3 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '350838-extract-urls-to-variables' into 'master'

Extract callout content trails link to variable

See merge request gitlab-org/gitlab!78872
parents 6e4cebad db33b61a
......@@ -15,11 +15,11 @@ import { initRails } from '~/lib/utils/rails_ujs';
import * as popovers from '~/popovers';
import * as tooltips from '~/tooltips';
import { initPrefetchLinks } from '~/lib/utils/navigation_utility';
import { logHelloDeferred } from 'jh_else_ce/lib/logger/hello_deferred';
import initAlertHandler from './alert_handler';
import { addDismissFlashClickListener } from './flash';
import initTodoToggle from './header';
import initLayoutNav from './layout_nav';
import { logHelloDeferred } from './lib/logger/hello_deferred';
import { handleLocationHash, addSelectOnFocusBehaviour } from './lib/utils/common_utils';
import { localTimeAgo } from './lib/utils/datetime/timeago_utility';
import { getLocationHash, visitUrl } from './lib/utils/url_utility';
......
......@@ -163,6 +163,10 @@ module EE
def current_settings
end
def trials_link_url
new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'gold-callout')
end
end
end
end
......@@ -13,7 +13,7 @@
%p
%span= _('Try all GitLab has to offer for 30 days.')
%span.d-none.d-sm-inline= _('No credit card required.')
= link_to _('Start your free trial'), new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'gold-callout'), class: "btn btn-confirm gl-button mt-2 mt-sm-0 #{button_css_class}", target: '_blank', rel: 'noopener noreferrer'
= link_to _('Start your free trial'), trials_link_url, class: "btn btn-confirm gl-button mt-2 mt-sm-0 #{button_css_class}", target: '_blank', rel: 'noopener noreferrer'
- if is_dismissable
%button.btn.gl-banner-close.btn-default.btn-sm.gl-button.btn-default-tertiary.btn-icon.close.js-close{ class: 'gl-opacity-10!', type: 'button', 'aria-label' => _('Dismiss trial promotion') }
= sprite_icon('close', css_class: 'dismiss-icon gl-text-gray-700!')
......@@ -462,5 +462,11 @@ RSpec.describe EE::Users::CalloutsHelper do
it { is_expected.to eq(false) }
end
end
describe '#trials_link_url' do
it 'returns value of glm_source is gitlab.com' do
expect(helper.send(:trials_link_url)).to eq('/-/trial_registrations/new?glm_content=gold-callout&glm_source=gitlab.com')
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