Commit a9a33573 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'eugie/update-onboarding-interview-recruiting' into 'master'

Update onboarding interview recruiting

See merge request gitlab-org/gitlab!71809
parents 2656e78f f303b815
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
class SurveyResponsesController < ApplicationController class SurveyResponsesController < ApplicationController
SURVEY_RESPONSE_SCHEMA_URL = 'iglu:com.gitlab/survey_response/jsonschema/1-0-1' SURVEY_RESPONSE_SCHEMA_URL = 'iglu:com.gitlab/survey_response/jsonschema/1-0-1'
CALENDLY_INVITE_LINK = 'https://calendly.com/mkarampalas/gitlab-user-onboarding-research' CALENDLY_INVITE_LINK = 'https://calendly.com/d/n9wd-sy2b/gitlab-user-onboarding-research'
before_action :track_response, only: :index before_action :track_response, only: :index
before_action :set_invite_link, only: :index before_action :set_invite_link, only: :index
before_action :set_show_incentive, only: :index
skip_before_action :authenticate_user! skip_before_action :authenticate_user!
...@@ -47,4 +48,10 @@ class SurveyResponsesController < ApplicationController ...@@ -47,4 +48,10 @@ class SurveyResponsesController < ApplicationController
@invite_link = CALENDLY_INVITE_LINK @invite_link = CALENDLY_INVITE_LINK
end end
def set_show_incentive
return unless @invite_link
@show_incentive = Gitlab::Utils.to_boolean(params[:show_incentive])
end
end end
- page_title _('Survey Response') - page_title _('Survey Response')
- header = _('Thank you for your feedback!')
!!! 5 !!! 5
%html{ lang: I18n.locale } %html{ lang: I18n.locale }
...@@ -6,9 +7,19 @@ ...@@ -6,9 +7,19 @@
%body.ui-indigo.gl-display-flex %body.ui-indigo.gl-display-flex
= render 'layouts/header/logo_with_title' = render 'layouts/header/logo_with_title'
.container.gl-pt-8.gl-max-w-full.gl-text-center .container.gl-pt-8.gl-max-w-full.gl-text-center
.gl-mt-11.gl-mb-6= image_tag 'illustrations/subscription-success.svg'
%h2.gl-font-weight-bold= _('Thank you for your feedback!')
%p.gl-pt-2.gl-mb-0= _('Your response has been recorded.')
- if @invite_link - if @invite_link
%p= _('We love speaking to our users. Got more to say about your GitLab experiences?') %h2.gl-font-weight-bold.gl-mt-11= header
%p.gl-pt-3= link_to _("Let's talk!"), @invite_link, target: '_blank', rel: 'noopener noreferrer', class: 'gl-button btn btn-confirm' %p= _('Have more to say about GitLab?')
.gl-display-flex.gl-justify-content-center.gl-md-max-w-30p.gl-m-auto.gl-mb-5
.gl-px-5
= image_tag 'illustrations/chat.svg', class: 'gl-mb-3'
%p= _('Have a quick chat with us about your experience.')
- if @show_incentive
.gl-px-5
= image_tag 'illustrations/gift.svg', class: 'gl-mb-3'
%p= html_escape(_('Receive a %{strongOpen}$50 gift card%{strongClose} as a thank you for your time.')) % { strongOpen: '<strong>'.html_safe, strongClose: '</strong>'.html_safe }
%p.gl-pt-2= link_to _("Let's talk!"), @invite_link, target: '_blank', rel: 'noopener noreferrer', class: 'gl-button btn btn-confirm'
- else
.gl-mt-11.gl-mb-6= image_tag 'illustrations/subscription-success.svg'
%h2.gl-font-weight-bold= header
%p= _('Your response has been recorded.')
...@@ -10,18 +10,21 @@ RSpec.describe SurveyResponsesController do ...@@ -10,18 +10,21 @@ RSpec.describe SurveyResponsesController do
subject(:request) { get survey_responses_path(params) } subject(:request) { get survey_responses_path(params) }
let(:ondotcom) { false } let(:default_params) do
let(:params) do
{ {
survey_id: '123', survey_id: '123',
instance_id: 'foo', instance_id: 'foo',
response: 'response text', response: 'response text',
bla: 'bar', bla: 'bar',
show_invite_link: 'true', show_invite_link: 'true',
show_incentive: 'true',
onboarding_progress: '4' onboarding_progress: '4'
} }
end end
let(:ondotcom) { false }
let(:params) { default_params }
describe 'tracking a snowplow event', :snowplow do describe 'tracking a snowplow event', :snowplow do
it 'does not track a survey_response event' do it 'does not track a survey_response event' do
request request
...@@ -85,5 +88,29 @@ RSpec.describe SurveyResponsesController do ...@@ -85,5 +88,29 @@ RSpec.describe SurveyResponsesController do
it { expect(assigns(:invite_link)).to be_nil } it { expect(assigns(:invite_link)).to be_nil }
end end
end end
describe 'show incentive' do
let(:ondotcom) { true }
let(:feature_flag_enabled) { true }
before do
stub_feature_flags(calendly_invite_link: feature_flag_enabled)
request
end
it { expect(assigns(:show_incentive)).to be true }
context "when 'show_incentive' parameter is not present in the URL" do
let(:params) { default_params.except(:show_incentive) }
it { expect(assigns(:show_incentive)).to be nil }
end
context 'when invite link is not set' do
let(:ondotcom) { false }
it { expect(assigns(:show_incentive)).to be nil }
end
end
end end
end end
...@@ -8,7 +8,11 @@ RSpec.describe 'survey_responses/index' do ...@@ -8,7 +8,11 @@ RSpec.describe 'survey_responses/index' do
render render
expect(rendered).to have_content(_('Thank you for your feedback!')) expect(rendered).to have_content(_('Thank you for your feedback!'))
expect(rendered).not_to have_content(_('We love speaking to our users. Got more to say about your GitLab experiences?')) expect(rendered).to have_content(_('Your response has been recorded.'))
expect(rendered).not_to have_content(_('Have more to say about GitLab?'))
expect(rendered).not_to have_content(_('Have a quick chat with us about your experience.'))
expect(rendered).not_to have_content(_('Receive a $50 gift card as a thank you for your time.'))
expect(rendered).not_to have_link(_("Let's talk!")) expect(rendered).not_to have_link(_("Let's talk!"))
end end
...@@ -17,11 +21,28 @@ RSpec.describe 'survey_responses/index' do ...@@ -17,11 +21,28 @@ RSpec.describe 'survey_responses/index' do
assign(:invite_link, SurveyResponsesController::CALENDLY_INVITE_LINK) assign(:invite_link, SurveyResponsesController::CALENDLY_INVITE_LINK)
end end
it 'shows additional text and an invite link' do it 'shows invitation text and link' do
render render
expect(rendered).to have_content(_('We love speaking to our users. Got more to say about your GitLab experiences?')) expect(rendered).to have_content(_('Have more to say about GitLab?'))
expect(rendered).to have_content(_('Have a quick chat with us about your experience.'))
expect(rendered).to have_link(_("Let's talk!"), href: SurveyResponsesController::CALENDLY_INVITE_LINK) expect(rendered).to have_link(_("Let's talk!"), href: SurveyResponsesController::CALENDLY_INVITE_LINK)
expect(rendered).not_to have_content(_('Receive a $50 gift card as a thank you for your time.'))
end
context 'when @show_incentive is true' do
before do
assign(:show_incentive, true)
end
it 'shows text about the incentive' do
render
expect(rendered).to have_content(_('Have more to say about GitLab?'))
expect(rendered).to have_content(_('Have a quick chat with us about your experience.'))
expect(rendered).to have_content(_('Receive a $50 gift card as a thank you for your time.'))
expect(rendered).to have_link(_("Let's talk!"), href: SurveyResponsesController::CALENDLY_INVITE_LINK)
end
end end
end end
end end
......
...@@ -43,7 +43,9 @@ module Gitlab ...@@ -43,7 +43,9 @@ module Gitlab
survey_id: EASE_SCORE_SURVEY_ID survey_id: EASE_SCORE_SURVEY_ID
} }
"#{Gitlab::Saas.com_url}/-/survey_responses?#{params.to_query}" params[:show_incentive] = true if show_incentive?
"#{gitlab_com_root_url}/-/survey_responses?#{params.to_query}"
end end
def feedback_ratings(rating) def feedback_ratings(rating)
...@@ -70,9 +72,19 @@ module Gitlab ...@@ -70,9 +72,19 @@ module Gitlab
def show_invite_link def show_invite_link
strong_memoize(:show_invite_link) do strong_memoize(:show_invite_link) do
group.member_count > 1 && group.max_member_access_for_user(user) >= GroupMember::DEVELOPER && user.preferred_language == 'en' group.max_member_access_for_user(user) >= GroupMember::DEVELOPER && user.preferred_language == 'en'
end end
end end
def show_incentive?
show_invite_link && group.member_count > 1
end
def gitlab_com_root_url
return root_url.chomp('/') if Rails.env.development?
Gitlab::Saas.com_url
end
end end
end end
end end
......
...@@ -16841,6 +16841,12 @@ msgstr "" ...@@ -16841,6 +16841,12 @@ msgstr ""
msgid "Hashed storage can't be disabled anymore for new projects" msgid "Hashed storage can't be disabled anymore for new projects"
msgstr "" msgstr ""
msgid "Have a quick chat with us about your experience."
msgstr ""
msgid "Have more to say about GitLab?"
msgstr ""
msgid "Header cannot be associated with both a request and a response" msgid "Header cannot be associated with both a request and a response"
msgstr "" msgstr ""
...@@ -28273,6 +28279,12 @@ msgstr "" ...@@ -28273,6 +28279,12 @@ msgstr ""
msgid "Recaptcha verified?" msgid "Recaptcha verified?"
msgstr "" msgstr ""
msgid "Receive a $50 gift card as a thank you for your time."
msgstr ""
msgid "Receive a %{strongOpen}$50 gift card%{strongClose} as a thank you for your time."
msgstr ""
msgid "Receive alerts from manually configured Prometheus servers." msgid "Receive alerts from manually configured Prometheus servers."
msgstr "" msgstr ""
...@@ -38350,9 +38362,6 @@ msgstr "" ...@@ -38350,9 +38362,6 @@ msgstr ""
msgid "We heard back from your device. You have been authenticated." msgid "We heard back from your device. You have been authenticated."
msgstr "" msgstr ""
msgid "We love speaking to our users. Got more to say about your GitLab experiences?"
msgstr ""
msgid "We recommend cloud-based mobile authenticator apps such as Authy, Duo Mobile, and LastPass. They can restore access if you lose your hardware device." msgid "We recommend cloud-based mobile authenticator apps such as Authy, Duo Mobile, and LastPass. They can restore access if you lose your hardware device."
msgstr "" msgstr ""
......
...@@ -22,14 +22,36 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Experience do ...@@ -22,14 +22,36 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Experience do
expect(message.cta_text).to be_nil expect(message.cta_text).to be_nil
end end
describe '#feedback_link' do describe 'feedback URL' do
let(:member_count) { 2 } before do
allow(message).to receive(:onboarding_progress).and_return(1)
allow(message).to receive(:show_invite_link).and_return(true)
end
subject do
message.feedback_link(1)
end
it { is_expected.to start_with(Gitlab::Saas.com_url) }
context 'when in development' do
let(:root_url) { 'http://example.com' }
before do
allow(message).to receive(:root_url).and_return(root_url)
stub_rails_env('development')
end
it { is_expected.to start_with(root_url) }
end
end
describe 'feedback URL show_invite_link query param' do
let(:user_access) { GroupMember::DEVELOPER } let(:user_access) { GroupMember::DEVELOPER }
let(:preferred_language) { 'en' } let(:preferred_language) { 'en' }
before do before do
allow(message).to receive(:onboarding_progress).and_return(1) allow(message).to receive(:onboarding_progress).and_return(1)
allow(group).to receive(:member_count).and_return(member_count)
allow(group).to receive(:max_member_access_for_user).and_return(user_access) allow(group).to receive(:max_member_access_for_user).and_return(user_access)
allow(user).to receive(:preferred_language).and_return(preferred_language) allow(user).to receive(:preferred_language).and_return(preferred_language)
end end
...@@ -41,12 +63,6 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Experience do ...@@ -41,12 +63,6 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Experience do
it { is_expected.to eq('true') } it { is_expected.to eq('true') }
context 'with only one member' do
let(:member_count) { 1 }
it { is_expected.to eq('false') }
end
context 'with less than developer access' do context 'with less than developer access' do
let(:user_access) { GroupMember::GUEST } let(:user_access) { GroupMember::GUEST }
...@@ -59,6 +75,41 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Experience do ...@@ -59,6 +75,41 @@ RSpec.describe Gitlab::Email::Message::InProductMarketing::Experience do
it { is_expected.to eq('false') } it { is_expected.to eq('false') }
end end
end end
describe 'feedback URL show_incentive query param' do
let(:show_invite_link) { true }
let(:member_count) { 2 }
let(:query) do
uri = URI.parse(message.feedback_link(1))
Rack::Utils.parse_query(uri.query).with_indifferent_access
end
before do
allow(message).to receive(:onboarding_progress).and_return(1)
allow(message).to receive(:show_invite_link).and_return(show_invite_link)
allow(group).to receive(:member_count).and_return(member_count)
end
subject { query[:show_incentive] }
it { is_expected.to eq('true') }
context 'with only one member' do
let(:member_count) { 1 }
it "is not present" do
expect(query).not_to have_key(:show_incentive)
end
end
context 'show_invite_link is false' do
let(:show_invite_link) { false }
it "is not present" do
expect(query).not_to have_key(:show_incentive)
end
end
end
end end
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