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
b0cec593
Commit
b0cec593
authored
Oct 08, 2020
by
Samantha Ming
Committed by
Jacques Erasmus
Oct 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show reviewers in MR list
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/237922
parent
ccf9b3bc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
0 deletions
+60
-0
app/views/projects/merge_requests/_merge_request.html.haml
app/views/projects/merge_requests/_merge_request.html.haml
+3
-0
app/views/shared/issuable/_reviewers.html.haml
app/views/shared/issuable/_reviewers.html.haml
+11
-0
locale/gitlab.pot
locale/gitlab.pot
+9
-0
spec/features/merge_requests/user_lists_merge_requests_spec.rb
...features/merge_requests/user_lists_merge_requests_spec.rb
+37
-0
No files found.
app/views/projects/merge_requests/_merge_request.html.haml
View file @
b0cec593
...
...
@@ -55,6 +55,9 @@
-
if
merge_request
.
assignees
.
any?
%li
.d-flex
=
render
'shared/issuable/assignees'
,
project:
merge_request
.
project
,
issuable:
merge_request
-
if
Feature
.
enabled?
(
:merge_request_reviewers
,
@project
)
&&
merge_request
.
reviewers
.
any?
%li
.gl-display-flex.issuable-reviewers
=
render
'shared/issuable/reviewers'
,
project:
merge_request
.
project
,
issuable:
merge_request
=
render
'projects/merge_requests/approvals_count'
,
merge_request:
merge_request
=
render
'shared/issuable_meta_data'
,
issuable:
merge_request
...
...
app/views/shared/issuable/_reviewers.html.haml
0 → 100644
View file @
b0cec593
-
max_render
=
4
-
reviewers_rendering_overflow
=
issuable
.
reviewers
.
size
>
max_render
-
render_count
=
reviewers_rendering_overflow
?
max_render
-
1
:
max_render
-
more_reviewers_count
=
issuable
.
reviewers
.
size
-
render_count
-
issuable
.
reviewers
.
take
(
render_count
).
each
do
|
reviewer
|
# rubocop: disable CodeReuse/ActiveRecord
=
link_to_member
(
@project
,
reviewer
,
name:
false
,
title:
_
(
"Review requested from %{name}"
)
%
{
name:
reviewer
.
name
})
-
if
more_reviewers_count
>
0
%span
{
class:
'avatar-counter has-tooltip'
,
data:
{
container:
'body'
,
placement:
'bottom'
,
'line-type'
=>
'old'
},
title:
_
(
"+%{more_reviewers_count} more reviewers"
)
%
{
more_reviewers_count:
more_reviewers_count
}
}
=
_
(
"+%{more_reviewers_count}"
)
%
{
more_reviewers_count:
more_reviewers_count
}
locale/gitlab.pot
View file @
b0cec593
...
...
@@ -997,6 +997,12 @@ msgstr[1] ""
msgid "+%{approvers} more approvers"
msgstr ""
msgid "+%{more_reviewers_count}"
msgstr ""
msgid "+%{more_reviewers_count} more reviewers"
msgstr ""
msgid "+%{tags} more"
msgstr ""
...
...
@@ -22196,6 +22202,9 @@ msgstr ""
msgid "Review App|View latest app"
msgstr ""
msgid "Review requested from %{name}"
msgstr ""
msgid "Review the process for configuring service providers in your identity provider — in this case, GitLab is the \"service provider\" or \"relying party\"."
msgstr ""
...
...
spec/features/merge_requests/user_lists_merge_requests_spec.rb
View file @
b0cec593
...
...
@@ -8,6 +8,10 @@ RSpec.describe 'Merge requests > User lists merge requests' do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
(
:user3
)
{
create
(
:user
)
}
let
(
:user4
)
{
create
(
:user
)
}
let
(
:user5
)
{
create
(
:user
)
}
before
do
@fix
=
create
(
:merge_request
,
...
...
@@ -15,6 +19,7 @@ RSpec.describe 'Merge requests > User lists merge requests' do
source_project:
project
,
source_branch:
'fix'
,
assignees:
[
user
],
reviewers:
[
user
,
user2
,
user3
,
user4
,
user5
],
milestone:
create
(
:milestone
,
project:
project
,
due_date:
'2013-12-11'
),
created_at:
1
.
minute
.
ago
,
updated_at:
1
.
minute
.
ago
)
...
...
@@ -23,6 +28,7 @@ RSpec.describe 'Merge requests > User lists merge requests' do
source_project:
project
,
source_branch:
'markdown'
,
assignees:
[
user
],
reviewers:
[
user
,
user2
,
user3
,
user4
],
milestone:
create
(
:milestone
,
project:
project
,
due_date:
'2013-12-12'
),
created_at:
2
.
minutes
.
ago
,
updated_at:
2
.
minutes
.
ago
)
...
...
@@ -34,6 +40,37 @@ RSpec.describe 'Merge requests > User lists merge requests' do
updated_at:
10
.
seconds
.
ago
)
end
context
'when merge_request_reviewers is turned on'
do
before
do
stub_feature_flags
(
merge_request_reviewers:
true
)
visit_merge_requests
(
project
,
reviewer_id:
user
.
id
)
end
it
'has reviewers in MR list'
do
expect
(
page
).
to
have_css
(
'.issuable-reviewers'
)
end
it
'shows reviewers avatar count badge if more_reviewers_count > 4'
do
first_issuable_reviewers
=
first
(
'.issuable-reviewers'
)
expect
(
first_issuable_reviewers
).
to
have_content
(
'2'
)
expect
(
first_issuable_reviewers
).
to
have_css
(
'.avatar-counter'
)
end
it
'does not show reviewers avatar count badge if more_reviewers_count <= 4'
do
expect
(
page
.
all
(
'.issuable-reviewers'
)[
1
]).
not_to
have_css
(
'.avatar-counter'
)
end
end
context
'when merge_request_reviewers is turned false'
do
it
'has no reviewers in MR list'
do
stub_feature_flags
(
merge_request_reviewers:
false
)
visit_merge_requests
(
project
,
reviewer_id:
user
.
id
)
expect
(
page
).
not_to
have_css
(
'.issuable-reviewers'
)
end
end
it
'filters on no assignee'
do
visit_merge_requests
(
project
,
assignee_id:
IssuableFinder
::
Params
::
FILTER_NONE
)
...
...
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