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
826fdeaa
Commit
826fdeaa
authored
Jan 08, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
3ec3de90
71026ffd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
6 deletions
+35
-6
app/views/shared/issuable/_sidebar_assignees.html.haml
app/views/shared/issuable/_sidebar_assignees.html.haml
+1
-1
spec/views/projects/merge_requests/show.html.haml_spec.rb
spec/views/projects/merge_requests/show.html.haml_spec.rb
+34
-5
No files found.
app/views/shared/issuable/_sidebar_assignees.html.haml
View file @
826fdeaa
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
.value.hide-collapsed
.value.hide-collapsed
-
if
issuable_sidebar
[
:assignee
]
-
if
issuable_sidebar
[
:assignee
]
=
link_to_member
(
@project
,
assignee
,
size:
32
,
extra_class:
'bold'
)
do
=
link_to_member
(
@project
,
assignee
,
size:
32
,
extra_class:
'bold'
)
do
-
if
issuable_sidebar
[
:assignee
][
:can_merge
]
-
unless
issuable_sidebar
[
:assignee
][
:can_merge
]
%span
.float-right.cannot-be-merged
{
data:
{
toggle:
'tooltip'
,
placement:
'left'
},
title:
_
(
'Not allowed to merge'
)
}
%span
.float-right.cannot-be-merged
{
data:
{
toggle:
'tooltip'
,
placement:
'left'
},
title:
_
(
'Not allowed to merge'
)
}
=
icon
(
'exclamation-triangle'
,
'aria-hidden'
:
'true'
)
=
icon
(
'exclamation-triangle'
,
'aria-hidden'
:
'true'
)
%span
.username
%span
.username
...
...
spec/views/projects/merge_requests/show.html.haml_spec.rb
View file @
826fdeaa
...
@@ -32,11 +32,7 @@ describe 'projects/merge_requests/show.html.haml' do
...
@@ -32,11 +32,7 @@ describe 'projects/merge_requests/show.html.haml' do
assign
(
:noteable
,
closed_merge_request
)
assign
(
:noteable
,
closed_merge_request
)
assign
(
:notes
,
[])
assign
(
:notes
,
[])
assign
(
:pipelines
,
Ci
::
Pipeline
.
none
)
assign
(
:pipelines
,
Ci
::
Pipeline
.
none
)
assign
(
assign
(
:issuable_sidebar
,
serialize_issuable_sidebar
(
user
,
project
,
closed_merge_request
))
:issuable_sidebar
,
MergeRequestSerializer
.
new
(
current_user:
user
,
project:
project
)
.
represent
(
closed_merge_request
,
serializer:
'sidebar'
)
)
preload_view_requirements
preload_view_requirements
...
@@ -45,6 +41,33 @@ describe 'projects/merge_requests/show.html.haml' do
...
@@ -45,6 +41,33 @@ describe 'projects/merge_requests/show.html.haml' do
current_application_settings:
Gitlab
::
CurrentSettings
.
current_application_settings
)
current_application_settings:
Gitlab
::
CurrentSettings
.
current_application_settings
)
end
end
describe
'merge request assignee sidebar'
do
context
'when assignee is allowed to merge'
do
it
'does not show a warning icon'
do
closed_merge_request
.
update
(
assignee_id:
user
.
id
)
project
.
add_maintainer
(
user
)
assign
(
:issuable_sidebar
,
serialize_issuable_sidebar
(
user
,
project
,
closed_merge_request
))
render
expect
(
rendered
).
not_to
have_css
(
'.cannot-be-merged'
)
end
end
context
'when assignee is not allowed to merge'
do
it
'shows a warning icon'
do
reporter
=
create
(
:user
)
project
.
add_reporter
(
reporter
)
closed_merge_request
.
update
(
assignee_id:
reporter
.
id
)
assign
(
:issuable_sidebar
,
serialize_issuable_sidebar
(
user
,
project
,
closed_merge_request
))
render
expect
(
rendered
).
to
have_css
(
'.cannot-be-merged'
)
end
end
end
context
'when the merge request is closed'
do
context
'when the merge request is closed'
do
it
'shows the "Reopen" button'
do
it
'shows the "Reopen" button'
do
render
render
...
@@ -80,4 +103,10 @@ describe 'projects/merge_requests/show.html.haml' do
...
@@ -80,4 +103,10 @@ describe 'projects/merge_requests/show.html.haml' do
expect
(
rendered
).
to
have_css
(
'a'
,
visible:
false
,
text:
'Close'
)
expect
(
rendered
).
to
have_css
(
'a'
,
visible:
false
,
text:
'Close'
)
end
end
end
end
def
serialize_issuable_sidebar
(
user
,
project
,
merge_request
)
MergeRequestSerializer
.
new
(
current_user:
user
,
project:
project
)
.
represent
(
closed_merge_request
,
serializer:
'sidebar'
)
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