diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 18:09:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-17 18:09:01 +0300 |
commit | b304a72312465ed4c0a568ee6a6ea5e97f705c9b (patch) | |
tree | a2f25dbea26c81e88b169c55a6275e3969323e82 /app/assets/javascripts/diffs/components | |
parent | b84eeb256c4a780d902faee1f99ca9a711b3214a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs/components')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_file_row.vue | 22 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/components/tree_list.vue | 6 |
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" |