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
4ad03a4d
Commit
4ad03a4d
authored
Jul 14, 2021
by
Alper Akgun
Committed by
Doug Stull
Jul 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Redirect in-app trial users to the trial source
parent
3ffa2478
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
14 deletions
+67
-14
config/feature_flags/experiment/redirect_trial_user_to_feature.yml
...ature_flags/experiment/redirect_trial_user_to_feature.yml
+8
-0
ee/app/controllers/trials_controller.rb
ee/app/controllers/trials_controller.rb
+17
-1
ee/app/views/groups/security/dashboard/show.html.haml
ee/app/views/groups/security/dashboard/show.html.haml
+1
-0
ee/app/views/registrations/_trial_is_activated_banner.html.haml
.../views/registrations/_trial_is_activated_banner.html.haml
+9
-7
ee/app/views/registrations/group_invites/new.html.haml
ee/app/views/registrations/group_invites/new.html.haml
+1
-3
ee/app/views/registrations/projects/new.html.haml
ee/app/views/registrations/projects/new.html.haml
+1
-3
ee/spec/controllers/trials_controller_spec.rb
ee/spec/controllers/trials_controller_spec.rb
+30
-0
No files found.
config/feature_flags/experiment/redirect_trial_user_to_feature.yml
0 → 100644
View file @
4ad03a4d
---
name
:
redirect_trial_user_to_feature
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65450
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/335824
milestone
:
'
14.1'
type
:
experiment
group
:
group::conversion
default_enabled
:
false
ee/app/controllers/trials_controller.rb
View file @
4ad03a4d
...
...
@@ -45,7 +45,11 @@ class TrialsController < ApplicationController
record_experiment_conversion_event
(
:remove_known_trial_form_fields
)
record_experiment_conversion_event
(
:trial_onboarding_issues
)
redirect_to
group_url
(
@namespace
,
{
trial:
true
})
if
discover_group_security_flow?
redirect_trial_user_to_feature_experiment_flow
else
redirect_to
group_url
(
@namespace
,
{
trial:
true
})
end
else
render
:select
end
...
...
@@ -177,4 +181,16 @@ class TrialsController < ApplicationController
company_name_present:
current_user
.
organization
.
present?
}
end
def
redirect_trial_user_to_feature_experiment_flow
experiment
(
:redirect_trial_user_to_feature
,
namespace:
@namespace
)
do
|
e
|
e
.
record!
e
.
use
{
redirect_to
group_url
(
@namespace
,
{
trial:
true
})
}
e
.
try
{
redirect_to
group_security_dashboard_url
(
@namespace
,
{
trial:
true
})
}
end
end
def
discover_group_security_flow?
params
[
:glm_content
]
==
'discover-group-security'
end
end
ee/app/views/groups/security/dashboard/show.html.haml
View file @
4ad03a4d
...
...
@@ -2,4 +2,5 @@
-
page_title
_
(
"Security Dashboard"
)
-
add_page_specific_style
'page_bundles/security_dashboard'
=
render
'registrations/trial_is_activated_banner'
if
params
[
:trial
]
==
'true'
#js-group-security-dashboard
{
data:
group_level_security_dashboard_data
(
@group
)
}
ee/app/views/registrations/_trial_is_activated_banner.html.haml
View file @
4ad03a4d
%section
.gl-banner.gl-banner-introduction
{
data:
{
uid:
'trial_success_banner_dismissed'
}
}
.gl-banner-illustration
=
image_tag
(
'illustrations/illustration-congratulation-purchase.svg'
,
alt:
s_
(
'Trial|Successful trial activation image'
))
.gl-banner-content.gl-my-auto
%h3
.gl-banner-title
=
_
(
'Congratulations, your free trial is activated.'
)
%button
.gl-banner-close.close.js-close-session.js-close-callout
{
type:
'button'
,
'aria-label'
=>
s_
(
'Trial|Dismiss'
)
}
=
sprite_icon
(
'close'
,
css_class:
'dismiss-icon'
)
.row
.gl-display-flex.gl-flex-direction-column.gl-align-items-center.gl-w-full.gl-mt-3
%section
.gl-banner.gl-banner-introduction
{
data:
{
uid:
'trial_success_banner_dismissed'
}
}
.gl-banner-illustration
=
image_tag
(
'illustrations/illustration-congratulation-purchase.svg'
,
alt:
s_
(
'Trial|Successful trial activation image'
))
.gl-banner-content.gl-my-auto
%h3
.gl-banner-title
=
_
(
'Congratulations, your free trial is activated.'
)
%button
.gl-banner-close.close.js-close-session.js-close-callout
{
type:
'button'
,
'aria-label'
=>
s_
(
'Trial|Dismiss'
)
}
=
sprite_icon
(
'close'
,
css_class:
'dismiss-icon'
)
ee/app/views/registrations/group_invites/new.html.haml
View file @
4ad03a4d
-
page_title
s_
(
'InviteMember|Invite teammates to your GitLab group'
)
-
if
in_trial_during_signup_flow?
||
in_trial_onboarding_flow?
.row
.gl-display-flex.gl-flex-direction-column.gl-align-items-center.gl-w-full.gl-mt-3
=
render
'registrations/trial_is_activated_banner'
=
render
'registrations/trial_is_activated_banner'
.row.gl-flex-grow-1
.gl-display-flex.gl-flex-direction-column.gl-align-items-center.gl-w-full.p-3.gl-bg-gray-10
.group-invites.gl-display-flex.gl-flex-direction-column.gl-align-items-center.pt-5
...
...
ee/app/views/registrations/projects/new.html.haml
View file @
4ad03a4d
...
...
@@ -3,9 +3,7 @@
-
visibility_level
=
selected_visibility_level
(
@project
,
params
.
dig
(
:project
,
:visibility_level
))
-
if
!
already_showed_trial_activation?
&&
(
in_trial_during_signup_flow?
||
in_trial_onboarding_flow?
)
.row
.gl-display-flex.gl-flex-direction-column.gl-align-items-center.gl-w-full.gl-mt-3
=
render
'registrations/trial_is_activated_banner'
=
render
'registrations/trial_is_activated_banner'
.row.gl-flex-grow-1
.gl-display-flex.gl-align-items-center.gl-flex-direction-column.gl-w-full.gl-px-5.gl-pb-5
.new-project.gl-display-flex.gl-flex-direction-column.gl-align-items-center
...
...
ee/spec/controllers/trials_controller_spec.rb
View file @
4ad03a4d
...
...
@@ -198,6 +198,36 @@ RSpec.describe TrialsController do
subject
end
context
'in discover group security flow'
do
let
(
:post_params
)
{
{
namespace_id:
namespace
.
id
,
glm_content:
'discover-group-security'
}
}
context
'with redirect_trial_user_to_feature experiment variant'
do
before
do
stub_experiments
(
redirect_trial_user_to_feature: :candidate
)
end
it
{
is_expected
.
to
redirect_to
(
group_security_dashboard_url
(
namespace
,
{
trial:
true
}))
}
it
'records the subject'
do
expect
(
Experiment
).
to
receive
(
:add_subject
).
with
(
'redirect_trial_user_to_feature'
,
variant: :experimental
,
subject:
namespace
)
subject
end
end
context
'with redirect_trial_user_to_feature experiment control'
do
before
do
stub_experiments
(
redirect_trial_user_to_feature: :control
)
end
it
{
is_expected
.
to
redirect_to
(
group_url
(
namespace
,
{
trial:
true
}))
}
it
'records the subject'
do
expect
(
Experiment
).
to
receive
(
:add_subject
).
with
(
'redirect_trial_user_to_feature'
,
variant: :control
,
subject:
namespace
)
subject
end
end
end
context
'with a new Group'
do
let
(
:post_params
)
{
{
new_group_name:
'GitLab'
}
}
...
...
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