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
02a8ada8
Commit
02a8ada8
authored
Jan 30, 2020
by
Alper Akgun
Committed by
Rémy Coutable
Jan 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trial form "for company" choice
Ask if a user is trying GitLab for his company or for his individual usage
parent
c2811c1c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
1 deletion
+37
-1
ee/app/controllers/trials_controller.rb
ee/app/controllers/trials_controller.rb
+1
-1
ee/app/views/trials/select.html.haml
ee/app/views/trials/select.html.haml
+9
-0
ee/changelogs/unreleased/119014-ask-if-a-user-is-trying-gitlab-for-his-company-or-for-his-indiv.yml
...ser-is-trying-gitlab-for-his-company-or-for-his-indiv.yml
+5
-0
ee/spec/controllers/trials_controller_spec.rb
ee/spec/controllers/trials_controller_spec.rb
+15
-0
ee/spec/features/trials/select_namespace_spec.rb
ee/spec/features/trials/select_namespace_spec.rb
+4
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
ee/app/controllers/trials_controller.rb
View file @
02a8ada8
...
...
@@ -66,7 +66,7 @@ class TrialsController < ApplicationController
gl_com_params
=
{
gitlab_com_trial:
true
,
sync_to_gl:
true
}
{
trial_user:
params
.
permit
(
:namespace_id
).
merge
(
gl_com_params
),
trial_user:
params
.
permit
(
:namespace_id
,
:trial_entity
).
merge
(
gl_com_params
),
uid:
current_user
.
id
}
end
...
...
ee/app/views/trials/select.html.haml
View file @
02a8ada8
...
...
@@ -15,6 +15,15 @@
#group_name
.form-group.hidden
=
label_tag
:new_group_name
,
_
(
'New Group Name'
),
for: :new_group_name
,
class:
'col-form-label'
=
text_field_tag
:new_group_name
,
nil
,
class:
'form-control'
.form-group
=
label_tag
:trial_entity
,
_
(
'Is this GitLab trial for your company?'
)
.gl-form-checkbox-group
.gl-form-checkbox.form-check.form-check-inline
=
radio_button_tag
:trial_entity
,
:company
,
false
,
required:
true
,
class:
'form-check-input'
=
label_tag
:trial_entity_company
,
_
(
'Yes'
),
class:
'form-check-label'
.gl-form-checkbox.form-check.form-check-inline
=
radio_button_tag
:trial_entity
,
:individual
,
false
,
required:
true
,
class:
'form-check-input'
=
label_tag
:trial_entity_individual
,
_
(
'No'
),
class:
'form-check-label'
=
submit_tag
_
(
'Start your free trial'
),
class:
'btn btn-success btn-block'
=
render
'skip_trial'
ee/changelogs/unreleased/119014-ask-if-a-user-is-trying-gitlab-for-his-company-or-for-his-indiv.yml
0 → 100644
View file @
02a8ada8
---
title
:
Ask if a user is trying GitLab for his company or for his individual usage
merge_request
:
22280
author
:
type
:
added
ee/spec/controllers/trials_controller_spec.rb
View file @
02a8ada8
...
...
@@ -152,5 +152,20 @@ describe TrialsController do
end
end
end
it
"calls the ApplyTrialService with correct parameters"
do
gl_com_params
=
{
gitlab_com_trial:
true
,
sync_to_gl:
true
}
post_params
=
{
namespace_id:
namespace
.
id
.
to_s
,
trial_entity:
'company'
}
apply_trial_params
=
{
uid:
user
.
id
,
trial_user:
ActionController
::
Parameters
.
new
(
post_params
).
permit
(
:namespace_id
,
:trial_entity
).
merge
(
gl_com_params
)
}
expect_next_instance_of
(
GitlabSubscriptions
::
ApplyTrialService
)
do
|
service
|
expect
(
service
).
to
receive
(
:execute
).
with
(
apply_trial_params
).
and_return
({
success:
true
})
end
post
:apply
,
params:
post_params
end
end
end
ee/spec/features/trials/select_namespace_spec.rb
View file @
02a8ada8
...
...
@@ -19,11 +19,13 @@ describe 'Trial Select Namespace', :js do
visit
select_trials_path
wait_for_all_requests
choose
:trial_entity_company
select2
'0'
,
from:
'#namespace_id'
end
it
'shows the new group name input'
do
expect
(
page
).
to
have_field
(
'New Group Name'
)
expect
(
page
).
to
have_content
(
'Is this GitLab trial for your company?'
)
end
context
'enters a valid new group name'
do
...
...
@@ -99,12 +101,14 @@ describe 'Trial Select Namespace', :js do
visit
select_trials_path
wait_for_all_requests
choose
:trial_entity_company
select2
user
.
namespace
.
id
,
from:
'#namespace_id'
end
context
'without trial plan'
do
it
'does not show the new group name input'
do
expect
(
page
).
not_to
have_field
(
'New Group Name'
)
expect
(
page
).
to
have_content
(
'Is this GitLab trial for your company?'
)
end
it
'applies trial and redirects to dashboard'
do
...
...
locale/gitlab.pot
View file @
02a8ada8
...
...
@@ -10470,6 +10470,9 @@ msgstr ""
msgid "Is blocked by"
msgstr ""
msgid "Is this GitLab trial for your company?"
msgstr ""
msgid "Is using license seat:"
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