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
70df9386
Commit
70df9386
authored
Sep 18, 2020
by
Doug Stull
Committed by
Mayra Cabrera
Sep 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip asking about what you will use for when invited
- simplify signup flow.
parent
c6da83ef
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
2 deletions
+90
-2
ee/app/helpers/ee/registrations_helper.rb
ee/app/helpers/ee/registrations_helper.rb
+4
-0
ee/app/views/registrations/welcome/_setup_for_company.html.haml
.../views/registrations/welcome/_setup_for_company.html.haml
+5
-1
ee/changelogs/unreleased/221028-skip-the-who-will-be-using-gitlab-question-in-signup-when-a-use.yml
...ho-will-be-using-gitlab-question-in-signup-when-a-use.yml
+5
-0
ee/spec/features/invites_spec.rb
ee/spec/features/invites_spec.rb
+56
-0
ee/spec/helpers/ee/registrations_helper_spec.rb
ee/spec/helpers/ee/registrations_helper_spec.rb
+19
-0
spec/features/invites_spec.rb
spec/features/invites_spec.rb
+1
-1
No files found.
ee/app/helpers/ee/registrations_helper.rb
View file @
70df9386
...
@@ -61,6 +61,10 @@ module EE
...
@@ -61,6 +61,10 @@ module EE
experiment_enabled?
(
:onboarding_issues
)
experiment_enabled?
(
:onboarding_issues
)
end
end
def
skip_setup_for_company?
current_user
.
members
.
any?
end
private
private
def
redirect_path
def
redirect_path
...
...
ee/app/views/registrations/welcome/_setup_for_company.html.haml
View file @
70df9386
-
if
Gitlab
.
com?
-
return
unless
Gitlab
.
dev_env_or_com?
-
if
skip_setup_for_company?
=
f
.
hidden_field
:setup_for_company
,
value:
true
-
else
.row
.row
.form-group.col-sm-12
.form-group.col-sm-12
=
f
.
label
:setup_for_company
,
setup_for_company_label_text
,
class:
'label-bold'
=
f
.
label
:setup_for_company
,
setup_for_company_label_text
,
class:
'label-bold'
...
...
ee/changelogs/unreleased/221028-skip-the-who-will-be-using-gitlab-question-in-signup-when-a-use.yml
0 → 100644
View file @
70df9386
---
title
:
Skip the who will be using GitLab question in signup when a user is invited
merge_request
:
42264
author
:
type
:
changed
ee/spec/features/invites_spec.rb
0 → 100644
View file @
70df9386
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Group or Project invitations'
do
let
(
:group
)
{
create
(
:group
,
name:
'Owned'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
group
)
}
let
(
:group_invite
)
{
create
(
:group_member
,
:invited
,
group:
group
)
}
let
(
:new_user
)
{
build_stubbed
(
:user
,
email:
group_invite
.
invite_email
)
}
let
(
:dev_env_or_com
)
{
true
}
before
do
allow
(
::
Gitlab
).
to
receive
(
:dev_env_or_com?
).
and_return
(
dev_env_or_com
)
visit
invite_path
(
group_invite
.
raw_invite_token
)
end
def
fill_in_sign_up_form
(
user
)
fill_in
'new_user_name'
,
with:
user
.
name
fill_in
'new_user_username'
,
with:
user
.
username
fill_in
'new_user_email'
,
with:
user
.
email
fill_in
'new_user_password'
,
with:
user
.
password
click_button
'Register'
end
context
'when on .com'
do
context
'without setup question'
do
it
'bypasses the setup_for_company question'
do
fill_in_sign_up_form
(
new_user
)
expect
(
find
(
'input[name="user[setup_for_company]"]'
,
visible: :hidden
).
value
).
to
eq
'true'
expect
(
page
).
not_to
have_content
(
'My company or team'
)
end
end
context
'with setup question'
do
let
(
:new_user
)
{
build_stubbed
(
:user
,
email:
'bogus@me.com'
)
}
it
'has the setup question'
do
fill_in_sign_up_form
(
new_user
)
expect
(
page
).
to
have_content
(
'My company or team'
)
end
end
end
context
'when not on .com'
do
let
(
:dev_env_or_com
)
{
false
}
it
'bypasses the setup_for_company question'
do
fill_in_sign_up_form
(
new_user
)
expect
(
page
).
not_to
have_content
(
'My company or team'
)
end
end
end
ee/spec/helpers/ee/registrations_helper_spec.rb
View file @
70df9386
...
@@ -244,4 +244,23 @@ RSpec.describe EE::RegistrationsHelper do
...
@@ -244,4 +244,23 @@ RSpec.describe EE::RegistrationsHelper do
end
end
end
end
end
end
describe
'#skip_setup_for_company?'
do
let
(
:user
)
{
create
(
:user
)
}
before
do
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
end
it
'will skip the setup if memberships are found'
do
member
=
create
(
:project_member
,
:invited
)
member
.
accept_invite!
(
user
)
expect
(
helper
.
skip_setup_for_company?
).
to
be
true
end
it
'will not skip the setup when a user has no memberships'
do
expect
(
helper
.
skip_setup_for_company?
).
to
be
false
end
end
end
end
spec/features/invites_spec.rb
View file @
70df9386
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
'
Invite
s'
,
:aggregate_failures
do
RSpec
.
describe
'
Group or Project invitation
s'
,
:aggregate_failures
do
let
(
:user
)
{
create
(
:user
,
email:
'user@example.com'
)
}
let
(
:user
)
{
create
(
:user
,
email:
'user@example.com'
)
}
let
(
:owner
)
{
create
(
:user
,
name:
'John Doe'
)
}
let
(
:owner
)
{
create
(
:user
,
name:
'John Doe'
)
}
let
(
:group
)
{
create
(
:group
,
name:
'Owned'
)
}
let
(
:group
)
{
create
(
:group
,
name:
'Owned'
)
}
...
...
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