Commit 1623e4ac authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'ide-file-finder-improve-order' into 'master'

Fixed IDE file finder ordering

See merge request gitlab-org/gitlab-ce!18948
parents 76e276cb a7ea0e6b
...@@ -39,12 +39,10 @@ export default { ...@@ -39,12 +39,10 @@ export default {
return this.allBlobs.slice(0, MAX_FILE_FINDER_RESULTS); return this.allBlobs.slice(0, MAX_FILE_FINDER_RESULTS);
} }
return fuzzaldrinPlus return fuzzaldrinPlus.filter(this.allBlobs, searchText, {
.filter(this.allBlobs, searchText, { key: 'path',
key: 'path', maxResults: MAX_FILE_FINDER_RESULTS,
maxResults: MAX_FILE_FINDER_RESULTS, });
})
.sort((a, b) => b.lastOpenedAt - a.lastOpenedAt);
}, },
filteredBlobsLength() { filteredBlobsLength() {
return this.filteredBlobs.length; return this.filteredBlobs.length;
......
...@@ -52,7 +52,10 @@ export default { ...@@ -52,7 +52,10 @@ export default {
methods: { methods: {
...mapActions(['toggleFileFinder']), ...mapActions(['toggleFileFinder']),
mousetrapStopCallback(e, el, combo) { mousetrapStopCallback(e, el, combo) {
if (combo === 't' && el.classList.contains('dropdown-input-field')) { if (
(combo === 't' && el.classList.contains('dropdown-input-field')) ||
el.classList.contains('inputarea')
) {
return true; return true;
} else if (combo === 'command+p' || combo === 'ctrl+p') { } else if (combo === 'command+p' || combo === 'ctrl+p') {
return false; return false;
......
...@@ -107,5 +107,11 @@ describe('ide component', () => { ...@@ -107,5 +107,11 @@ describe('ide component', () => {
vm.mousetrapStopCallback(null, vm.$el.querySelector('.dropdown-input-field'), 't'), vm.mousetrapStopCallback(null, vm.$el.querySelector('.dropdown-input-field'), 't'),
).toBe(true); ).toBe(true);
}); });
it('stops callback in monaco editor', () => {
setFixtures('<div class="inputarea"></div>');
expect(vm.mousetrapStopCallback(null, document.querySelector('.inputarea'), 't')).toBe(true);
});
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment