diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2017-01-27 13:22:12 -0600 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-01-27 15:21:30 -0600 |
commit | 444ac6aa02e5b4b7025a9058a98dc6ae8db8e806 (patch) | |
tree | 4b6a23cc0c184b908438cb1c73600a336eda342e /app/assets | |
parent | 42836e8ef8ed6bf4b6748f6a9dc37d9173751bd1 (diff) | |
download | gitlab-ce-444ac6aa02e5b4b7025a9058a98dc6ae8db8e806.tar.gz |
Fix filtering usernames with multiple wordsfix-filtering-username-with-multiple-words
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/filtered_search/dropdown_user.js.es6 | 9 |
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() { |