Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Commit

Permalink
Fixed small glitch highlighting matched text in principal search
Browse files Browse the repository at this point in the history
In case the query for principals contains a domain (e.g. user@domain),
the search is done just for "user" in the specific domain so multiple
principals can be found and the highlighted matched text should be just
"user" instead of the whole "user@domain".

Change-Id: I2c53dcf1d4b8e5d6b55da1f8c67275318c1f38fa
Reviewed-on: http://bellevue-ci.eng.vmware.com:8080/22802
Reviewed-by: Stanislav Hadjiiski <hadjiiskis@vmware.com>
Reviewed-by: Antonio Filipov <afilipov@vmware.com>
Closures-Verified: jenkins <jenkins@vmware.com>
Upgrade-Verified: jenkins <jenkins@vmware.com>
Bellevue-Verified: jenkins <jenkins@vmware.com>
CS-Verified: jenkins <jenkins@vmware.com>
  • Loading branch information
Sergio Sanchez committed Dec 7, 2017
1 parent af9759b commit 4849cc4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ui/common/dist/components/common/SimpleSearch.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/common/dist/components/common/SimpleSearch.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions ui/common/src/components/common/SimpleSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ module.exports = class SimpleSearch {
suggestion: function(context) {
var name = context.name || '';
var query = context._query || '';

var queryAtIndex = query.lastIndexOf('@');
if (queryAtIndex > 0) {
// ignore everything after the last '@' in case of query@domain searches
query = query.substring(0, queryAtIndex);
}

var start = name.indexOf(query);
var end = start + query.length;
var prefix = '';
Expand Down

0 comments on commit 4849cc4

Please sign in to comment.