summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-17 15:09:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-17 15:09:01 +0000
commitb304a72312465ed4c0a568ee6a6ea5e97f705c9b (patch)
treea2f25dbea26c81e88b169c55a6275e3969323e82 /app/assets/javascripts/diffs
parentb84eeb256c4a780d902faee1f99ca9a711b3214a (diff)
downloadgitlab-ce-b304a72312465ed4c0a568ee6a6ea5e97f705c9b.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs')
-rw-r--r--app/assets/javascripts/diffs/components/diff_file_row.vue22
-rw-r--r--app/assets/javascripts/diffs/components/tree_list.vue6
2 files changed, 22 insertions, 6 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_file_row.vue b/app/assets/javascripts/diffs/components/diff_file_row.vue
index f41337762fd..5aaed0d40db 100644
--- a/app/assets/javascripts/diffs/components/diff_file_row.vue
+++ b/app/assets/javascripts/diffs/components/diff_file_row.vue
@@ -4,14 +4,34 @@
* https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23720
*/
import FileRow from '~/vue_shared/components/file_row.vue';
+import FileRowStats from './file_row_stats.vue';
export default {
+ name: 'DiffFileRow',
components: {
FileRow,
+ FileRowStats,
+ },
+ props: {
+ file: {
+ type: Object,
+ required: true,
+ },
+ hideFileStats: {
+ type: Boolean,
+ required: true,
+ },
+ },
+ computed: {
+ showFileRowStats() {
+ return !this.hideFileStats && this.file.type === 'blob';
+ },
},
};
</script>
<template>
- <file-row v-bind="$attrs" v-on="$listeners" />
+ <file-row :file="file" :hide-file-stats="hideFileStats" v-bind="$attrs" v-on="$listeners">
+ <file-row-stats v-if="showFileRowStats" :file="file" />
+ </file-row>
</template>
diff --git a/app/assets/javascripts/diffs/components/tree_list.vue b/app/assets/javascripts/diffs/components/tree_list.vue
index 18c3002825e..1eac3430a20 100644
--- a/app/assets/javascripts/diffs/components/tree_list.vue
+++ b/app/assets/javascripts/diffs/components/tree_list.vue
@@ -5,7 +5,6 @@ import { s__, sprintf } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue';
import FileTree from '~/vue_shared/components/file_tree.vue';
import DiffFileRow from './diff_file_row.vue';
-import FileRowStats from './file_row_stats.vue';
export default {
directives: {
@@ -49,9 +48,6 @@ export default {
return acc;
}, []);
},
- fileRowExtraComponent() {
- return this.hideFileStats ? null : FileRowStats;
- },
},
methods: {
...mapActions('diffs', ['toggleTreeOpen', 'scrollToFile']),
@@ -98,8 +94,8 @@ export default {
:key="file.key"
:file="file"
:level="0"
+ :hide-file-stats="hideFileStats"
:hide-extra-on-tree="true"
- :extra-component="fileRowExtraComponent"
:show-changed-icon="true"
:file-row-component="$options.DiffFileRow"
@toggleTreeOpen="toggleTreeOpen"