summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorFilipa Lacerda <lacerda.filipa@gmail.com>2017-02-01 20:53:58 +0000
committerFilipa Lacerda <lacerda.filipa@gmail.com>2017-02-01 20:53:58 +0000
commit797ca1b15d4a1c20b1cbab3060061d5b684048e3 (patch)
tree915b0b146adffce5c0568d830fef0d1504937ac5 /app/assets
parentdd929203bb9502d9547bcb45c04c8be34d8c0b3b (diff)
parent444ac6aa02e5b4b7025a9058a98dc6ae8db8e806 (diff)
downloadgitlab-ce-797ca1b15d4a1c20b1cbab3060061d5b684048e3.tar.gz
Merge branch 'fix-filtering-username-with-multiple-words' into 'master'
Fix filtering usernames with multiple words Closes #27404 See merge request !8851
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/filtered_search/dropdown_user.js.es69
1 files changed, 8 insertions, 1 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_user.js.es6 b/app/assets/javascripts/filtered_search/dropdown_user.js.es6
index 7bf199d9274..162fd6044e5 100644
--- a/app/assets/javascripts/filtered_search/dropdown_user.js.es6
+++ b/app/assets/javascripts/filtered_search/dropdown_user.js.es6
@@ -39,8 +39,15 @@
getSearchInput() {
const query = gl.DropdownUtils.getSearchInput(this.input);
const { lastToken } = gl.FilteredSearchTokenizer.processTokens(query);
+ let value = lastToken.value || '';
- return lastToken.value || '';
+ // Removes the first character if it is a quotation so that we can search
+ // with multiple words
+ if (value[0] === '"' || value[0] === '\'') {
+ value = value.slice(1);
+ }
+
+ return value;
}
init() {