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
832dcd6c
Commit
832dcd6c
authored
Jul 26, 2018
by
Phil Hughes
Committed by
Tim Zallmann
Jul 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed IDE not opening JSON files
parent
4fd6b5bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
app/assets/javascripts/ide/services/index.js
app/assets/javascripts/ide/services/index.js
+2
-2
changelogs/unreleased/ide-edit-json-files.yml
changelogs/unreleased/ide-edit-json-files.yml
+5
-0
spec/javascripts/ide/stores/actions/file_spec.js
spec/javascripts/ide/stores/actions/file_spec.js
+17
-0
No files found.
app/assets/javascripts/ide/services/index.js
View file @
832dcd6c
...
@@ -18,7 +18,7 @@ export default {
...
@@ -18,7 +18,7 @@ export default {
return
axios
return
axios
.
get
(
file
.
rawPath
,
{
.
get
(
file
.
rawPath
,
{
params
:
{
format
:
'
json
'
}
,
transformResponse
:
[
f
=>
f
]
,
})
})
.
then
(({
data
})
=>
data
);
.
then
(({
data
})
=>
data
);
},
},
...
@@ -33,7 +33,7 @@ export default {
...
@@ -33,7 +33,7 @@ export default {
return
axios
return
axios
.
get
(
file
.
rawPath
.
replace
(
`/raw/
${
file
.
branchId
}
/
${
file
.
path
}
`
,
`/raw/
${
sha
}
/
${
file
.
path
}
`
),
{
.
get
(
file
.
rawPath
.
replace
(
`/raw/
${
file
.
branchId
}
/
${
file
.
path
}
`
,
`/raw/
${
sha
}
/
${
file
.
path
}
`
),
{
params
:
{
format
:
'
json
'
}
,
transformResponse
:
[
f
=>
f
]
,
})
})
.
then
(({
data
})
=>
data
);
.
then
(({
data
})
=>
data
);
},
},
...
...
changelogs/unreleased/ide-edit-json-files.yml
0 → 100644
View file @
832dcd6c
---
title
:
Fixed IDE not opening JSON files
merge_request
:
20798
author
:
type
:
fixed
spec/javascripts/ide/stores/actions/file_spec.js
View file @
832dcd6c
...
@@ -366,6 +366,23 @@ describe('IDE store file actions', () => {
...
@@ -366,6 +366,23 @@ describe('IDE store file actions', () => {
});
});
});
});
describe
(
'
return JSON
'
,
()
=>
{
beforeEach
(()
=>
{
mock
.
onGet
(
/
(
.*
)
/
).
replyOnce
(
200
,
JSON
.
stringify
({
test
:
'
123
'
}));
});
it
(
'
does not parse returned JSON
'
,
done
=>
{
store
.
dispatch
(
'
getRawFileData
'
,
{
path
:
tmpFile
.
path
})
.
then
(()
=>
{
expect
(
tmpFile
.
raw
).
toEqual
(
'
{"test":"123"}
'
);
done
();
})
.
catch
(
done
.
fail
);
});
});
describe
(
'
error
'
,
()
=>
{
describe
(
'
error
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
mock
.
onGet
(
/
(
.*
)
/
).
networkError
();
mock
.
onGet
(
/
(
.*
)
/
).
networkError
();
...
...
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