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
Showing
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to comment