Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3fa500bd
Commit
3fa500bd
authored
Apr 20, 2021
by
Alper Akgun
Committed by
Vitaly Slobodin
Apr 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get Started page for the continuous onboarding experiment
parent
44fb7c26
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
67 additions
and
24 deletions
+67
-24
app/assets/images/learn_gitlab/get_started.svg
app/assets/images/learn_gitlab/get_started.svg
+1
-0
app/assets/images/learn_gitlab/rectangle.svg
app/assets/images/learn_gitlab/rectangle.svg
+1
-0
app/helpers/learn_gitlab_helper.rb
app/helpers/learn_gitlab_helper.rb
+6
-6
config/routes.rb
config/routes.rb
+1
-0
ee/app/controllers/ee/registrations/welcome_controller.rb
ee/app/controllers/ee/registrations/welcome_controller.rb
+7
-0
ee/app/controllers/registrations/projects_controller.rb
ee/app/controllers/registrations/projects_controller.rb
+6
-1
ee/app/views/registrations/welcome/continuous_onboarding_getting_started.html.haml
...s/welcome/continuous_onboarding_getting_started.html.haml
+11
-0
ee/spec/controllers/registrations/welcome_controller_spec.rb
ee/spec/controllers/registrations/welcome_controller_spec.rb
+31
-17
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
app/assets/images/learn_gitlab/get_started.svg
0 → 100644
View file @
3fa500bd
This diff is collapsed.
Click to expand it.
app/assets/images/learn_gitlab/rectangle.svg
0 → 100644
View file @
3fa500bd
<svg
width=
"108"
height=
"4"
fill=
"none"
xmlns=
"http://www.w3.org/2000/svg"
><rect
width=
"108"
height=
"4"
rx=
"2"
fill=
"#C2B7E6"
/></svg>
app/helpers/learn_gitlab_helper.rb
View file @
3fa500bd
...
...
@@ -3,7 +3,7 @@
module
LearnGitlabHelper
def
learn_gitlab_experiment_enabled?
(
project
)
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
)
end
...
...
@@ -21,6 +21,11 @@ module LearnGitlabHelper
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
ACTION_ISSUE_IDS
=
{
...
...
@@ -50,11 +55,6 @@ module LearnGitlabHelper
OnboardingProgress
.
find_by
(
namespace:
project
.
namespace
)
# rubocop: disable CodeReuse/ActiveRecord
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
)
OnboardingProgress
.
onboarding?
(
project
.
namespace
)
&&
LearnGitlab
.
new
(
current_user
).
available?
...
...
config/routes.rb
View file @
3fa500bd
...
...
@@ -51,6 +51,7 @@ Rails.application.routes.draw do
Gitlab
.
ee
do
get
:trial_getting_started
,
on: :collection
get
:trial_onboarding_board
,
on: :collection
get
:continuous_onboarding_getting_started
,
on: :collection
end
end
...
...
ee/app/controllers/ee/registrations/welcome_controller.rb
View file @
3fa500bd
...
...
@@ -14,6 +14,13 @@ module EE
render
locals:
{
learn_gitlab_project:
learn_gitlab_project
}
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
project
=
learn_gitlab_project
return
access_denied!
unless
current_user
.
id
==
project
.
creator_id
...
...
ee/app/controllers/registrations/projects_controller.rb
View file @
3fa500bd
...
...
@@ -2,6 +2,7 @@
module
Registrations
class
ProjectsController
<
ApplicationController
include
LearnGitlabHelper
layout
'checkout'
LEARN_GITLAB_TEMPLATE
=
'learn_gitlab.tar.gz'
...
...
@@ -39,9 +40,13 @@ module Registrations
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
)
else
if
continous_onboarding_experiment_enabled_for_user?
redirect_to
continuous_onboarding_getting_started_users_sign_up_welcome_path
(
project_id:
@project
.
id
)
else
redirect_to
users_sign_up_experience_level_path
(
namespace_path:
@project
.
namespace
)
end
end
else
render
:new
end
...
...
ee/app/views/registrations/welcome/continuous_onboarding_getting_started.html.haml
0 → 100644
View file @
3fa500bd
-
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'
ee/spec/controllers/registrations/welcome_controller_spec.rb
View file @
3fa500bd
...
...
@@ -7,6 +7,32 @@ RSpec.describe Registrations::WelcomeController do
let_it_be
(
:another_user
)
{
create
(
: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
subject
(
:trial_getting_started
)
do
get
:trial_getting_started
,
params:
{
learn_gitlab_project_id:
project
.
id
}
...
...
@@ -16,16 +42,12 @@ RSpec.describe Registrations::WelcomeController do
it
{
is_expected
.
to
redirect_to
new_user_session_path
}
end
context
'with the creator user signed'
do
context
'with the creator user signed
in
'
do
before
do
sign_in
(
user
)
end
it
'sets the learn_gitlab_project and renders'
do
subject
is_expected
.
to
render_template
(
:trial_getting_started
)
end
it
{
is_expected
.
to
render_template
(
:trial_getting_started
)
}
end
context
'with any other user signed in except the creator'
do
...
...
@@ -33,11 +55,7 @@ RSpec.describe Registrations::WelcomeController do
sign_in
(
another_user
)
end
it
'renders 404'
do
subject
is_expected
.
to
have_gitlab_http_status
(
:not_found
)
end
it
{
is_expected
.
to
have_gitlab_http_status
(
:not_found
)
}
end
end
...
...
@@ -55,14 +73,10 @@ RSpec.describe Registrations::WelcomeController do
sign_in
(
another_user
)
end
it
'renders 404'
do
subject
is_expected
.
to
have_gitlab_http_status
(
:not_found
)
end
it
{
is_expected
.
to
have_gitlab_http_status
(
:not_found
)
}
end
context
'with the creator user signed'
do
context
'with the creator user signed
in
'
do
before
do
sign_in
(
user
)
end
...
...
locale/gitlab.pot
View file @
3fa500bd
...
...
@@ -25952,6 +25952,9 @@ msgstr ""
msgid "Read more about related issues"
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"
msgstr ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment