Commit 952a0852 authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch '337551-aa-add-glm-content-for-hand-raise' into 'master'

Content for hand raise leads

See merge request gitlab-org/gitlab!79256
parents 1f56fa60 1befa032
......@@ -55,6 +55,7 @@ export const sendHandRaiseLead = async (params) => {
country: params.country,
state: params.state,
comment: params.comment,
glm_content: params.glmContent,
};
return axios.post(url, formParams);
......
......@@ -166,6 +166,7 @@ export default {
country: this.country,
state: this.mustEnterState ? this.state : null,
comment: this.comment,
glmContent: this.user.glmContent,
};
},
},
......
......@@ -3,7 +3,7 @@ import HandRaiseLeadButton from 'ee/hand_raise_leads/hand_raise_lead/components/
import apolloProvider from 'ee/subscriptions/buy_addons_shared/graphql';
export const initHandRaiseLeadButton = (el) => {
const { namespaceId, userName, firstName, lastName, companyName } = el.dataset;
const { namespaceId, userName, firstName, lastName, companyName, glmContent } = el.dataset;
return new Vue({
el,
......@@ -15,6 +15,7 @@ export const initHandRaiseLeadButton = (el) => {
firstName,
lastName,
companyName,
glmContent,
},
},
render(createElement) {
......
......@@ -16,6 +16,7 @@ export default () => {
firstName,
lastName,
companyName,
glmContent,
} = securityTab.dataset;
const props = {
......@@ -44,6 +45,7 @@ export default () => {
firstName,
lastName,
companyName,
glmContent,
},
},
render(createElement) {
......
......@@ -116,7 +116,7 @@ class TrialsController < ApplicationController
def hand_raise_lead_params
params.permit(:first_name, :last_name, :company_name, :company_size, :phone_number, :country,
:state, :namespace_id, :comment)
:state, :namespace_id, :comment, :glm_content)
.merge(hand_raise_lead_extra_params)
end
......@@ -126,7 +126,6 @@ class TrialsController < ApplicationController
uid: current_user.id,
provider: 'gitlab',
setup_for_company: current_user.setup_for_company,
glm_content: 'group-billing',
glm_source: 'gitlab.com'
}
end
......
......@@ -140,13 +140,14 @@ module BillingPlansHelper
end
end
def hand_raise_props(namespace)
def hand_raise_props(namespace, glm_content: )
{
namespace_id: namespace.id,
user_name: current_user.username,
first_name: current_user.first_name,
last_name: current_user.last_name,
company_name: current_user.organization
company_name: current_user.organization,
glm_content: glm_content
}
end
......
......@@ -50,6 +50,6 @@ module Groups::SecurityFeaturesHelper
}
}
data.merge(hand_raise_props(group.root_ancestor))
data.merge(hand_raise_props(group.root_ancestor, glm_content: content))
end
end
......@@ -23,6 +23,6 @@ module Projects::Security::DiscoverHelper
}
}
data.merge(hand_raise_props(project.root_ancestor))
data.merge(hand_raise_props(project.root_ancestor, glm_content: content))
end
end
- if show_contact_sales_button?(purchase_link.action, plan_offer_type)
.js-hand-raise-lead-button{ data: hand_raise_props(namespace) }
.js-hand-raise-lead-button{ data: hand_raise_props(namespace, glm_content: 'billing-group') }
- if show_upgrade_button
= link_to upgrade_button_text(plan_offer_type),
plan_purchase_or_upgrade_url(namespace, plan),
......
......@@ -261,7 +261,6 @@ RSpec.describe TrialsController, :saas do
uid: user.id,
provider: 'gitlab',
setup_for_company: user.setup_for_company,
glm_content: 'group-billing',
glm_source: 'gitlab.com'
}
end
......@@ -276,7 +275,8 @@ RSpec.describe TrialsController, :saas do
phone_number: '+1-192-10-10',
country: 'US',
state: 'CA',
comment: 'I want to talk to sales.'
comment: 'I want to talk to sales.',
glm_content: 'group-billing'
}
end
......
......@@ -27,6 +27,7 @@ describe('SubscriptionsApi', () => {
country: 'US',
state: 'CA',
comment: 'A comment',
glmContent: 'some-content',
};
const formParams = {
namespace_id: 1000,
......@@ -38,6 +39,7 @@ describe('SubscriptionsApi', () => {
country: 'US',
state: 'CA',
comment: 'A comment',
glm_content: 'some-content',
};
it('sends hand raise lead parameters', async () => {
......
......@@ -45,6 +45,7 @@ describe('HandRaiseLeadButton', () => {
firstName: 'Joe',
lastName: 'Doe',
companyName: 'ACME',
glmContent: 'some-content',
},
},
});
......@@ -191,6 +192,7 @@ describe('HandRaiseLeadButton', () => {
expect(SubscriptionsApi.sendHandRaiseLead).toHaveBeenCalledWith({
namespaceId: 1,
comment: 'comment',
glmContent: 'some-content',
...formData,
});
});
......
......@@ -373,8 +373,8 @@ RSpec.describe BillingPlansHelper, :saas do
end
it 'builds correct hash' do
props = helper.hand_raise_props(namespace)
expect(props).to eq(namespace_id: namespace.id, user_name: 'Joe', first_name: 'Joe', last_name: 'Doe', company_name: 'ACME')
props = helper.hand_raise_props(namespace, glm_content: 'some-content')
expect(props).to eq(namespace_id: namespace.id, user_name: 'Joe', first_name: 'Joe', last_name: 'Doe', company_name: 'ACME', glm_content: 'some-content')
end
end
......
......@@ -104,7 +104,7 @@ RSpec.describe Groups::SecurityFeaturesHelper do
main: new_trial_registration_path(glm_source: 'gitlab.com', glm_content: content),
secondary: group_billings_path(group.root_ancestor, source: content)
}
}.merge(helper.hand_raise_props(group.root_ancestor))
}.merge(helper.hand_raise_props(group.root_ancestor, glm_content: content))
end
subject(:group_security_discover_data) do
......
......@@ -19,7 +19,7 @@ RSpec.describe Projects::Security::DiscoverHelper do
main: new_trial_registration_path(glm_source: 'gitlab.com', glm_content: content),
secondary: profile_billings_path(project.group, source: content)
}
}.merge(helper.hand_raise_props(project.root_ancestor))
}.merge(helper.hand_raise_props(project.root_ancestor, glm_content: content))
end
subject(:project_security_discover_data) do
......
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