summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-11-20 11:44:42 +0000
committerPhil Hughes <me@iamphill.com>2018-11-20 11:44:42 +0000
commitac8895b7413080a0f1a1bfe92227d3871e0ba1c7 (patch)
treead83719c1e57f26d0082d9c9ef5c68eeac0935d3 /app/assets/javascripts/ide
parent117fb4487361aa86f6c1bf8e52e30d5e8e2c6630 (diff)
downloadgitlab-ce-ac8895b7413080a0f1a1bfe92227d3871e0ba1c7.tar.gz
Open first 10 merge request files in IDE
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51635
Diffstat (limited to 'app/assets/javascripts/ide')
-rw-r--r--app/assets/javascripts/ide/stores/actions/file.js7
-rw-r--r--app/assets/javascripts/ide/stores/actions/merge_request.js1
2 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/ide/stores/actions/file.js b/app/assets/javascripts/ide/stores/actions/file.js
index 30dcf7ef4df..2cdbb312b9e 100644
--- a/app/assets/javascripts/ide/stores/actions/file.js
+++ b/app/assets/javascripts/ide/stores/actions/file.js
@@ -56,7 +56,10 @@ export const setFileActive = ({ commit, state, getters, dispatch }, path) => {
dispatch('scrollToTab');
};
-export const getFileData = ({ state, commit, dispatch }, { path, makeFileActive = true }) => {
+export const getFileData = (
+ { state, commit, dispatch },
+ { path, makeFileActive = true, openFile = makeFileActive },
+) => {
const file = state.entries[path];
if (file.raw || (file.tempFile && !file.prevPath)) return Promise.resolve();
@@ -72,7 +75,7 @@ export const getFileData = ({ state, commit, dispatch }, { path, makeFileActive
setPageTitle(decodeURI(normalizedHeaders['PAGE-TITLE']));
commit(types.SET_FILE_DATA, { data, file });
- if (makeFileActive) commit(types.TOGGLE_FILE_OPEN, path);
+ if (openFile) commit(types.TOGGLE_FILE_OPEN, path);
if (makeFileActive) dispatch('setFileActive', path);
commit(types.TOGGLE_LOADING, { entry: file });
})
diff --git a/app/assets/javascripts/ide/stores/actions/merge_request.js b/app/assets/javascripts/ide/stores/actions/merge_request.js
index 3ac2f8b3698..8404c6d4f72 100644
--- a/app/assets/javascripts/ide/stores/actions/merge_request.js
+++ b/app/assets/javascripts/ide/stores/actions/merge_request.js
@@ -161,6 +161,7 @@ export const openMergeRequest = (
dispatch('getFileData', {
path: change.new_path,
makeFileActive: ind === 0,
+ openFile: true,
});
}
}