Location aware search
Closes #3400 (closed) #14217 (closed)
Introduces suggestion grouping on the search box and adds the ability to the user to remove the location to search on.
Notes
- Suggestions are now grouped by category.
- Suggestions are displayed when no location is set.
- Would be great to provide suggestions for the specified location which could be a project or group.
- A location is set from the server for projects/groups related urls.
Default Apparence
When location badge is present
Suggestions
Suggestions when location badge is present
Closes #3400 (closed)
Merge request reports
Activity
Added 207 commits:
- ac01cf6f...ca3fc229 - 192 commits from branch
master
- 8a8db0ad - Working version of autocomplete with categorized results
- 7a08bb9a - Apply styling and tweaks to autocomplete dropdown
- b4814178 - Tweak behaviours
- ec5ed139 - Change hidden input id to avoid duplicated IDs
- e2df1bf7 - Add icons
- 1ddf4d93 - Better wording
- c32ede57 - Replace spinner icon for th FontAwesome one
- 4de31109 - Allow to pass non-asynchronous data to GitLabDropdown
- 236ef18d - Allow data with desired format
- a65ada83 - Allow to pass input filter param
- 15f44d83 - Allow to pass header items
- 08176058 - Allow to hightlight matches
- e6e3fd7f - Disable highlighting by default
- 37f67085 - Use new dropdown class for search suggestions
- 12be2099 - Delete unused file
Toggle commit list- ac01cf6f...ca3fc229 - 192 commits from branch
Added 28 commits:
- 12be2099...c4b35a62 - 12 commits from branch
master
- 424428da - Working version of autocomplete with categorized results
- 118220de - Apply styling and tweaks to autocomplete dropdown
- 80cb248a - Tweak behaviours
- c1864d96 - Change hidden input id to avoid duplicated IDs
- d18c9bab - Add icons
- 8585e4e6 - Better wording
- 60048e3b - Replace spinner icon for th FontAwesome one
- 33bc8d53 - Allow to pass non-asynchronous data to GitLabDropdown
- 5d7381b7 - Allow data with desired format
- 090b545a - Allow to pass input filter param
- ef886f2b - Allow to pass header items
- 1a702d28 - Allow to hightlight matches
- 093c709d - Disable highlighting by default
- eaa15508 - Use new dropdown class for search suggestions
- 54c285d5 - Delete unused file
- c10dfe98 - Fixes failing spec
Toggle commit list- 12be2099...c4b35a62 - 12 commits from branch
Reassigned to @jschatz1
Added 69 commits:
- c10dfe98...bc590ce6 - 53 commits from branch
master
- 4b3d3446 - Working version of autocomplete with categorized results
- 6f449c63 - Apply styling and tweaks to autocomplete dropdown
- d6f82242 - Tweak behaviours
- f825b60b - Change hidden input id to avoid duplicated IDs
- 1879057c - Add icons
- 651e893d - Better wording
- 8048d611 - Replace spinner icon for th FontAwesome one
- 2f4bdefc - Allow to pass non-asynchronous data to GitLabDropdown
- 761a8d98 - Allow data with desired format
- 238328f5 - Allow to pass input filter param
- 03afe766 - Allow to pass header items
- 424927a7 - Allow to hightlight matches
- dce5e9ce - Disable highlighting by default
- d38ef7b5 - Use new dropdown class for search suggestions
- 2925fc96 - Delete unused file
- 37440200 - Fixes failing spec
Toggle commit list- c10dfe98...bc590ce6 - 53 commits from branch
Added 217 commits:
-
37440200...eba00325 - 200 commits from branch
master
- c9e202c1 - Working version of autocomplete with categorized results
- 6a7f4a07 - Apply styling and tweaks to autocomplete dropdown
- 54797957 - Tweak behaviours
- 82e3c1f2 - Change hidden input id to avoid duplicated IDs
- ec0dfff2 - Add icons
- 2541f592 - Better wording
- dccda7d0 - Replace spinner icon for th FontAwesome one
- a0c1aa6d - Allow to pass non-asynchronous data to GitLabDropdown
- 0b893bec - Allow data with desired format
- 4e486c61 - Allow to pass input filter param
- f858ee43 - Allow to pass header items
- b5bd497a - Allow to hightlight matches
- 2d0f8f92 - Disable highlighting by default
- 53df7263 - Use new dropdown class for search suggestions
- 73e043d1 - Delete unused file
- cdd7e185 - Fixes failing spec
- 46f9790c - Fixing rebase conflicts
Toggle commit list-
37440200...eba00325 - 200 commits from branch
Added 18 commits:
- 4b3d3446 - Working version of autocomplete with categorized results
- 6f449c63 - Apply styling and tweaks to autocomplete dropdown
- d6f82242 - Tweak behaviours
- f825b60b - Change hidden input id to avoid duplicated IDs
- 1879057c - Add icons
- 651e893d - Better wording
- 8048d611 - Replace spinner icon for th FontAwesome one
- 2f4bdefc - Allow to pass non-asynchronous data to GitLabDropdown
- 761a8d98 - Allow data with desired format
- 238328f5 - Allow to pass input filter param
- 03afe766 - Allow to pass header items
- 424927a7 - Allow to hightlight matches
- dce5e9ce - Disable highlighting by default
- d38ef7b5 - Use new dropdown class for search suggestions
- 2925fc96 - Delete unused file
- 37440200 - Fixes failing spec
- 79a4292f - Merge branch 'issue_3400_port' of https://gitlab.com/gitlab-org/gitlab-ce into issue_3400_port
- 3898bffd - Code improvements
Toggle commit listAdded 13 commits:
-
3898bffd...18fc7c66 - 10 commits from branch
master
- b96d049e - Merge branch 'master' into issue_3400_port
- 9008457a - Save instance and avoid multiple instantiation
- b4593a1b - Fix multiple ajax calls and plugin instantiation
Toggle commit list-
3898bffd...18fc7c66 - 10 commits from branch
273 327 274 328 $.fn.glDropdown = (opts) -> 275 329 return @.each -> 276 new GitLabDropdown @, opts 330 if (!$.data @, 'glDropdown') 331 $.data(@, 'glDropdown', new GitLabDropdown @, opts) This saves the
GitLabDropdown
instance as data for the referred element. So you can access its methods by doing$(el).data('glDropdown').method()
and avoids multiple instantiation on the same element by mistake preventing, multiple event listeners to be set. This is a good practice for jQuery Plugins.
179 @locationBadgeEl.html('') 180 else 181 @addLocationBadge( 182 value: @originalState._location 183 ) 184 185 @dropdown.removeClass 'open' 186 187 # Only add class if there's a badge 188 if @badgePresent() 189 @searchInput.addClass 'disabled' 190 191 badgePresent: -> 192 @locationBadgeEl.children().length 193 194 resetSearchState: -> 65 font-size: 14px; 66 outline: none; 67 padding: 0; 68 margin-left: 5px; 69 line-height: 25px; 70 width: 98%; 71 } 72 73 .location-badge { 74 line-height: 25px; 75 padding: 0 5px; 76 border-radius: 2px; 77 font-size: 14px; 78 font-style: normal; 79 color: #AAAAAA; 80 display: inline-block; Added 110 commits:
-
b4593a1b...2bcbc7c6 - 105 commits from branch
master
- fb0d20c5 - Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into issue_3400_port
- 80174538 - Use .empty()
- 6e9ff2e5 - Delete .remove-badge from badge
- f7a97291 - Add variables
- 3a8c4ebb - Loop through form inputs
Toggle commit list-
b4593a1b...2bcbc7c6 - 105 commits from branch
Reassigned to @jschatz1
@alfredo1 this looks great! Really nice clean up too!
This might be a separate issue but do we want both search bars on the search page? cc @JobV @skyruler @dzaporozhets
Edited by Jacob SchatzMilestone changed to 8.6
@jschatz1 Yeah I was wondering the same, I think there's no need to keep both search forms on the search page.
Milestone changed to 8.7
@jschatz1 as per your comment here https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3212#note_4328660 I thought I should rename those
self
mentioned in merge request !3132 (closed)
@alfredo1 You said:
Oh. I know now what you meant. Let's use _this
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3212#note_4331681
Reassigned to @jschatz1
@dzaporozhets This is a large feature that I've reviewed at length. I am due to review it one more time but would you mind taking a look first?
@jschatz1 I'm going to check the empty dropdown issue
@jschatz1 There are another case, the dropdown menu is displayed when we click the input too. This behaviour is inherited from the dropdown. We need to handle that as well.
@dzaporozhets This MR looks good to me. I've tested and @alfredo1 made some great changes. I am ready to merge. Take a look real quick and let me know if you have any issues.
@jschatz1 Ok, Just let me do a fix for the unwanted menu toggling when clicking the input.
@jschatz1 fixed minor issues included the issue with the empty menu. I'll assign it to you after build passes.
@jschatz1 Doesn't work with the latest changes on
gl_dropdown.js
I'll see what's happening.Added 188 commits:
Toggle commit listAlso make sure UI match design. For example active label should be blue. cc @jschatz1
@dzaporozhets I think he said he just did a rebase and was having conflicts. I think that's why there's problems right now.
Edited by Jacob SchatzWhen it's ready again I'll assign to you. @dzaporozhets. Sorry for the confusion.
@jschatz1 ok no problem.
@dzaporozhets On which browser did you tested? It shouldn't look like that. This is how it should looks now.
Also, right now we are not requesting suggestions when there's a location badge. If a location badge is present the search will be scoped for the selected project/group. I think suggestions should have also the same behaviour. Since there aren't proper suggestions for the current location we are not doing any request. However would be great to have proper suggestions for the selected group/project.
This how it will look if we request suggestions when a location is set.
You can always remove the location badge to get suggestions and do a global search.
/cc @jschatz1
Edited by username-removed-408881I see we are returning autocomplete results for logged in users only. I'll fix this to not send unnecessary requests for not logged in users.
Added 1 commit:
- 4d8c5828 - Adjust menu positioning
Added 1 commit:
- ebd329fe - Make form width the same as dropdown width
Added 1 commit:
- bd1fbe18 - Use strings instead of constants
- Updated gifs on the description.
- Fixed overlapping on Safari.
- Now suggestions are requested when user is logged in only.
- Added separator between categories and visual tweaks.
- Use strings over constants on
search_helper.rb
for category names.
@dzaporozhets Do you think we still should display suggestions when a location is set? Or keep it as it is now?
Added 1 commit:
- 9d51f866 - Makes autocomplete dropdown look the same as others
@alfredo1 UI suggestions:
- Test starts too close to label. Check mockups
- Label color should be blue
cc @jschatz1
Added 43 commits:
-
9d51f866...1922e3a8 - 41 commits from branch
master
- 47405485 - Merge branch 'master' into issue_3400_port
- 55afebe1 - Always display suggestions
-
9d51f866...1922e3a8 - 41 commits from branch
Added 1 commit:
- c1e7351b - Fix broken spec
Added 1 commit:
- d5b4b4e0 - Hide suggestions when deleting all input value using other than backspace
@rspeicher yes you can :)
@rspeicher See:
@connorshea That is a good question. Unfortunately for mobile we are hiding the search form and we show a link which redirects to the search page. Not sure if we are going to enable this functionality for mobile too. /cc: @jschatz1
Reassigned to @jschatz1
@jschatz1 I'm going to remove unnecessary CSS then it's all yours
Added 1 commit:
- 2e5cd0f1 - Remove unused CSS
@jschatz1 Done!
@jschatz1 about 2 search bars we will need to hire one, but I was not sure how long it will take to implement that so you decide we can move it separate issue as you proposed
Added 91 commits:
-
2e5cd0f1...54957d69 - 90 commits from branch
master
- a41f5f59 - Merge branch 'master' into issue_3400_port
-
2e5cd0f1...54957d69 - 90 commits from branch
Reassigned to @jschatz1
@alfredo1 I am going to merge this but please make a new MR and fix these thing right away!!!:
- X button shouldn't clear the search context. Just the text IMO.
- If you type in a search and it comes up with the project it shouldn't redirect to the same page, it should just put the context pill back in.
- Do these two colors look the same to you? Did you use the designs??? #4f91f8:
- Those two search boxes are completely different sizes.
- Does this X's color look like the design? I understand we are using Font Awesome but at least get the color right. Use some slightly disabled color. I got #807E7E
I want to get people using the new search so we can make sure it's ok before launch.
Edited by Jacob Schatz@alfredo1 Fix the issues in this new issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/14800
mentioned in commit 403b7fe1