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
5428e913
Commit
5428e913
authored
Jul 03, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only include _html fields when asked for
parent
6021ab6f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
12 deletions
+13
-12
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+2
-2
app/assets/javascripts/ide/services/index.js
app/assets/javascripts/ide/services/index.js
+2
-2
app/assets/javascripts/ide/stores/actions/merge_request.js
app/assets/javascripts/ide/stores/actions/merge_request.js
+1
-1
lib/api/entities.rb
lib/api/entities.rb
+6
-6
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+2
-1
No files found.
app/assets/javascripts/api.js
View file @
5428e913
...
...
@@ -100,12 +100,12 @@ const Api = {
},
// Return Merge Request for project
mergeRequest
(
projectPath
,
mergeRequestId
)
{
mergeRequest
(
projectPath
,
mergeRequestId
,
params
=
{}
)
{
const
url
=
Api
.
buildUrl
(
Api
.
mergeRequestPath
)
.
replace
(
'
:id
'
,
encodeURIComponent
(
projectPath
))
.
replace
(
'
:mrid
'
,
mergeRequestId
);
return
axios
.
get
(
url
);
return
axios
.
get
(
url
,
{
params
}
);
},
mergeRequests
(
params
=
{})
{
...
...
app/assets/javascripts/ide/services/index.js
View file @
5428e913
...
...
@@ -40,8 +40,8 @@ export default {
getProjectData
(
namespace
,
project
)
{
return
Api
.
project
(
`
${
namespace
}
/
${
project
}
`
);
},
getProjectMergeRequestData
(
projectId
,
mergeRequestId
)
{
return
Api
.
mergeRequest
(
projectId
,
mergeRequestId
);
getProjectMergeRequestData
(
projectId
,
mergeRequestId
,
params
=
{}
)
{
return
Api
.
mergeRequest
(
projectId
,
mergeRequestId
,
params
);
},
getProjectMergeRequestChanges
(
projectId
,
mergeRequestId
)
{
return
Api
.
mergeRequestChanges
(
projectId
,
mergeRequestId
);
...
...
app/assets/javascripts/ide/stores/actions/merge_request.js
View file @
5428e913
...
...
@@ -9,7 +9,7 @@ export const getMergeRequestData = (
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
state
.
projects
[
projectId
].
mergeRequests
[
mergeRequestId
]
||
force
)
{
service
.
getProjectMergeRequestData
(
projectId
,
mergeRequestId
)
.
getProjectMergeRequestData
(
projectId
,
mergeRequestId
,
{
render_html
:
true
}
)
.
then
(({
data
})
=>
{
commit
(
types
.
SET_MERGE_REQUEST
,
{
projectPath
:
projectId
,
...
...
lib/api/entities.rb
View file @
5428e913
...
...
@@ -388,12 +388,6 @@ module API
expose
:id
,
:iid
expose
(
:project_id
)
{
|
entity
|
entity
&
.
project
.
try
(
:id
)
}
expose
:title
,
:description
expose
:title_html
do
|
entity
|
MarkupHelper
::
markdown_field
(
entity
,
:title
)
end
expose
:description_html
do
|
entity
|
MarkupHelper
::
markdown_field
(
entity
,
:description
)
end
expose
:state
,
:created_at
,
:updated_at
end
...
...
@@ -538,6 +532,12 @@ module API
end
class
MergeRequestBasic
<
ProjectEntity
expose
:title_html
,
if:
->
(
_
,
options
)
{
options
[
:render_html
]
}
do
|
entity
|
MarkupHelper
::
markdown_field
(
entity
,
:title
)
end
expose
:description_html
,
if:
->
(
_
,
options
)
{
options
[
:render_html
]
}
do
|
entity
|
MarkupHelper
::
markdown_field
(
entity
,
:description
)
end
expose
:target_branch
,
:source_branch
expose
:upvotes
do
|
merge_request
,
options
|
if
options
[
:issuable_metadata
]
...
...
lib/api/merge_requests.rb
View file @
5428e913
...
...
@@ -232,6 +232,7 @@ module API
params
do
requires
:merge_request_iid
,
type:
Integer
,
desc:
'The IID of a merge request'
optional
:render_html
,
type:
Boolean
,
desc:
'Returns the description and title rendered html'
end
desc
'Get a single merge request'
do
success
Entities
::
MergeRequest
...
...
@@ -239,7 +240,7 @@ module API
get
':id/merge_requests/:merge_request_iid'
do
merge_request
=
find_merge_request_with_access
(
params
[
:merge_request_iid
])
present
merge_request
,
with:
Entities
::
MergeRequest
,
current_user:
current_user
,
project:
user_project
present
merge_request
,
with:
Entities
::
MergeRequest
,
current_user:
current_user
,
project:
user_project
,
render_html:
params
[
:render_html
]
end
desc
'Get the participants of a merge request'
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