diff options
author | Phil Hughes <me@iamphill.com> | 2018-07-26 14:56:56 +0000 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-07-26 14:56:56 +0000 |
commit | cded268ca1d49fe93b8e0940586e9792347c88c3 (patch) | |
tree | 9d84a5e8ae38e53514b6ab1f4e99d38ddf2fe138 /app/assets/javascripts/ide/components/ide_review.vue | |
parent | 8873840839811948b2f29175177b91bcf806a3f8 (diff) | |
download | gitlab-ce-cded268ca1d49fe93b8e0940586e9792347c88c3.tar.gz |
Enable deleting files in the Web IDE
Diffstat (limited to 'app/assets/javascripts/ide/components/ide_review.vue')
-rw-r--r-- | app/assets/javascripts/ide/components/ide_review.vue | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/assets/javascripts/ide/components/ide_review.vue b/app/assets/javascripts/ide/components/ide_review.vue index f9978762c45..d09c99050fe 100644 --- a/app/assets/javascripts/ide/components/ide_review.vue +++ b/app/assets/javascripts/ide/components/ide_review.vue @@ -10,7 +10,7 @@ export default { EditorModeDropdown, }, computed: { - ...mapGetters(['currentMergeRequest']), + ...mapGetters(['currentMergeRequest', 'activeFile']), ...mapState(['viewer', 'currentMergeRequestId']), showLatestChangesText() { return !this.currentMergeRequestId || this.viewer === viewerTypes.diff; @@ -23,12 +23,20 @@ export default { }, }, mounted() { + if (this.activeFile && this.activeFile.pending && !this.activeFile.deleted) { + this.$router.push(`/project${this.activeFile.url}`, () => { + this.updateViewer('editor'); + }); + } else if (this.activeFile && this.activeFile.deleted) { + this.resetOpenFiles(); + } + this.$nextTick(() => { this.updateViewer(this.currentMergeRequestId ? viewerTypes.mr : viewerTypes.diff); }); }, methods: { - ...mapActions(['updateViewer']), + ...mapActions(['updateViewer', 'resetOpenFiles']), }, }; </script> @@ -36,7 +44,6 @@ export default { <template> <ide-tree-list :viewer-type="viewer" - :disable-action-dropdown="true" header-class="ide-review-header" > <template |