From cc0663140fb2d54f7f9962c9c27c82e2eb5116df Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 9 May 2018 10:55:37 +0100 Subject: Fixed empty editors in the IDE Closes #46153 --- app/assets/javascripts/ide/lib/common/model.js | 6 +++--- app/assets/javascripts/ide/stores/actions/file.js | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'app/assets/javascripts') diff --git a/app/assets/javascripts/ide/lib/common/model.js b/app/assets/javascripts/ide/lib/common/model.js index 016dcda1fa1..b1e43a1e38c 100644 --- a/app/assets/javascripts/ide/lib/common/model.js +++ b/app/assets/javascripts/ide/lib/common/model.js @@ -14,12 +14,12 @@ export default class Model { (this.originalModel = this.monaco.editor.createModel( head ? head.content : this.file.raw, undefined, - new this.monaco.Uri(null, null, `original/${this.file.key}`), + new this.monaco.Uri(null, null, `original/${this.path}`), )), (this.model = this.monaco.editor.createModel( this.content, undefined, - new this.monaco.Uri(null, null, this.file.key), + new this.monaco.Uri(null, null, this.path), )), ); if (this.file.mrChange) { @@ -27,7 +27,7 @@ export default class Model { (this.baseModel = this.monaco.editor.createModel( this.file.baseRaw, undefined, - new this.monaco.Uri(null, null, `target/${this.file.path}`), + new this.monaco.Uri(null, null, `target/${this.path}`), )), ); } diff --git a/app/assets/javascripts/ide/stores/actions/file.js b/app/assets/javascripts/ide/stores/actions/file.js index 3ac9b9222ca..b6baa693104 100644 --- a/app/assets/javascripts/ide/stores/actions/file.js +++ b/app/assets/javascripts/ide/stores/actions/file.js @@ -196,6 +196,8 @@ export const unstageChange = ({ commit }, path) => { }; export const openPendingTab = ({ commit, getters, dispatch, state }, { file, keyPrefix }) => { + if (getters.activeFile && getters.activeFile.key === `${keyPrefix}-${file.key}`) return false; + state.openFiles.forEach(f => eventHub.$emit(`editor.update.model.dispose.${f.key}`)); commit(types.ADD_PENDING_TAB, { file, keyPrefix }); -- cgit v1.2.1 From 5c8f31eb7ee9a4993b41a72d34afddd43831517e Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 9 May 2018 17:07:02 +0100 Subject: Hide merge request option in IDE when merge requests are disabled Closes #45698 --- app/assets/javascripts/ide/components/commit_sidebar/actions.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/assets/javascripts') diff --git a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue index 6a5790c9dff..b4f3778d946 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/actions.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/actions.vue @@ -1,5 +1,5 @@