From 2d00e7fce5b33f2a8c89dccd33d5d1758cc846c7 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 8 Oct 2018 11:50:22 +0100 Subject: 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 --- .../javascripts/diffs/components/tree_list.vue | 101 ++++++++++++++++----- app/assets/javascripts/diffs/store/utils.js | 13 +++ .../javascripts/vue_shared/components/file_row.vue | 8 +- app/assets/stylesheets/pages/diff.scss | 14 ++- changelogs/unreleased/mr-file-list.yml | 5 + locale/gitlab.pot | 6 ++ .../javascripts/diffs/components/tree_list_spec.js | 70 ++++++++++++++ spec/javascripts/diffs/store/utils_spec.js | 28 ++++++ 8 files changed, 221 insertions(+), 24 deletions(-) create mode 100644 changelogs/unreleased/mr-file-list.yml diff --git a/app/assets/javascripts/diffs/components/tree_list.vue b/app/assets/javascripts/diffs/components/tree_list.vue index cfe4273742f..ea1a73d40cd 100644 --- a/app/assets/javascripts/diffs/components/tree_list.vue +++ b/app/assets/javascripts/diffs/components/tree_list.vue @@ -1,10 +1,14 @@