diff --git a/app/assets/javascripts/repo/components/new_dropdown/index.vue b/app/assets/javascripts/repo/components/new_dropdown/index.vue new file mode 100644 index 00000000000..652c8027ae3 --- /dev/null +++ b/app/assets/javascripts/repo/components/new_dropdown/index.vue @@ -0,0 +1,70 @@ + + + diff --git a/app/assets/javascripts/repo/components/new_dropdown/modal.vue b/app/assets/javascripts/repo/components/new_dropdown/modal.vue new file mode 100644 index 00000000000..95ecfb29dd3 --- /dev/null +++ b/app/assets/javascripts/repo/components/new_dropdown/modal.vue @@ -0,0 +1,115 @@ + + + diff --git a/app/assets/javascripts/repo/components/repo_commit_section.vue b/app/assets/javascripts/repo/components/repo_commit_section.vue index 185cd90ac06..e3003fbf477 100644 --- a/app/assets/javascripts/repo/components/repo_commit_section.vue +++ b/app/assets/javascripts/repo/components/repo_commit_section.vue @@ -49,7 +49,7 @@ export default { // see https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions const commitMessage = this.commitMessage; const actions = this.changedFiles.map(f => ({ - action: 'update', + action: f.tempFile ? 'create' : 'update', file_path: f.path, content: f.newContent, })); diff --git a/app/assets/javascripts/repo/components/repo_editor.vue b/app/assets/javascripts/repo/components/repo_editor.vue index 4639bee6d66..9f567d4e94d 100644 --- a/app/assets/javascripts/repo/components/repo_editor.vue +++ b/app/assets/javascripts/repo/components/repo_editor.vue @@ -16,28 +16,35 @@ const RepoEditor = { }, mounted() { - Service.getRaw(this.activeFile.raw_path) - .then((rawResponse) => { - Store.blobRaw = rawResponse.data; - Store.activeFile.plain = rawResponse.data; + if (!this.activeFile.tempFile) { + Service.getRaw(this.activeFile.raw_path) + .then((rawResponse) => { + Store.blobRaw = rawResponse.data; + Store.activeFile.plain = rawResponse.data; - const monacoInstance = Helper.monaco.editor.create(this.$el, { - model: null, - readOnly: false, - contextmenu: true, - scrollBeyondLastLine: false, - }); - - Helper.monacoInstance = monacoInstance; - - this.addMonacoEvents(); - - this.setupEditor(); - }) - .catch(Helper.loadingError); + this.createMonacoInstance(); + }) + .catch(Helper.loadingError); + } else { + this.createMonacoInstance(); + } }, methods: { + createMonacoInstance() { + const monacoInstance = Helper.monaco.editor.create(this.$el, { + model: null, + readOnly: false, + contextmenu: true, + scrollBeyondLastLine: false, + }); + + Helper.monacoInstance = monacoInstance; + + this.addMonacoEvents(); + + this.setupEditor(); + }, setupEditor() { this.showHide(); diff --git a/app/assets/javascripts/repo/components/repo_file_buttons.vue b/app/assets/javascripts/repo/components/repo_file_buttons.vue index 03cd219e718..354be2545f4 100644 --- a/app/assets/javascripts/repo/components/repo_file_buttons.vue +++ b/app/assets/javascripts/repo/components/repo_file_buttons.vue @@ -11,7 +11,12 @@ const RepoFileButtons = { mixins: [RepoMixin], computed: { - + showButtons() { + return this.activeFile.raw_path || + this.activeFile.blame_path || + this.activeFile.commits_path || + this.activeFile.permalink; + }, rawDownloadButtonLabel() { return this.binary ? 'Download' : 'Raw'; }, @@ -30,7 +35,10 @@ export default RepoFileButtons;