summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-11-12 15:20:23 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-11-12 15:20:23 +0000
commit9ce0fa1fb594671a948478cf5b8a45c64b1267b6 (patch)
tree52e3d23a21e42458d326fa3d5be37906f0dd213f
parentf93539af26dcc76de97a4e647f75308f3164cbf6 (diff)
parenteaca2033d5145d8f679ecfe948a2d4ed909088ea (diff)
downloadgitlab-ce-9ce0fa1fb594671a948478cf5b8a45c64b1267b6.tar.gz
Merge branch 'mr-tree-filter-path-name' into 'master'
Changed diff tree filtering to path Closes #53781 See merge request gitlab-org/gitlab-ce!22978
-rw-r--r--app/assets/javascripts/diffs/components/tree_list.vue2
-rw-r--r--changelogs/unreleased/mr-tree-filter-path-name.yml5
-rw-r--r--spec/javascripts/diffs/components/tree_list_spec.js2
3 files changed, 7 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/components/tree_list.vue b/app/assets/javascripts/diffs/components/tree_list.vue
index 91052b303a6..ff1eb23cea3 100644
--- a/app/assets/javascripts/diffs/components/tree_list.vue
+++ b/app/assets/javascripts/diffs/components/tree_list.vue
@@ -35,7 +35,7 @@ export default {
if (search === '') return this.renderTreeList ? this.tree : this.allBlobs;
- return this.allBlobs.filter(f => f.name.toLowerCase().indexOf(search) >= 0);
+ return this.allBlobs.filter(f => f.path.toLowerCase().indexOf(search) >= 0);
},
rowDisplayTextKey() {
if (this.renderTreeList && this.search.trim() === '') {
diff --git a/changelogs/unreleased/mr-tree-filter-path-name.yml b/changelogs/unreleased/mr-tree-filter-path-name.yml
new file mode 100644
index 00000000000..152f8a67337
--- /dev/null
+++ b/changelogs/unreleased/mr-tree-filter-path-name.yml
@@ -0,0 +1,5 @@
+---
+title: Changed merge request filtering to be by path instead of name
+merge_request:
+author:
+type: changed
diff --git a/spec/javascripts/diffs/components/tree_list_spec.js b/spec/javascripts/diffs/components/tree_list_spec.js
index fc94d0bab5b..a0b380adfd6 100644
--- a/spec/javascripts/diffs/components/tree_list_spec.js
+++ b/spec/javascripts/diffs/components/tree_list_spec.js
@@ -81,7 +81,7 @@ describe('Diffs tree list component', () => {
});
it('filters tree list to blobs matching search', done => {
- vm.search = 'index';
+ vm.search = 'app/index';
vm.$nextTick(() => {
expect(vm.$el.querySelectorAll('.file-row').length).toBe(1);