diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-12-16 20:52:02 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-12-16 20:52:02 +0000 |
commit | 77bfad1f4e397b012b19dda51e55a35af6935c38 (patch) | |
tree | 1225727c1f4876ae7c039fa037899cada675baed /config | |
parent | e7b995e85f5a1be5c52cdb44b8df89da7372e814 (diff) | |
parent | 1356e40f22c555f676777ed9385a12b09c19fdce (diff) | |
download | gitlab-ce-77bfad1f4e397b012b19dda51e55a35af6935c38.tar.gz |
Merge branch '18435-autocomplete-is-not-performant' into 'master'
Make autocomplete request performant
## What does this MR do?
Restricts the `autocomplete_sources`action to returning the `json`of one specific `at` type at a time.
Makes sure all commands start by immediately showing the `loading` dropdown.
If the `loading` dropdown is active, we will request and load in the data for that specific `at` type. We manually trigger the filter again. This time, if `loading` dropdown is not active, initiate default filter behaviour and use the correct data template.
Also fixes an issue where `setup` was called multiple times by only setting up and destroying atwho on a focused/blured input.
## Are there points in the code the reviewer needs to double check?
## Why was this MR needed?
`autocomplete_sources` was requested on page load and is large.
## Screenshots (if relevant)
3 requests for 3 different first-time references.
![Screen_Shot_2016-10-14_at_14.43.12](/uploads/0b04eab0d0bf3638d6d6e431036b8089/Screen_Shot_2016-10-14_at_14.43.12.png)
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes #22802
Closes #18435
See merge request !6856
Diffstat (limited to 'config')
-rw-r--r-- | config/routes/project.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/config/routes/project.rb b/config/routes/project.rb index 0754f0ec3b0..e17d6bae10c 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -11,6 +11,18 @@ constraints(ProjectUrlConstrainer.new) do module: :projects, as: :project) do + resources :autocomplete_sources, only: [] do + collection do + get 'emojis' + get 'members' + get 'issues' + get 'merge_requests' + get 'labels' + get 'milestones' + get 'commands' + end + end + # # Templates # @@ -316,7 +328,6 @@ constraints(ProjectUrlConstrainer.new) do post :remove_export post :generate_new_export get :download_export - get :autocomplete_sources get :activity get :refs put :new_issue_address |