From ce2bc5c0a8021e876308b4990bc17f95aad90387 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 4 Jun 2018 12:11:00 +0100 Subject: correctly load up merge request fixed pipeline request throwing an error --- .../javascripts/ide/components/ide_review.vue | 13 +++++++---- .../javascripts/ide/components/ide_side_bar.vue | 8 ++++++- .../javascripts/ide/components/ide_status_bar.vue | 14 +++++------ .../ide/components/merge_requests/dropdown.vue | 3 --- .../ide/components/merge_requests/item.vue | 11 +++++++-- .../ide/components/merge_requests/list.vue | 27 ++++++++++++---------- app/assets/javascripts/ide/index.js | 1 + .../javascripts/ide/stores/actions/project.js | 3 +-- .../ide/stores/modules/merge_requests/actions.js | 15 ++++++++++++ .../ide/stores/modules/pipelines/actions.js | 3 +++ .../javascripts/ide/stores/mutation_types.js | 3 +++ app/assets/javascripts/ide/stores/mutations.js | 6 +++++ .../javascripts/vue_shared/components/tabs/tabs.js | 1 + .../stylesheets/framework/contextual_sidebar.scss | 10 ++++---- app/assets/stylesheets/pages/repo.scss | 4 ++++ 15 files changed, 84 insertions(+), 38 deletions(-) diff --git a/app/assets/javascripts/ide/components/ide_review.vue b/app/assets/javascripts/ide/components/ide_review.vue index 0c9ec3b00f0..ec2af50283a 100644 --- a/app/assets/javascripts/ide/components/ide_review.vue +++ b/app/assets/javascripts/ide/components/ide_review.vue @@ -11,17 +11,17 @@ export default { }, computed: { ...mapGetters(['currentMergeRequest']), - ...mapState(['viewer']), + ...mapState(['viewer', 'currentMergeRequestId']), showLatestChangesText() { - return !this.currentMergeRequest || this.viewer === viewerTypes.diff; + return !this.currentMergeRequestId || this.viewer === viewerTypes.diff; }, showMergeRequestText() { - return this.currentMergeRequest && this.viewer === viewerTypes.mr; + return this.currentMergeRequestId && this.viewer === viewerTypes.mr; }, }, mounted() { this.$nextTick(() => { - this.updateViewer(this.currentMergeRequest ? viewerTypes.mr : viewerTypes.diff); + this.updateViewer(this.currentMergeRequestId ? viewerTypes.mr : viewerTypes.diff); }); }, methods: { @@ -54,7 +54,10 @@ export default { diff --git a/app/assets/javascripts/ide/components/ide_side_bar.vue b/app/assets/javascripts/ide/components/ide_side_bar.vue index 631c995b59e..fdf191b3352 100644 --- a/app/assets/javascripts/ide/components/ide_side_bar.vue +++ b/app/assets/javascripts/ide/components/ide_side_bar.vue @@ -65,6 +65,8 @@ export default { watch: { currentBranchId() { this.$nextTick(() => { + if (!this.$refs.branchId) return; + this.showTooltip = this.$refs.branchId.scrollWidth > this.$refs.branchId.offsetWidth; }); }, @@ -145,6 +147,7 @@ export default {