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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
3b2a909a
Commit
3b2a909a
authored
6 years ago
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes the html attribute in the json output optional with the option html_render=false
parent
20ca5e30
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
app/assets/javascripts/ide/services/index.js
app/assets/javascripts/ide/services/index.js
+1
-1
app/controllers/concerns/renders_blob.rb
app/controllers/concerns/renders_blob.rb
+2
-0
spec/controllers/projects/blob_controller_spec.rb
spec/controllers/projects/blob_controller_spec.rb
+18
-0
No files found.
app/assets/javascripts/ide/services/index.js
View file @
3b2a909a
...
...
@@ -9,7 +9,7 @@ export default {
return
Vue
.
http
.
get
(
endpoint
,
{
params
:
{
format
:
'
json
'
}
});
},
getFileData
(
endpoint
)
{
return
Vue
.
http
.
get
(
endpoint
,
{
params
:
{
format
:
'
json
'
}
});
return
Vue
.
http
.
get
(
endpoint
,
{
params
:
{
format
:
'
json
'
,
html_render
:
'
false
'
}
});
},
getRawFileData
(
file
)
{
if
(
file
.
tempFile
)
{
...
...
This diff is collapsed.
Click to expand it.
app/controllers/concerns/renders_blob.rb
View file @
3b2a909a
...
...
@@ -14,6 +14,8 @@ module RendersBlob
return
unless
viewer
return
{}
if
params
[
:html_render
]
==
'false'
{
html:
view_to_html_string
(
"projects/blob/_viewer"
,
viewer:
viewer
,
load_async:
false
)
}
...
...
This diff is collapsed.
Click to expand it.
spec/controllers/projects/blob_controller_spec.rb
View file @
3b2a909a
...
...
@@ -55,6 +55,24 @@ describe Projects::BlobController do
expect
(
json_response
).
to
have_key
'raw_path'
end
end
context
"html_render=false"
do
let
(
:id
)
{
'master/README.md'
}
before
do
get
(
:show
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
id
,
format: :json
,
html_render:
false
)
end
it
do
expect
(
response
).
to
be_ok
expect
(
json_response
).
note_to
have_key
'html'
end
end
end
context
'with tree path'
do
...
...
This diff is collapsed.
Click to expand it.
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