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
64a113e8
Commit
64a113e8
authored
Jun 05, 2020
by
Doug Stull
Committed by
Phil Hughes
Jun 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add invite members link on issues
- to entice more user expansion into collaboration
parent
dac3aa82
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
198 additions
and
62 deletions
+198
-62
app/views/shared/issuable/_sidebar_assignees.html.haml
app/views/shared/issuable/_sidebar_assignees.html.haml
+10
-1
ee/spec/views/projects/merge_requests/show.html.haml_spec.rb
ee/spec/views/projects/merge_requests/show.html.haml_spec.rb
+4
-0
lib/gitlab/experimentation.rb
lib/gitlab/experimentation.rb
+3
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/features/issues/issue_sidebar_spec.rb
spec/features/issues/issue_sidebar_spec.rb
+99
-37
spec/features/merge_request/user_edits_assignees_sidebar_spec.rb
...atures/merge_request/user_edits_assignees_sidebar_spec.rb
+75
-24
spec/views/projects/merge_requests/show.html.haml_spec.rb
spec/views/projects/merge_requests/show.html.haml_spec.rb
+4
-0
No files found.
app/views/shared/issuable/_sidebar_assignees.html.haml
View file @
64a113e8
...
...
@@ -40,4 +40,13 @@
-
data
[
'max-select'
]
=
dropdown_options
[
:data
][
:'max-select'
]
if
dropdown_options
[
:data
][
:'max-select'
]
-
options
[
:data
].
merge!
(
data
)
=
dropdown_tag
(
title
,
options:
options
)
-
if
experiment_enabled?
(
:invite_members_version_a
)
&&
can_import_members?
-
options
[
:dropdown_class
]
+=
' dropdown-extended-height'
-
options
[
:footer_content
]
=
true
=
dropdown_tag
(
title
,
options:
options
)
do
%ul
.dropdown-footer-list
%li
=
link_to
_
(
'Invite Members'
),
project_project_members_path
(
@project
),
title:
_
(
'Invite Members'
),
:"data-is-link"
=>
true
-
else
=
dropdown_tag
(
title
,
options:
options
)
ee/spec/views/projects/merge_requests/show.html.haml_spec.rb
View file @
64a113e8
...
...
@@ -3,6 +3,10 @@
require
'spec_helper'
RSpec
.
describe
'projects/merge_requests/show.html.haml'
do
before
do
allow
(
view
).
to
receive
(
:experiment_enabled?
).
and_return
(
false
)
end
include_context
'merge request show action'
context
'when merge request is created by a GitLab team member'
do
...
...
lib/gitlab/experimentation.rb
View file @
64a113e8
...
...
@@ -47,6 +47,9 @@ module Gitlab
},
upgrade_link_in_user_menu_a:
{
tracking_category:
'Growth::Expansion::Experiment::UpgradeLinkInUserMenuA'
},
invite_members_version_a:
{
tracking_category:
'Growth::Expansion::Experiment::InviteMembersVersionA'
}
}.
freeze
...
...
locale/gitlab.pot
View file @
64a113e8
...
...
@@ -12100,6 +12100,9 @@ msgstr ""
msgid "Invite \"%{trimmed}\" by email"
msgstr ""
msgid "Invite Members"
msgstr ""
msgid "Invite group"
msgstr ""
...
...
spec/features/issues/issue_sidebar_spec.rb
View file @
64a113e8
...
...
@@ -7,12 +7,13 @@ describe 'Issue Sidebar' do
let
(
:group
)
{
create
(
:group
,
:nested
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
let
(
:issue
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
label
])
}
let!
(
:xss_label
)
{
create
(
:label
,
project:
project
,
title:
'<script>alert("xss");</script>'
)
}
before
do
stub_feature_flags
(
save_issuable_health_status:
false
)
sign_in
(
user
)
end
...
...
@@ -20,62 +21,123 @@ describe 'Issue Sidebar' do
let
(
:user2
)
{
create
(
:user
)
}
let
(
:issue2
)
{
create
(
:issue
,
project:
project
,
author:
user2
)
}
before
do
project
.
add_developer
(
user
)
visit_issue
(
project
,
issue2
)
context
'when invite_members_version_a experiment is enabled'
do
before
do
stub_experiment_for_user
(
invite_members_version_a:
true
)
end
find
(
'.block.assignee .edit-link'
).
click
context
'when user can not see invite members'
do
before
do
project
.
add_developer
(
user
)
visit_issue
(
project
,
issue2
)
wait_for_requests
end
find
(
'.block.assignee .edit-link'
).
click
it
'shows author in assignee dropdown'
do
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
to
have_content
(
user2
.
name
)
wait_for_requests
end
it
'does not see link to invite members'
do
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
not_to
have_link
(
'Invite Members'
)
end
end
end
end
it
'shows author when filtering assignee dropdown'
do
page
.
within
'.dropdown-menu-user'
do
find
(
'.dropdown-input-field'
).
native
.
send_keys
user2
.
name
sleep
1
# Required to wait for end of input delay
context
'when user can see invite members'
do
before
do
project
.
add_maintainer
(
user
)
visit_issue
(
project
,
issue2
)
find
(
'.block.assignee .edit-link'
).
click
wait_for_requests
wait_for_requests
end
expect
(
page
).
to
have_content
(
user2
.
name
)
it
'sees link to invite members'
do
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
to
have_link
(
'Invite Members'
,
href:
project_project_members_path
(
project
))
end
end
end
end
it
'assigns yourself'
do
find
(
'.block.assignee .dropdown-menu-toggle'
).
click
context
'when invite_members_version_a experiment is not enabled'
do
context
'when user is a developer'
do
before
do
project
.
add_developer
(
user
)
visit_issue
(
project
,
issue2
)
click_button
'assign yourself'
find
(
'.block.assignee .edit-link'
).
click
wait_for_requests
wait_for_requests
end
find
(
'.block.assignee .edit-link'
).
click
it
'shows author in assignee dropdown'
do
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
to
have_content
(
user2
.
name
)
end
end
page
.
within
'.dropdown-menu-user'
do
expect
(
page
.
find
(
'.dropdown-header'
)).
to
be_visible
expect
(
page
.
find
(
'.dropdown-menu-user-link.is-active'
)).
to
have_content
(
user
.
name
)
end
end
it
'shows author when filtering assignee dropdown'
do
page
.
within
'.dropdown-menu-user'
do
find
(
'.dropdown-input-field'
).
native
.
send_keys
user2
.
name
sleep
1
# Required to wait for end of input delay
it
'keeps your filtered term after filtering and dismissing the dropdown'
do
find
(
'.dropdown-input-field'
).
native
.
send_keys
user2
.
name
wait_for_requests
wait_for_requests
expect
(
page
).
to
have_content
(
user2
.
name
)
end
end
it
'assigns yourself'
do
find
(
'.block.assignee .dropdown-menu-toggle'
).
click
click_button
'assign yourself'
wait_for_requests
find
(
'.block.assignee .edit-link'
).
click
page
.
within
'.dropdown-menu-user'
do
expect
(
page
.
find
(
'.dropdown-header'
)).
to
be_visible
expect
(
page
.
find
(
'.dropdown-menu-user-link.is-active'
)).
to
have_content
(
user
.
name
)
end
end
it
'keeps your filtered term after filtering and dismissing the dropdown'
do
find
(
'.dropdown-input-field'
).
native
.
send_keys
user2
.
name
wait_for_requests
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
not_to
have_content
'Unassigned'
click_link
user2
.
name
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
not_to
have_content
'Unassigned'
click_link
user2
.
name
end
find
(
'.js-right-sidebar'
).
click
find
(
'.block.assignee .edit-link'
).
click
expect
(
page
.
all
(
'.dropdown-menu-user li'
).
length
).
to
eq
(
1
)
expect
(
find
(
'.dropdown-input-field'
).
value
).
to
eq
(
user2
.
name
)
end
end
find
(
'.js-right-sidebar'
).
click
find
(
'.block.assignee .edit-link'
).
click
context
'when user is a maintainer'
do
before
do
project
.
add_maintainer
(
user
)
visit_issue
(
project
,
issue2
)
find
(
'.block.assignee .edit-link'
).
click
expect
(
page
.
all
(
'.dropdown-menu-user li'
).
length
).
to
eq
(
1
)
expect
(
find
(
'.dropdown-input-field'
).
value
).
to
eq
(
user2
.
name
)
wait_for_requests
end
it
'shows author in assignee dropdown and no invite link'
do
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
not_to
have_link
(
'Invite Members'
)
end
end
end
end
end
...
...
spec/features/merge_request/user_edits_assignees_sidebar_spec.rb
View file @
64a113e8
...
...
@@ -20,49 +20,100 @@ describe 'Merge request > User edits assignees sidebar', :js do
let
(
:sidebar_assignee_dropdown_item
)
{
sidebar_assignee_block
.
find
(
".dropdown-menu li[data-user-id=
\"
#{
assignee
.
id
}
\"
]"
)
}
let
(
:sidebar_assignee_dropdown_tooltip
)
{
sidebar_assignee_dropdown_item
.
find
(
'a'
)[
'data-title'
]
||
''
}
before
do
stub_const
(
'Autocomplete::UsersFinder::LIMIT'
,
users_find_limit
)
context
'when invite_members_version_a experiment is not enabled'
do
before
do
stub_const
(
'Autocomplete::UsersFinder::LIMIT'
,
users_find_limit
)
sign_in
(
project
.
owner
)
sign_in
(
project
.
owner
)
merge_request
.
assignees
<<
assignee
merge_request
.
assignees
<<
assignee
visit
project_merge_request_path
(
project
,
merge_request
)
visit
project_merge_request_path
(
project
,
merge_request
)
wait_for_requests
end
wait_for_requests
end
shared_examples
'when assigned'
do
|
expected_tooltip:
''
|
it
'shows assignee name'
do
expect
(
sidebar_assignee_block
).
to
have_text
(
assignee
.
name
)
end
it
"shows assignee tooltip '
#{
expected_tooltip
}
'"
do
expect
(
sidebar_assignee_tooltip
).
to
eql
(
expected_tooltip
)
end
context
'when edit is clicked'
do
before
do
sidebar_assignee_block
.
click_link
(
'Edit'
)
wait_for_requests
end
it
"shows assignee tooltip '
#{
expected_tooltip
}
"
do
expect
(
sidebar_assignee_dropdown_tooltip
).
to
eql
(
expected_tooltip
)
end
it
'does not show invite link'
do
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
not_to
have_link
(
'Invite Members'
)
end
end
end
end
context
'when assigned to maintainer'
do
let
(
:assignee
)
{
project_maintainers
.
last
}
shared_examples
'when assigned'
do
|
expected_tooltip:
''
|
it
'shows assignee name'
do
expect
(
sidebar_assignee_block
).
to
have_text
(
assignee
.
name
)
it_behaves_like
'when assigned'
,
expected_tooltip:
''
end
it
"shows assignee tooltip '
#{
expected_tooltip
}
'"
do
expect
(
sidebar_assignee_tooltip
).
to
eql
(
expected_tooltip
)
context
'when assigned to developer'
do
let
(
:assignee
)
{
project_developers
.
last
}
it_behaves_like
'when assigned'
,
expected_tooltip:
'Cannot merge'
end
end
context
'when edit is clicked'
do
context
'when invite_members_version_a experiment is enabled'
do
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
stub_experiment_for_user
(
invite_members_version_a:
true
)
sign_in
(
user
)
end
context
'when user can not see invite members'
do
before
do
sidebar_assignee_block
.
click_link
(
'Edit'
)
project
.
add_developer
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
find
(
'.block.assignee .edit-link'
).
click
wait_for_requests
end
it
"shows assignee tooltip '
#{
expected_tooltip
}
"
do
expect
(
sidebar_assignee_dropdown_tooltip
).
to
eql
(
expected_tooltip
)
it
'does not see link to invite members'
do
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
not_to
have_link
(
'Invite Members'
)
end
end
end
end
context
'when assigned to maintainer'
do
let
(
:assignee
)
{
project_maintainers
.
last
}
context
'when user can see invite members'
do
before
do
project
.
add_maintainer
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
it_behaves_like
'when assigned'
,
expected_tooltip:
''
end
find
(
'.block.assignee .edit-link'
).
click
context
'when assigned to developer'
do
let
(
:assignee
)
{
project_developers
.
last
}
wait_for_requests
end
it_behaves_like
'when assigned'
,
expected_tooltip:
'Cannot merge'
it
'sees link to invite members'
do
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
to
have_link
(
'Invite Members'
,
href:
project_project_members_path
(
project
))
end
end
end
end
end
spec/views/projects/merge_requests/show.html.haml_spec.rb
View file @
64a113e8
...
...
@@ -3,6 +3,10 @@
require
'spec_helper'
describe
'projects/merge_requests/show.html.haml'
do
before
do
allow
(
view
).
to
receive
(
:experiment_enabled?
).
and_return
(
false
)
end
include_context
'merge request show action'
describe
'merge request assignee sidebar'
do
...
...
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