Commit 69caa069 authored by Dallas Reedy's avatar Dallas Reedy Committed by Douglas Barbosa Alexandre

Add Experience Level page for new signup flow

- Add route for /users/sign_up/experience_level
- Add action RegistrationsController#experience_level
- Add view for registrations/experience_level
- Populate view with very simplified version of content
- Add new translations to gettext
parent bedde99a
......@@ -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
......
......@@ -8981,6 +8981,9 @@ msgstr ""
msgid "Expand up"
msgstr ""
msgid "Experienced"
msgstr ""
msgid "Expiration"
msgstr ""
......@@ -12200,6 +12203,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 ""
......@@ -14780,6 +14789,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 ""
......@@ -19830,9 +19842,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 ""
......@@ -24607,12 +24625,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