Merge branch 'ide-edit-json-files' into 'master'
Fixed IDE not opening JSON files See merge request gitlab-org/gitlab-ce!20798
This commit is contained in:
commit
ffbfd18ce2
|
@ -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 {
|
||||||
|
|
||||||
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);
|
||||||
},
|
},
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Fixed IDE not opening JSON files
|
||||||
|
merge_request: 20798
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue