From 93c614ce9243c0743176a6e406a55f9dcb9bedf3 Mon Sep 17 00:00:00 2001
From: Phil Hughes <me@iamphill.com>
Date: Tue, 20 Nov 2018 12:37:57 +0000
Subject: Show toggle tree button on merge request commits

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53019
---
 app/assets/javascripts/diffs/components/app.vue | 55 +++++--------------------
 1 file changed, 11 insertions(+), 44 deletions(-)

(limited to 'app/assets/javascripts/diffs/components/app.vue')

diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue
index 0b7838292b2..22da38ce7a5 100644
--- a/app/assets/javascripts/diffs/components/app.vue
+++ b/app/assets/javascripts/diffs/components/app.vue
@@ -55,8 +55,6 @@ export default {
       diffViewType: state => state.diffs.diffViewType,
       mergeRequestDiffs: state => state.diffs.mergeRequestDiffs,
       mergeRequestDiff: state => state.diffs.mergeRequestDiff,
-      latestVersionPath: state => state.diffs.latestVersionPath,
-      startVersion: state => state.diffs.startVersion,
       commit: state => state.diffs.commit,
       targetBranchName: state => state.diffs.targetBranchName,
       renderOverflowWarning: state => state.diffs.renderOverflowWarning,
@@ -75,24 +73,6 @@ export default {
         path: '',
       };
     },
-    notAllCommentsDisplayed() {
-      if (this.commit) {
-        return __('Only comments from the following commit are shown below');
-      } else if (this.startVersion) {
-        return __(
-          "Not all comments are displayed because you're comparing two versions of the diff.",
-        );
-      }
-      return __(
-        "Not all comments are displayed because you're viewing an old version of the diff.",
-      );
-    },
-    showLatestVersion() {
-      if (this.commit) {
-        return __('Show latest version of the diff');
-      }
-      return __('Show latest version');
-    },
     canCurrentUserFork() {
       return this.currentUser.can_fork === true && this.currentUser.can_create_merge_request;
     },
@@ -184,10 +164,8 @@ export default {
     <div v-if="isLoading" class="loading"><gl-loading-icon /></div>
     <div v-else id="diffs" :class="{ active: shouldShow }" class="diffs tab-pane">
       <compare-versions
-        v-if="showCompareVersions"
         :merge-request-diffs="mergeRequestDiffs"
         :merge-request-diff="mergeRequestDiff"
-        :start-version="startVersion"
         :target-branch="targetBranch"
       />
 
@@ -199,34 +177,23 @@ export default {
         :email-patch-path="emailPatchPath"
       />
 
-      <div
-        v-if="commit || startVersion || (mergeRequestDiff && !mergeRequestDiff.latest)"
-        class="mr-version-controls"
-      >
-        <div class="content-block comments-disabled-notif clearfix">
-          <i class="fa fa-info-circle"></i> {{ notAllCommentsDisplayed }}
-          <div class="pull-right">
-            <a :href="latestVersionPath" class="btn btn-sm"> {{ showLatestVersion }} </a>
-          </div>
-        </div>
-      </div>
-
-      <commit-widget v-if="commit" :commit="commit" />
-
       <div
         :data-can-create-note="getNoteableData.current_user.can_create_note"
         class="files d-flex prepend-top-default"
       >
         <div v-show="showTreeList" class="diff-tree-list"><tree-list /></div>
-        <div v-if="diffFiles.length > 0" class="diff-files-holder">
-          <diff-file
-            v-for="file in diffFiles"
-            :key="file.newPath"
-            :file="file"
-            :can-current-user-fork="canCurrentUserFork"
-          />
+        <div class="diff-files-holder">
+          <commit-widget v-if="commit" :commit="commit" />
+          <template v-if="diffFiles.length > 0">
+            <diff-file
+              v-for="file in diffFiles"
+              :key="file.newPath"
+              :file="file"
+              :can-current-user-fork="canCurrentUserFork"
+            />
+          </template>
+          <no-changes v-else />
         </div>
-        <no-changes v-else />
       </div>
     </div>
   </div>
-- 
cgit v1.2.1

