diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-05-23 08:50:32 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-05-23 08:50:32 +0000 |
commit | 1623e4ac75d5db61e4f08536f555ac87fce6fc1b (patch) | |
tree | 9b67a6b1ae5035aafa4fc5637f1bc7b9d57206c6 | |
parent | 76e276cb433a7023cf8154f9d9555725b3b11e67 (diff) | |
parent | a7ea0e6bfb1fa11c8607281815a7bb6d70f89c25 (diff) | |
download | gitlab-ce-1623e4ac75d5db61e4f08536f555ac87fce6fc1b.tar.gz |
Merge branch 'ide-file-finder-improve-order' into 'master'
Fixed IDE file finder ordering
See merge request gitlab-org/gitlab-ce!18948
-rw-r--r-- | app/assets/javascripts/ide/components/file_finder/index.vue | 10 | ||||
-rw-r--r-- | app/assets/javascripts/ide/components/ide.vue | 5 | ||||
-rw-r--r-- | spec/javascripts/ide/components/ide_spec.js | 6 |
3 files changed, 14 insertions, 7 deletions
diff --git a/app/assets/javascripts/ide/components/file_finder/index.vue b/app/assets/javascripts/ide/components/file_finder/index.vue index ea2b13a8b21..cabb3f59b17 100644 --- a/app/assets/javascripts/ide/components/file_finder/index.vue +++ b/app/assets/javascripts/ide/components/file_finder/index.vue @@ -39,12 +39,10 @@ export default { return this.allBlobs.slice(0, MAX_FILE_FINDER_RESULTS); } - return fuzzaldrinPlus - .filter(this.allBlobs, searchText, { - key: 'path', - maxResults: MAX_FILE_FINDER_RESULTS, - }) - .sort((a, b) => b.lastOpenedAt - a.lastOpenedAt); + return fuzzaldrinPlus.filter(this.allBlobs, searchText, { + key: 'path', + maxResults: MAX_FILE_FINDER_RESULTS, + }); }, filteredBlobsLength() { return this.filteredBlobs.length; diff --git a/app/assets/javascripts/ide/components/ide.vue b/app/assets/javascripts/ide/components/ide.vue index 6c373a92776..1ec69adce09 100644 --- a/app/assets/javascripts/ide/components/ide.vue +++ b/app/assets/javascripts/ide/components/ide.vue @@ -52,7 +52,10 @@ export default { methods: { ...mapActions(['toggleFileFinder']), 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; } else if (combo === 'command+p' || combo === 'ctrl+p') { return false; diff --git a/spec/javascripts/ide/components/ide_spec.js b/spec/javascripts/ide/components/ide_spec.js index 6f580e1f7af..045a60e56a0 100644 --- a/spec/javascripts/ide/components/ide_spec.js +++ b/spec/javascripts/ide/components/ide_spec.js @@ -107,5 +107,11 @@ describe('ide component', () => { vm.mousetrapStopCallback(null, vm.$el.querySelector('.dropdown-input-field'), 't'), ).toBe(true); }); + + it('stops callback in monaco editor', () => { + setFixtures('<div class="inputarea"></div>'); + + expect(vm.mousetrapStopCallback(null, document.querySelector('.inputarea'), 't')).toBe(true); + }); }); }); |