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
6f864d8b
Commit
6f864d8b
authored
Jun 21, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
03bf81f2
f47e4d02
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
4 deletions
+25
-4
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+2
-2
app/serializers/merge_request_widget_entity.rb
app/serializers/merge_request_widget_entity.rb
+4
-1
app/views/projects/merge_requests/show.html.haml
app/views/projects/merge_requests/show.html.haml
+1
-1
changelogs/unreleased/sh-omit-issues-links-on-poll.yml
changelogs/unreleased/sh-omit-issues-links-on-poll.yml
+5
-0
spec/serializers/merge_request_widget_entity_spec.rb
spec/serializers/merge_request_widget_entity_spec.rb
+13
-0
No files found.
app/helpers/issuables_helper.rb
View file @
6f864d8b
...
...
@@ -74,7 +74,7 @@ module IssuablesHelper
end
end
def
serialize_issuable
(
issuable
,
serializer:
nil
)
def
serialize_issuable
(
issuable
,
opts
=
{}
)
serializer_klass
=
case
issuable
when
Issue
IssueSerializer
...
...
@@ -84,7 +84,7 @@ module IssuablesHelper
serializer_klass
.
new
(
current_user:
current_user
,
project:
issuable
.
project
)
.
represent
(
issuable
,
serializer:
serializer
)
.
represent
(
issuable
,
opts
)
.
to_json
end
...
...
app/serializers/merge_request_widget_entity.rb
View file @
6f864d8b
...
...
@@ -116,7 +116,10 @@ class MergeRequestWidgetEntity < IssuableEntity
presenter
(
merge_request
).
ci_status
end
expose
:issues_links
do
# Rendering and redacting Markdown can be expensive. These links are
# just nice to have in the merge request widget, so only
# include them if they are explicitly requested on first load.
expose
:issues_links
,
if:
->
(
_
,
opts
)
{
opts
[
:issues_links
]
}
do
expose
:assign_to_closing
do
|
merge_request
|
presenter
(
merge_request
).
assign_to_closing_issues_link
end
...
...
app/views/projects/merge_requests/show.html.haml
View file @
6f864d8b
...
...
@@ -19,7 +19,7 @@
-# haml-lint:disable InlineJavaScript
:javascript
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
mrWidgetData
=
#{
serialize_issuable
(
@merge_request
,
serializer:
'widget'
)
}
window
.
gl
.
mrWidgetData
=
#{
serialize_issuable
(
@merge_request
,
serializer:
'widget'
,
issues_links:
true
)
}
window
.
gl
.
mrWidgetData
.
squash_before_merge_help_path
=
'
#{
help_page_path
(
"user/project/merge_requests/squash_and_merge"
)
}
'
;
window
.
gl
.
mrWidgetData
.
troubleshooting_docs_path
=
'
#{
help_page_path
(
'user/project/merge_requests/index.md'
,
anchor:
'troubleshooting'
)
}
'
;
...
...
changelogs/unreleased/sh-omit-issues-links-on-poll.yml
0 → 100644
View file @
6f864d8b
---
title
:
Omit issues links in merge request entity API response
merge_request
:
29917
author
:
type
:
performance
spec/serializers/merge_request_widget_entity_spec.rb
View file @
6f864d8b
...
...
@@ -32,6 +32,19 @@ describe MergeRequestWidgetEntity do
end
end
describe
'issues links'
do
it
'includes issues links when requested'
do
data
=
described_class
.
new
(
resource
,
request:
request
,
issues_links:
true
).
as_json
expect
(
data
).
to
include
(
:issues_links
)
expect
(
data
[
:issues_links
]).
to
include
(
:assign_to_closing
,
:closing
,
:mentioned_but_not_closing
)
end
it
'omits issue links by default'
do
expect
(
subject
).
not_to
include
(
:issues_links
)
end
end
describe
'pipeline'
do
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
,
ref:
resource
.
source_branch
,
sha:
resource
.
source_branch_sha
,
head_pipeline_of:
resource
)
}
...
...
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