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 @@
...
@@ -40,4 +40,13 @@
-
data
[
'max-select'
]
=
dropdown_options
[
:data
][
:'max-select'
]
if
dropdown_options
[
:data
][
:'max-select'
]
-
data
[
'max-select'
]
=
dropdown_options
[
:data
][
:'max-select'
]
if
dropdown_options
[
:data
][
:'max-select'
]
-
options
[
:data
].
merge!
(
data
)
-
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 @@
...
@@ -3,6 +3,10 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
'projects/merge_requests/show.html.haml'
do
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'
include_context
'merge request show action'
context
'when merge request is created by a GitLab team member'
do
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
...
@@ -47,6 +47,9 @@ module Gitlab
},
},
upgrade_link_in_user_menu_a:
{
upgrade_link_in_user_menu_a:
{
tracking_category:
'Growth::Expansion::Experiment::UpgradeLinkInUserMenuA'
tracking_category:
'Growth::Expansion::Experiment::UpgradeLinkInUserMenuA'
},
invite_members_version_a:
{
tracking_category:
'Growth::Expansion::Experiment::InviteMembersVersionA'
}
}
}.
freeze
}.
freeze
...
...
locale/gitlab.pot
View file @
64a113e8
...
@@ -12100,6 +12100,9 @@ msgstr ""
...
@@ -12100,6 +12100,9 @@ msgstr ""
msgid "Invite \"%{trimmed}\" by email"
msgid "Invite \"%{trimmed}\" by email"
msgstr ""
msgstr ""
msgid "Invite Members"
msgstr ""
msgid "Invite group"
msgid "Invite group"
msgstr ""
msgstr ""
...
...
spec/features/issues/issue_sidebar_spec.rb
View file @
64a113e8
...
@@ -7,12 +7,13 @@ describe 'Issue Sidebar' do
...
@@ -7,12 +7,13 @@ describe 'Issue Sidebar' do
let
(
:group
)
{
create
(
:group
,
:nested
)
}
let
(
:group
)
{
create
(
:group
,
:nested
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
let
(
:issue
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
label
])
}
let
(
:issue
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
label
])
}
let!
(
:xss_label
)
{
create
(
:label
,
project:
project
,
title:
'<script>alert("xss");</script>'
)
}
let!
(
:xss_label
)
{
create
(
:label
,
project:
project
,
title:
'<script>alert("xss");</script>'
)
}
before
do
before
do
stub_feature_flags
(
save_issuable_health_status:
false
)
sign_in
(
user
)
sign_in
(
user
)
end
end
...
@@ -20,62 +21,123 @@ describe 'Issue Sidebar' do
...
@@ -20,62 +21,123 @@ describe 'Issue Sidebar' do
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:issue2
)
{
create
(
:issue
,
project:
project
,
author:
user2
)
}
let
(
:issue2
)
{
create
(
:issue
,
project:
project
,
author:
user2
)
}
before
do
context
'when invite_members_version_a experiment is enabled'
do
project
.
add_developer
(
user
)
before
do
visit_issue
(
project
,
issue2
)
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
find
(
'.block.assignee .edit-link'
).
click
end
it
'shows author in assignee dropdown'
do
wait_for_requests
page
.
within
'.dropdown-menu-user'
do
end
expect
(
page
).
to
have_content
(
user2
.
name
)
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
end
it
'shows author when filtering assignee dropdown'
do
context
'when user can see invite members'
do
page
.
within
'.dropdown-menu-user'
do
before
do
find
(
'.dropdown-input-field'
).
native
.
send_keys
user2
.
name
project
.
add_maintainer
(
user
)
sleep
1
# Required to wait for end of input delay
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
end
end
it
'assigns yourself'
do
context
'when invite_members_version_a experiment is not enabled'
do
find
(
'.block.assignee .dropdown-menu-toggle'
).
click
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
it
'shows author when filtering assignee dropdown'
do
expect
(
page
.
find
(
'.dropdown-header'
)).
to
be_visible
page
.
within
'.dropdown-menu-user'
do
expect
(
page
.
find
(
'.dropdown-menu-user-link.is-active'
)).
to
have_content
(
user
.
name
)
find
(
'.dropdown-input-field'
).
native
.
send_keys
user2
.
name
end
sleep
1
# Required to wait for end of input delay
end
it
'keeps your filtered term after filtering and dismissing the dropdown'
do
wait_for_requests
find
(
'.dropdown-input-field'
).
native
.
send_keys
user2
.
name
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
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
not_to
have_content
'Unassigned'
expect
(
page
).
not_to
have_content
'Unassigned'
click_link
user2
.
name
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
end
find
(
'.js-right-sidebar'
).
click
context
'when user is a maintainer'
do
find
(
'.block.assignee .edit-link'
).
click
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
)
wait_for_requests
expect
(
find
(
'.dropdown-input-field'
).
value
).
to
eq
(
user2
.
name
)
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
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
...
@@ -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_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'
]
||
''
}
let
(
:sidebar_assignee_dropdown_tooltip
)
{
sidebar_assignee_dropdown_item
.
find
(
'a'
)[
'data-title'
]
||
''
}
before
do
context
'when invite_members_version_a experiment is not enabled'
do
stub_const
(
'Autocomplete::UsersFinder::LIMIT'
,
users_find_limit
)
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
wait_for_requests
end
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_behaves_like
'when assigned'
,
expected_tooltip:
''
it
'shows assignee name'
do
expect
(
sidebar_assignee_block
).
to
have_text
(
assignee
.
name
)
end
end
it
"shows assignee tooltip '
#{
expected_tooltip
}
'"
do
context
'when assigned to developer'
do
expect
(
sidebar_assignee_tooltip
).
to
eql
(
expected_tooltip
)
let
(
:assignee
)
{
project_developers
.
last
}
it_behaves_like
'when assigned'
,
expected_tooltip:
'Cannot merge'
end
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
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
wait_for_requests
end
end
it
"shows assignee tooltip '
#{
expected_tooltip
}
"
do
it
'does not see link to invite members'
do
expect
(
sidebar_assignee_dropdown_tooltip
).
to
eql
(
expected_tooltip
)
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
not_to
have_link
(
'Invite Members'
)
end
end
end
end
end
end
context
'when assigned to maintainer'
do
context
'when user can see invite members'
do
let
(
:assignee
)
{
project_maintainers
.
last
}
before
do
project
.
add_maintainer
(
user
)
visit
project_merge_request_path
(
project
,
merge_request
)
it_behaves_like
'when assigned'
,
expected_tooltip:
''
find
(
'.block.assignee .edit-link'
).
click
end
context
'when assigned to developer'
do
wait_for_requests
let
(
:assignee
)
{
project_developers
.
last
}
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
end
end
spec/views/projects/merge_requests/show.html.haml_spec.rb
View file @
64a113e8
...
@@ -3,6 +3,10 @@
...
@@ -3,6 +3,10 @@
require
'spec_helper'
require
'spec_helper'
describe
'projects/merge_requests/show.html.haml'
do
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'
include_context
'merge request show action'
describe
'merge request assignee sidebar'
do
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