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
4ad86a7b
Commit
4ad86a7b
authored
Oct 01, 2020
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only allow multiple reviewers in paid tiers
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/246905
parent
5ac5c764
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
112 additions
and
5 deletions
+112
-5
app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue
...idebar/components/reviewers/uncollapsed_reviewer_list.vue
+3
-3
app/helpers/form_helper.rb
app/helpers/form_helper.rb
+24
-2
ee/app/helpers/ee/form_helper.rb
ee/app/helpers/ee/form_helper.rb
+4
-0
ee/changelogs/unreleased/246905-only-allow-multiple-reviewers-in-paid-tiers.yml
...ed/246905-only-allow-multiple-reviewers-in-paid-tiers.yml
+5
-0
ee/spec/features/merge_request/user_creates_multiple_reviewers_mr_spec.rb
.../merge_request/user_creates_multiple_reviewers_mr_spec.rb
+13
-0
ee/spec/features/merge_request/user_edits_multiple_reviewers_mr_spec.rb
...es/merge_request/user_edits_multiple_reviewers_mr_spec.rb
+13
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/support/shared_examples/features/multiple_reviewers_mr_shared_examples.rb
...xamples/features/multiple_reviewers_mr_shared_examples.rb
+47
-0
No files found.
app/assets/javascripts/sidebar/components/reviewers/uncollapsed_reviewer_list.vue
View file @
4ad86a7b
...
@@ -75,9 +75,9 @@ export default {
...
@@ -75,9 +75,9 @@ export default {
:root-path="rootPath"
:root-path="rootPath"
:issuable-type="issuableType"
:issuable-type="issuableType"
>
>
<div
class=
"
ml-2
"
>
<div
class=
"
gl-ml-3 gl-line-height-normal
"
>
<
span
class=
"author"
>
{{
user
.
name
}}
</span
>
<
div
class=
"author"
>
{{
user
.
name
}}
</div
>
<
span
class=
"username"
>
{{
username
}}
</span
>
<
div
class=
"username"
>
{{
username
}}
</div
>
</div>
</div>
</reviewer-avatar-link>
</reviewer-avatar-link>
<div
v-else
>
<div
v-else
>
...
...
app/helpers/form_helper.rb
View file @
4ad86a7b
...
@@ -56,7 +56,7 @@ module FormHelper
...
@@ -56,7 +56,7 @@ module FormHelper
end
end
def
reviewers_dropdown_options
(
issuable_type
)
def
reviewers_dropdown_options
(
issuable_type
)
{
dropdown_data
=
{
toggle_class:
'js-reviewer-search js-multiselect js-save-user-data'
,
toggle_class:
'js-reviewer-search js-multiselect js-save-user-data'
,
title:
'Request review from'
,
title:
'Request review from'
,
filter:
true
,
filter:
true
,
...
@@ -69,13 +69,20 @@ module FormHelper
...
@@ -69,13 +69,20 @@ module FormHelper
project_id:
(
@target_project
||
@project
)
&
.
id
,
project_id:
(
@target_project
||
@project
)
&
.
id
,
field_name:
"
#{
issuable_type
}
[reviewer_ids][]"
,
field_name:
"
#{
issuable_type
}
[reviewer_ids][]"
,
default_label:
'Unassigned'
,
default_label:
'Unassigned'
,
'dropdown-header'
:
'Reviewer(s)'
,
'max-select'
:
1
,
'dropdown-header'
:
'Reviewer'
,
multi_select:
true
,
multi_select:
true
,
'input-meta'
:
'name'
,
'input-meta'
:
'name'
,
'always-show-selectbox'
:
true
,
'always-show-selectbox'
:
true
,
current_user_info:
UserSerializer
.
new
.
represent
(
current_user
)
current_user_info:
UserSerializer
.
new
.
represent
(
current_user
)
}
}
}
}
if
merge_request_supports_multiple_reviewers?
dropdown_data
=
multiple_reviewers_dropdown_options
(
dropdown_data
)
end
dropdown_data
end
end
# Overwritten
# Overwritten
...
@@ -88,6 +95,11 @@ module FormHelper
...
@@ -88,6 +95,11 @@ module FormHelper
false
false
end
end
# Overwritten
def
merge_request_supports_multiple_reviewers?
false
end
private
private
def
multiple_assignees_dropdown_options
(
options
)
def
multiple_assignees_dropdown_options
(
options
)
...
@@ -99,6 +111,16 @@ module FormHelper
...
@@ -99,6 +111,16 @@ module FormHelper
new_options
new_options
end
end
def
multiple_reviewers_dropdown_options
(
options
)
new_options
=
options
.
dup
new_options
[
:title
]
=
_
(
'Select reviewer(s)'
)
new_options
[
:data
][
:'dropdown-header'
]
=
_
(
'Reviewer(s)'
)
new_options
[
:data
].
delete
(
:'max-select'
)
new_options
end
end
end
FormHelper
.
prepend_if_ee
(
'::EE::FormHelper'
)
FormHelper
.
prepend_if_ee
(
'::EE::FormHelper'
)
ee/app/helpers/ee/form_helper.rb
View file @
4ad86a7b
...
@@ -9,5 +9,9 @@ module EE
...
@@ -9,5 +9,9 @@ module EE
def
merge_request_supports_multiple_assignees?
def
merge_request_supports_multiple_assignees?
@merge_request
&
.
allows_multiple_assignees?
@merge_request
&
.
allows_multiple_assignees?
end
end
def
merge_request_supports_multiple_reviewers?
@merge_request
&
.
allows_multiple_reviewers?
end
end
end
end
end
ee/changelogs/unreleased/246905-only-allow-multiple-reviewers-in-paid-tiers.yml
0 → 100644
View file @
4ad86a7b
---
title
:
Only allow multiple reviewers in paid tiers
merge_request
:
44097
author
:
type
:
changed
ee/spec/features/merge_request/user_creates_multiple_reviewers_mr_spec.rb
0 → 100644
View file @
4ad86a7b
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Merge request > User creates MR with multiple reviewers'
do
include_context
'merge request create context'
before
do
stub_licensed_features
(
multiple_merge_request_reviewers:
true
)
end
it_behaves_like
'multiple reviewers merge request'
,
'creates'
,
'Submit merge request'
end
ee/spec/features/merge_request/user_edits_multiple_reviewers_mr_spec.rb
0 → 100644
View file @
4ad86a7b
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Merge request > User edits MR with multiple reviewers'
do
include_context
'merge request edit context'
before
do
stub_licensed_features
(
multiple_merge_request_reviewers:
true
)
end
it_behaves_like
'multiple reviewers merge request'
,
'updates'
,
'Save changes'
end
locale/gitlab.pot
View file @
4ad86a7b
...
@@ -23168,6 +23168,9 @@ msgstr ""
...
@@ -23168,6 +23168,9 @@ msgstr ""
msgid "Select required regulatory standard"
msgid "Select required regulatory standard"
msgstr ""
msgstr ""
msgid "Select reviewer(s)"
msgstr ""
msgid "Select shards to replicate"
msgid "Select shards to replicate"
msgstr ""
msgstr ""
...
...
spec/support/shared_examples/features/multiple_reviewers_mr_shared_examples.rb
0 → 100644
View file @
4ad86a7b
# frozen_string_literal: true
RSpec
.
shared_examples
'multiple reviewers merge request'
do
|
action
,
save_button_title
|
it
"
#{
action
}
a MR with multiple reviewers"
,
:js
do
find
(
'.js-reviewer-search'
).
click
page
.
within
'.dropdown-menu-user'
do
click_link
user
.
name
click_link
user2
.
name
end
# Extra click needed in order to toggle the dropdown
find
(
'.js-reviewer-search'
).
click
expect
(
all
(
'input[name="merge_request[reviewer_ids][]"]'
,
visible:
false
).
map
(
&
:value
))
.
to
match_array
([
user
.
id
.
to_s
,
user2
.
id
.
to_s
])
page
.
within
'.js-reviewer-search'
do
expect
(
page
).
to
have_content
"
#{
user2
.
name
}
+ 1 more"
end
click_button
save_button_title
page
.
within
'.issuable-sidebar'
do
page
.
within
'.reviewer'
do
expect
(
page
).
to
have_content
'2 Reviewers'
click_link
'Edit'
expect
(
page
).
to
have_content
user
.
name
expect
(
page
).
to
have_content
user2
.
name
end
end
page
.
within
'.dropdown-menu-user'
do
click_link
user
.
name
end
page
.
within
'.issuable-sidebar'
do
page
.
within
'.reviewer'
do
# Closing dropdown to persist
click_link
'Edit'
expect
(
page
).
to
have_content
user2
.
name
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