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
d4bf55ba
Commit
d4bf55ba
authored
Oct 20, 2020
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add invite members to empty group page
- for experimenting if that gets used.
parent
2cf100d5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
44 deletions
+102
-44
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+2
-0
app/helpers/invite_members_helper.rb
app/helpers/invite_members_helper.rb
+4
-0
app/views/dashboard/groups/index.html.haml
app/views/dashboard/groups/index.html.haml
+2
-1
app/views/shared/groups/_empty_state.html.haml
app/views/shared/groups/_empty_state.html.haml
+8
-3
lib/gitlab/experimentation.rb
lib/gitlab/experimentation.rb
+3
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/helpers/invite_members_helper_spec.rb
spec/helpers/invite_members_helper_spec.rb
+80
-40
No files found.
app/controllers/groups_controller.rb
View file @
d4bf55ba
...
...
@@ -193,6 +193,8 @@ class GroupsController < Groups::ApplicationController
protected
def
render_show_html
record_experiment_user
(
:invite_members_empty_group_version_a
)
if
::
Gitlab
.
com?
render
'groups/show'
,
locals:
{
trial:
params
[
:trial
]
}
end
...
...
app/helpers/invite_members_helper.rb
View file @
d4bf55ba
...
...
@@ -18,4 +18,8 @@ module InviteMembersHelper
experiment_enabled?
(
:invite_members_version_b
)
&&
!
can_import_members?
end
end
def
invite_group_members?
(
group
)
experiment_enabled?
(
:invite_members_empty_group_version_a
)
&&
Ability
.
allowed?
(
current_user
,
:admin_group_member
,
group
)
end
end
app/views/dashboard/groups/index.html.haml
View file @
d4bf55ba
...
...
@@ -6,6 +6,7 @@
=
render
'dashboard/groups_head'
-
if
params
[
:filter
].
blank?
&&
@groups
.
empty?
=
render
'shared/groups/empty_state'
.empty-state
=
render
'shared/groups/empty_state'
-
else
=
render
'groups'
app/views/shared/groups/_empty_state.html.haml
View file @
d4bf55ba
.
group-empty-state.row.align-items-center.
justify-content-center
.
icon.text-center.
order-md-2
.
row.gl-align-items-center.gl-
justify-content-center
.order-md-2
=
custom_icon
(
"icon_empty_groups"
)
.text-content.
m-0.order-md-1
.text-content.
order-md-1
{
class:
'gl-m-0!'
}
%h4
=
s_
(
"GroupsEmptyState|A group is a collection of several projects."
)
%p
=
s_
(
"GroupsEmptyState|If you organize your projects under a group, it works like a folder."
)
%p
=
s_
(
"GroupsEmptyState|You can manage your group member’s permissions and access to each project in the group."
)
-
if
invite_group_members?
(
@group
)
=
link_to
_
(
'Invite your team'
),
group_group_members_path
(
@group
),
class:
'gl-button btn btn-success-secondary'
,
data:
{
track_event:
'click_invite_team_group_empty_state'
,
track_label:
'invite_team_group_empty_state'
}
lib/gitlab/experimentation.rb
View file @
d4bf55ba
...
...
@@ -51,6 +51,9 @@ module Gitlab
invite_members_version_b:
{
tracking_category:
'Growth::Expansion::Experiment::InviteMembersVersionB'
},
invite_members_empty_group_version_a:
{
tracking_category:
'Growth::Expansion::Experiment::InviteMembersEmptyGroupVersionA'
},
new_create_project_ui:
{
tracking_category:
'Manage::Import::Experiment::NewCreateProjectUi'
},
...
...
locale/gitlab.pot
View file @
d4bf55ba
...
...
@@ -14398,6 +14398,9 @@ msgstr ""
msgid "Invite teammates (optional)"
msgstr ""
msgid "Invite your team"
msgstr ""
msgid "InviteEmail|%{inviter} invited you to join the %{project_or_group_name} %{project_or_group} as a %{role}"
msgstr ""
...
...
spec/helpers/invite_members_helper_spec.rb
View file @
d4bf55ba
...
...
@@ -7,70 +7,110 @@ RSpec.describe InviteMembersHelper do
let_it_be
(
:developer
)
{
create
(
:user
,
developer_projects:
[
project
])
}
let
(
:owner
)
{
project
.
owner
}
before
do
assign
(
:project
,
project
)
end
context
'with project'
do
before
do
assign
(
:project
,
project
)
end
describe
"#directly_invite_members?"
do
context
'when the user is an owner'
do
before
do
allow
(
helper
).
to
receive
(
:current_user
)
{
owner
}
end
describe
"#directly_invite_members?"
do
context
'when the user is an owner'
do
before
do
allow
(
helper
).
to
receive
(
:current_user
)
{
owner
}
end
it
'returns false'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_a
)
{
false
}
it
'returns false'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_a
)
{
false
}
expect
(
helper
.
directly_invite_members?
).
to
eq
false
end
expect
(
helper
.
directly_invite_members?
).
to
eq
false
it
'returns true'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_a
)
{
true
}
expect
(
helper
.
directly_invite_members?
).
to
eq
true
end
end
it
'returns true'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_a
)
{
true
}
context
'when the user is a developer'
do
before
do
allow
(
helper
).
to
receive
(
:current_user
)
{
developer
}
end
it
'returns false'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_a
)
{
true
}
expect
(
helper
.
directly_invite_members?
).
to
eq
true
expect
(
helper
.
directly_invite_members?
).
to
eq
false
end
end
end
context
'when the user is a developer'
do
before
do
allow
(
helper
).
to
receive
(
:current_user
)
{
developer
}
describe
"#indirectly_invite_members?"
do
context
'when a user is a developer'
do
before
do
allow
(
helper
).
to
receive
(
:current_user
)
{
developer
}
end
it
'returns false'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_b
)
{
false
}
expect
(
helper
.
indirectly_invite_members?
).
to
eq
false
end
it
'returns true'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_b
)
{
true
}
expect
(
helper
.
indirectly_invite_members?
).
to
eq
true
end
end
it
'returns false'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_a
)
{
true
}
context
'when a user is an owner'
do
before
do
allow
(
helper
).
to
receive
(
:current_user
)
{
owner
}
end
expect
(
helper
.
directly_invite_members?
).
to
eq
false
it
'returns false'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_b
)
{
true
}
expect
(
helper
.
indirectly_invite_members?
).
to
eq
false
end
end
end
end
describe
"#indirectly_invite_members?"
do
context
'when a user is a developer'
do
before
do
allow
(
helper
).
to
receive
(
:current_user
)
{
developer
}
end
context
'with group'
do
let_it_be
(
:group
)
{
create
(
:group
)
}
it
'returns false'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_b
)
{
false
}
describe
"#invite_group_members?"
do
context
'when the user is an owner'
do
before
do
group
.
add_owner
(
owner
)
allow
(
helper
).
to
receive
(
:current_user
)
{
owner
}
end
expect
(
helper
.
indirectly_invite_members?
).
to
eq
false
end
it
'returns false'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_empty_group_version_a
)
{
false
}
it
'returns true'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_b
)
{
true
}
expect
(
helper
.
invite_group_members?
(
group
)).
to
eq
false
end
expect
(
helper
.
indirectly_invite_members?
).
to
eq
true
end
end
it
'returns true'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_empty_group_version_a
)
{
true
}
context
'when a user is an owner'
do
before
do
allow
(
helper
).
to
receive
(
:current_user
)
{
owner
}
expect
(
helper
.
invite_group_members?
(
group
)).
to
eq
true
end
end
it
'returns false'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_version_b
)
{
true
}
context
'when the user is a developer'
do
before
do
group
.
add_developer
(
developer
)
allow
(
helper
).
to
receive
(
:current_user
)
{
developer
}
end
it
'returns false'
do
allow
(
helper
).
to
receive
(
:experiment_enabled?
).
with
(
:invite_members_empty_group_version_a
)
{
true
}
expect
(
helper
.
indirectly_invite_members?
).
to
eq
false
expect
(
helper
.
invite_group_members?
(
group
)).
to
eq
false
end
end
end
end
...
...
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