diff options
author | Phil Hughes <me@iamphill.com> | 2018-10-08 11:50:22 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-10-23 09:12:36 +0100 |
commit | 2d00e7fce5b33f2a8c89dccd33d5d1758cc846c7 (patch) | |
tree | 146ece7201a5ec88b4c99053f53fb18cc2b9f1b6 /app/assets/javascripts/vue_shared | |
parent | 10bb8297ebe5fc01540b20c3fd365234779b6837 (diff) | |
download | gitlab-ce-2d00e7fce5b33f2a8c89dccd33d5d1758cc846c7.tar.gz |
Add list mode to file browser in diffs
This adds toggle buttons to switch between file & tree list.
For file list, it renders the truncated paths with the ellipsis
at the start of the path.
When focusing the input, it hides the toggle buttons.
On blur, the buttons get shown again.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51859
Diffstat (limited to 'app/assets/javascripts/vue_shared')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/file_row.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_shared/components/file_row.vue b/app/assets/javascripts/vue_shared/components/file_row.vue index 36a345130c0..7c34d776c7f 100644 --- a/app/assets/javascripts/vue_shared/components/file_row.vue +++ b/app/assets/javascripts/vue_shared/components/file_row.vue @@ -34,6 +34,11 @@ export default { required: false, default: false, }, + displayTextKey: { + type: String, + required: false, + default: 'name', + }, }, data() { return { @@ -156,7 +161,7 @@ export default { :size="16" class="append-right-5" /> - {{ file.name }} + {{ file[displayTextKey] }} </span> <component :is="extraComponent" @@ -175,6 +180,7 @@ export default { :hide-extra-on-tree="hideExtraOnTree" :extra-component="extraComponent" :show-changed-icon="showChangedIcon" + :display-text-key="displayTextKey" @toggleTreeOpen="toggleTreeOpen" @clickFile="clickedFile" /> |