Commit 3fa500bd authored by Alper Akgun's avatar Alper Akgun Committed by Vitaly Slobodin

Get Started page for the continuous onboarding experiment

parent 44fb7c26
This diff is collapsed.
<svg width="108" height="4" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="108" height="4" rx="2" fill="#C2B7E6"/></svg>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module LearnGitlabHelper module LearnGitlabHelper
def learn_gitlab_experiment_enabled?(project) def learn_gitlab_experiment_enabled?(project)
return false unless current_user return false unless current_user
return false unless experiment_enabled_for_user? return false unless continous_onboarding_experiment_enabled_for_user?
learn_gitlab_onboarding_available?(project) learn_gitlab_onboarding_available?(project)
end end
...@@ -21,6 +21,11 @@ module LearnGitlabHelper ...@@ -21,6 +21,11 @@ module LearnGitlabHelper
end end
end end
def continous_onboarding_experiment_enabled_for_user?
Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_a, subject: current_user) ||
Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_b, subject: current_user)
end
private private
ACTION_ISSUE_IDS = { ACTION_ISSUE_IDS = {
...@@ -50,11 +55,6 @@ module LearnGitlabHelper ...@@ -50,11 +55,6 @@ module LearnGitlabHelper
OnboardingProgress.find_by(namespace: project.namespace) # rubocop: disable CodeReuse/ActiveRecord OnboardingProgress.find_by(namespace: project.namespace) # rubocop: disable CodeReuse/ActiveRecord
end end
def experiment_enabled_for_user?
Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_a, subject: current_user) ||
Gitlab::Experimentation.in_experiment_group?(:learn_gitlab_b, subject: current_user)
end
def learn_gitlab_onboarding_available?(project) def learn_gitlab_onboarding_available?(project)
OnboardingProgress.onboarding?(project.namespace) && OnboardingProgress.onboarding?(project.namespace) &&
LearnGitlab.new(current_user).available? LearnGitlab.new(current_user).available?
......
...@@ -51,6 +51,7 @@ Rails.application.routes.draw do ...@@ -51,6 +51,7 @@ Rails.application.routes.draw do
Gitlab.ee do Gitlab.ee do
get :trial_getting_started, on: :collection get :trial_getting_started, on: :collection
get :trial_onboarding_board, on: :collection get :trial_onboarding_board, on: :collection
get :continuous_onboarding_getting_started, on: :collection
end end
end end
......
...@@ -14,6 +14,13 @@ module EE ...@@ -14,6 +14,13 @@ module EE
render locals: { learn_gitlab_project: learn_gitlab_project } render locals: { learn_gitlab_project: learn_gitlab_project }
end end
def continuous_onboarding_getting_started
project = ::Project.find(params[:project_id])
return access_denied! unless current_user.id == project.creator_id
render locals: { project: project }
end
def trial_onboarding_board def trial_onboarding_board
project = learn_gitlab_project project = learn_gitlab_project
return access_denied! unless current_user.id == project.creator_id return access_denied! unless current_user.id == project.creator_id
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
module Registrations module Registrations
class ProjectsController < ApplicationController class ProjectsController < ApplicationController
include LearnGitlabHelper
layout 'checkout' layout 'checkout'
LEARN_GITLAB_TEMPLATE = 'learn_gitlab.tar.gz' LEARN_GITLAB_TEMPLATE = 'learn_gitlab.tar.gz'
...@@ -39,9 +40,13 @@ module Registrations ...@@ -39,9 +40,13 @@ module Registrations
record_experiment_conversion_event(:trial_onboarding_issues) record_experiment_conversion_event(:trial_onboarding_issues)
redirect_to trial_getting_started_users_sign_up_welcome_path(learn_gitlab_project_id: learn_gitlab_project.id) redirect_to trial_getting_started_users_sign_up_welcome_path(learn_gitlab_project_id: learn_gitlab_project.id)
else
if continous_onboarding_experiment_enabled_for_user?
redirect_to continuous_onboarding_getting_started_users_sign_up_welcome_path(project_id: @project.id)
else else
redirect_to users_sign_up_experience_level_path(namespace_path: @project.namespace) redirect_to users_sign_up_experience_level_path(namespace_path: @project.namespace)
end end
end
else else
render :new render :new
end end
......
- return unless project
- page_title _('Get started with GitLab')
.row.gl-flex-grow-1.gl-p-5
.gl-display-flex.gl-flex-direction-column.gl-align-items-center.gl-w-full
.gl-display-flex.gl-flex-direction-column.gl-align-items-center.gl-pt-7.gl-mt-7.mw-460
= image_tag 'learn-gitlab-avatar.jpg', width: '90'
%h2.gl-text-center.gl-my-5= _('Get started with GitLab')
%p.gl-text-center.gl-text-gray-700.gl-mb-7= _('Ready to get started with GitLab? Follow these steps to set up your workspace, plan and commit changes, and deploy your project.')
= image_tag 'learn_gitlab/get_started.svg', width: '400', class: 'gl-max-w-full'
%div= link_to s_("Ok, let's go"), project_learn_gitlab_path(project), class: 'btn btn-success gl-button gl-mt-7'
...@@ -7,6 +7,32 @@ RSpec.describe Registrations::WelcomeController do ...@@ -7,6 +7,32 @@ RSpec.describe Registrations::WelcomeController do
let_it_be(:another_user) { create(:user) } let_it_be(:another_user) { create(:user) }
let_it_be(:project) { create(:project, creator: user) } let_it_be(:project) { create(:project, creator: user) }
describe '#continuous_onboarding_getting_started' do
subject(:continuous_onboarding_getting_started) do
get :continuous_onboarding_getting_started, params: { project_id: project.id }
end
context 'without a signed in user' do
it { is_expected.to redirect_to new_user_session_path }
end
context 'with the creator user signed in' do
before do
sign_in(user)
end
it { is_expected.to render_template(:continuous_onboarding_getting_started) }
end
context 'with any other user signed in except the creator' do
before do
sign_in(another_user)
end
it { is_expected.to have_gitlab_http_status(:not_found) }
end
end
describe '#trial_getting_started' do describe '#trial_getting_started' do
subject(:trial_getting_started) do subject(:trial_getting_started) do
get :trial_getting_started, params: { learn_gitlab_project_id: project.id } get :trial_getting_started, params: { learn_gitlab_project_id: project.id }
...@@ -16,16 +42,12 @@ RSpec.describe Registrations::WelcomeController do ...@@ -16,16 +42,12 @@ RSpec.describe Registrations::WelcomeController do
it { is_expected.to redirect_to new_user_session_path } it { is_expected.to redirect_to new_user_session_path }
end end
context 'with the creator user signed' do context 'with the creator user signed in' do
before do before do
sign_in(user) sign_in(user)
end end
it 'sets the learn_gitlab_project and renders' do it { is_expected.to render_template(:trial_getting_started) }
subject
is_expected.to render_template(:trial_getting_started)
end
end end
context 'with any other user signed in except the creator' do context 'with any other user signed in except the creator' do
...@@ -33,11 +55,7 @@ RSpec.describe Registrations::WelcomeController do ...@@ -33,11 +55,7 @@ RSpec.describe Registrations::WelcomeController do
sign_in(another_user) sign_in(another_user)
end end
it 'renders 404' do it { is_expected.to have_gitlab_http_status(:not_found) }
subject
is_expected.to have_gitlab_http_status(:not_found)
end
end end
end end
...@@ -55,14 +73,10 @@ RSpec.describe Registrations::WelcomeController do ...@@ -55,14 +73,10 @@ RSpec.describe Registrations::WelcomeController do
sign_in(another_user) sign_in(another_user)
end end
it 'renders 404' do it { is_expected.to have_gitlab_http_status(:not_found) }
subject
is_expected.to have_gitlab_http_status(:not_found)
end
end end
context 'with the creator user signed' do context 'with the creator user signed in' do
before do before do
sign_in(user) sign_in(user)
end end
......
...@@ -25952,6 +25952,9 @@ msgstr "" ...@@ -25952,6 +25952,9 @@ msgstr ""
msgid "Read more about related issues" msgid "Read more about related issues"
msgstr "" msgstr ""
msgid "Ready to get started with GitLab? Follow these steps to set up your workspace, plan and commit changes, and deploy your project."
msgstr ""
msgid "Real-time features" msgid "Real-time features"
msgstr "" msgstr ""
......
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