2020-02-07 18:09:03 +00:00
|
|
|
<script>
|
|
|
|
/**
|
|
|
|
* This component is an iterative step towards refactoring and simplifying `vue_shared/components/file_row.vue`
|
|
|
|
* https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23720
|
|
|
|
*/
|
|
|
|
import FileRow from '~/vue_shared/components/file_row.vue';
|
2020-02-17 15:09:01 +00:00
|
|
|
import FileRowStats from './file_row_stats.vue';
|
2020-02-17 21:09:20 +00:00
|
|
|
import ChangedFileIcon from '~/vue_shared/components/changed_file_icon.vue';
|
2020-02-07 18:09:03 +00:00
|
|
|
|
|
|
|
export default {
|
2020-02-17 15:09:01 +00:00
|
|
|
name: 'DiffFileRow',
|
2020-02-07 18:09:03 +00:00
|
|
|
components: {
|
|
|
|
FileRow,
|
2020-02-17 15:09:01 +00:00
|
|
|
FileRowStats,
|
2020-02-17 21:09:20 +00:00
|
|
|
ChangedFileIcon,
|
2020-02-17 15:09:01 +00:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
file: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
hideFileStats: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
showFileRowStats() {
|
|
|
|
return !this.hideFileStats && this.file.type === 'blob';
|
|
|
|
},
|
2020-02-07 18:09:03 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2020-02-17 21:09:20 +00:00
|
|
|
<file-row :file="file" v-bind="$attrs" v-on="$listeners">
|
|
|
|
<file-row-stats v-if="showFileRowStats" :file="file" class="mr-1" />
|
2020-03-17 06:09:21 +00:00
|
|
|
<changed-file-icon :file="file" :size="16" :show-tooltip="true" />
|
2020-02-17 15:09:01 +00:00
|
|
|
</file-row>
|
2020-02-07 18:09:03 +00:00
|
|
|
</template>
|