diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-08-09 13:28:45 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-08-09 13:28:45 +0000 |
commit | e173db9c15045065312deae36c83b9b868128751 (patch) | |
tree | f90866e680d32e2de4fe2c10c09b6adbf4d93a1d /app | |
parent | a21906a49e92602712bf9c925bdb94e3e11084b6 (diff) | |
parent | b401bfd031d79bb178db1b88889ce1c831e9a075 (diff) | |
download | gitlab-ce-e173db9c15045065312deae36c83b9b868128751.tar.gz |
Merge branch 'ide-open-empty-merge-request' into 'master'
Allow the Web IDE to open empty merge requests
Closes #48166
See merge request gitlab-org/gitlab-ce!21102
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/ide/ide_router.js | 6 | ||||
-rw-r--r-- | app/assets/javascripts/ide/stores/actions/file.js | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/ide/ide_router.js b/app/assets/javascripts/ide/ide_router.js index c6d7d218e81..82f6f981e7a 100644 --- a/app/assets/javascripts/ide/ide_router.js +++ b/app/assets/javascripts/ide/ide_router.js @@ -117,7 +117,7 @@ router.beforeEach((to, from, next) => { mergeRequestId: to.params.mrid, }) .then(mr => { - store.dispatch('updateActivityBarView', activityBarViews.review); + store.dispatch('setCurrentBranchId', mr.source_branch); store.dispatch('getBranchData', { projectId: fullProjectId, @@ -144,6 +144,10 @@ router.beforeEach((to, from, next) => { }), ) .then(mrChanges => { + if (mrChanges.changes.length) { + store.dispatch('updateActivityBarView', activityBarViews.review); + } + mrChanges.changes.forEach((change, ind) => { const changeTreeEntry = store.state.entries[change.new_path]; diff --git a/app/assets/javascripts/ide/stores/actions/file.js b/app/assets/javascripts/ide/stores/actions/file.js index 9e3f5da4676..c9795750d65 100644 --- a/app/assets/javascripts/ide/stores/actions/file.js +++ b/app/assets/javascripts/ide/stores/actions/file.js @@ -54,9 +54,6 @@ export const setFileActive = ({ commit, state, getters, dispatch }, path) => { commit(types.SET_FILE_ACTIVE, { path, active: true }); dispatch('scrollToTab'); - - commit(types.SET_CURRENT_PROJECT, file.projectId); - commit(types.SET_CURRENT_BRANCH, file.branchId); }; export const getFileData = ({ state, commit, dispatch }, { path, makeFileActive = true }) => { |