diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-07 18:09:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-07 18:09:03 +0000 |
commit | d7ce7307dca551759ffa972015875f8ebe476927 (patch) | |
tree | 7cb8c211b737de7120dd2f1e825852e77ac5d380 /app/assets/javascripts/diffs/components | |
parent | e43077ab4742ba5083a01a1e5341db1a1b7a1701 (diff) | |
download | gitlab-ce-d7ce7307dca551759ffa972015875f8ebe476927.tar.gz |
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 | 17 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/components/tree_list.vue | 9 |
2 files changed, 23 insertions, 3 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_file_row.vue b/app/assets/javascripts/diffs/components/diff_file_row.vue new file mode 100644 index 00000000000..f41337762fd --- /dev/null +++ b/app/assets/javascripts/diffs/components/diff_file_row.vue @@ -0,0 +1,17 @@ +<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'; + +export default { + components: { + FileRow, + }, +}; +</script> + +<template> + <file-row v-bind="$attrs" v-on="$listeners" /> +</template> diff --git a/app/assets/javascripts/diffs/components/tree_list.vue b/app/assets/javascripts/diffs/components/tree_list.vue index b13619a5471..18c3002825e 100644 --- a/app/assets/javascripts/diffs/components/tree_list.vue +++ b/app/assets/javascripts/diffs/components/tree_list.vue @@ -3,7 +3,8 @@ import { mapActions, mapGetters, mapState } from 'vuex'; import { GlTooltipDirective } from '@gitlab/ui'; import { s__, sprintf } from '~/locale'; import Icon from '~/vue_shared/components/icon.vue'; -import FileRow from '~/vue_shared/components/file_row.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 { @@ -12,7 +13,7 @@ export default { }, components: { Icon, - FileRow, + FileTree, }, props: { hideFileStats: { @@ -61,6 +62,7 @@ export default { searchPlaceholder: sprintf(s__('MergeRequest|Search files (%{modifier_key}P)'), { modifier_key: /Mac/i.test(navigator.userAgent) ? '⌘' : 'Ctrl+', }), + DiffFileRow, }; </script> @@ -91,7 +93,7 @@ export default { </div> <div :class="{ 'pt-0 tree-list-blobs': !renderTreeList }" class="tree-list-scroll"> <template v-if="filteredTreeList.length"> - <file-row + <file-tree v-for="file in filteredTreeList" :key="file.key" :file="file" @@ -99,6 +101,7 @@ export default { :hide-extra-on-tree="true" :extra-component="fileRowExtraComponent" :show-changed-icon="true" + :file-row-component="$options.DiffFileRow" @toggleTreeOpen="toggleTreeOpen" @clickFile="scrollToFile" /> |