Commit 59d7f1ba authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'growth/engineering/5363-experience-level-page' into 'master'

Add sign-up Experience Level page

See merge request gitlab-org/gitlab!31415
parents 66c29f27 69caa069
......@@ -14,6 +14,7 @@ class RegistrationsController < Devise::RegistrationsController
before_action :ensure_terms_accepted,
if: -> { action_name == 'create' && Gitlab::CurrentSettings.current_application_settings.enforce_terms? }
before_action :load_recaptcha, only: :new
before_action :authenticate_user!, only: :experience_level
def new
if experiment_enabled?(:signup_flow)
......@@ -57,6 +58,10 @@ class RegistrationsController < Devise::RegistrationsController
return redirect_to path_for_signed_in_user(current_user) if current_user.role.present? && !current_user.setup_for_company.nil?
end
def experience_level
return access_denied! unless experiment_enabled?(:onboarding_issues)
end
def update_registration
user_params = params.require(:user).permit(:role, :setup_for_company)
result = ::Users::SignupService.new(current_user, user_params).execute
......
- content_for(:page_title, _('What’s your experience level?'))
%h3= _('Hello there')
%p= _('Welcome to the guided GitLab tour')
%br
%h5= _('What describes you best?')
%hr
%div
%p
%b= _('Novice')
%p= _('I’m not very familiar with the basics of project management and DevOps.')
%p
%a{ href: '#novice' }= _('Show me everything')
%hr
%div
%p
%b= _('Experienced')
%p= _('I’m familiar with the basics of project management and DevOps.')
%p
%a{ href: '#experienced' }= _('Show me more advanced stuff')
......@@ -46,6 +46,7 @@ Rails.application.routes.draw do
# Sign up
get 'users/sign_up/welcome' => 'registrations#welcome'
get 'users/sign_up/experience_level' => 'registrations#experience_level'
patch 'users/sign_up/update_registration' => 'registrations#update_registration'
# Search
......
......@@ -8995,6 +8995,9 @@ msgstr ""
msgid "Expand up"
msgstr ""
msgid "Experienced"
msgstr ""
msgid "Expiration"
msgstr ""
......@@ -12220,6 +12223,12 @@ msgstr ""
msgid "Iteration|cannot be more than 500 years in the future"
msgstr ""
msgid "I’m familiar with the basics of project management and DevOps."
msgstr ""
msgid "I’m not very familiar with the basics of project management and DevOps."
msgstr ""
msgid "Jaeger URL"
msgstr ""
......@@ -14803,6 +14812,9 @@ msgstr ""
msgid "November"
msgstr ""
msgid "Novice"
msgstr ""
msgid "Now you can access the merge request navigation tabs at the top, where they’re easier to find."
msgstr ""
......@@ -19874,9 +19886,15 @@ msgstr ""
msgid "Show latest version"
msgstr ""
msgid "Show me everything"
msgstr ""
msgid "Show me how"
msgstr ""
msgid "Show me more advanced stuff"
msgstr ""
msgid "Show only direct members"
msgstr ""
......@@ -24654,12 +24672,21 @@ msgstr ""
msgid "Welcome to the Guided GitLab Tour"
msgstr ""
msgid "Welcome to the guided GitLab tour"
msgstr ""
msgid "Welcome to your Issue Board!"
msgstr ""
msgid "What are you searching for?"
msgstr ""
msgid "What describes you best?"
msgstr ""
msgid "What’s your experience level?"
msgstr ""
msgid "When a deployment job is successful, skip older deployment jobs that are still pending"
msgstr ""
......
......@@ -445,4 +445,27 @@ describe RegistrationsController do
end
end
end
describe '#experience_level' do
subject { get :experience_level }
let_it_be(:user) { create(:user) }
let(:part_of_onboarding_issues_experiment) { false }
before do
stub_experiment_for_user(onboarding_issues: part_of_onboarding_issues_experiment)
sign_in(user)
end
context 'when not part of the onboarding issues experiment' do
it { is_expected.to have_gitlab_http_status(:not_found) }
end
context 'when part of the onboarding issues experiment' do
let(:part_of_onboarding_issues_experiment) { true }
it { is_expected.to render_template(:experience_level) }
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