Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
15454eb5
Commit
15454eb5
authored
Dec 07, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to search for filter dropdowns without filter symbol
parent
158e90d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
6 deletions
+37
-6
app/assets/javascripts/filtered_search/dropdown_assignee.js.es6
...sets/javascripts/filtered_search/dropdown_assignee.js.es6
+15
-0
app/assets/javascripts/filtered_search/dropdown_author.js.es6
...assets/javascripts/filtered_search/dropdown_author.js.es6
+9
-2
app/assets/javascripts/filtered_search/dropdown_label.js.es6
app/assets/javascripts/filtered_search/dropdown_label.js.es6
+6
-2
app/assets/javascripts/filtered_search/dropdown_milestone.js.es6
...ets/javascripts/filtered_search/dropdown_milestone.js.es6
+7
-2
No files found.
app/assets/javascripts/filtered_search/dropdown_assignee.js.es6
View file @
15454eb5
...
...
@@ -23,6 +23,21 @@
super.renderContent();
droplab.setData(this.hookId, '/autocomplete/users.json?search=&per_page=20&active=true&project_id=2&group_id=&skip_ldap=&todo_filter=&todo_state_filter=¤t_user=true&push_code_to_protected_branches=&author_id=&skip_users=');
}
filterMethod(item, query) {
const { value } = gl.FilteredSearchTokenizer.getLastTokenObject(query);
const valueWithoutColon = value.slice(1).toLowerCase();
const valueWithoutPrefix = valueWithoutColon.slice(1);
const username = item.username.toLowerCase();
const name = item.name.toLowerCase();
const noUsernameMatch = username.indexOf(valueWithoutPrefix) === -1 && username.indexOf(valueWithoutColon) === -1;
const noNameMatch = name.indexOf(valueWithoutColon) === -1;
item.droplab_hidden = noUsernameMatch && noNameMatch;
return item;
}
}
global.DropdownAssignee = DropdownAssignee;
...
...
app/assets/javascripts/filtered_search/dropdown_author.js.es6
View file @
15454eb5
...
...
@@ -22,9 +22,16 @@
filterMethod(item, query) {
const { value } = gl.FilteredSearchTokenizer.getLastTokenObject(query);
const valueWithoutPrefix = value.slice(1);
const valueWithoutColon = value.slice(1).toLowerCase();
const valueWithoutPrefix = valueWithoutColon.slice(1);
item.droplab_hidden = item['username'].indexOf(valueWithoutPrefix) === -1;
const username = item.username.toLowerCase();
const name = item.name.toLowerCase();
const noUsernameMatch = username.indexOf(valueWithoutPrefix) === -1 && username.indexOf(valueWithoutColon) === -1;
const noNameMatch = name.indexOf(valueWithoutColon) === -1;
item.droplab_hidden = noUsernameMatch && noNameMatch;
return item;
}
}
...
...
app/assets/javascripts/filtered_search/dropdown_label.js.es6
View file @
15454eb5
...
...
@@ -27,9 +27,13 @@
filterMethod(item, query) {
const { value } = gl.FilteredSearchTokenizer.getLastTokenObject(query);
const valueWithoutPrefix = value.slice(1);
const valueWithoutColon = value.slice(1).toLowerCase();
const valueWithoutPrefix = valueWithoutColon.slice(1);
item.droplab_hidden = item['title'].indexOf(valueWithoutPrefix) === -1;
const title = item.title.toLowerCase();
const noTitleMatch = title.indexOf(valueWithoutPrefix) === -1 && title.indexOf(valueWithoutColon) === -1;
item.droplab_hidden = noTitleMatch;
return item;
}
}
...
...
app/assets/javascripts/filtered_search/dropdown_milestone.js.es6
View file @
15454eb5
...
...
@@ -27,9 +27,14 @@
filterMethod(item, query) {
const { value } = gl.FilteredSearchTokenizer.getLastTokenObject(query);
const valueWithoutPrefix = value.slice(1);
const valueWithoutColon = value.slice(1).toLowerCase();
const valueWithoutPrefix = valueWithoutColon.slice(1);
item.droplab_hidden = item['title'].indexOf(valueWithoutPrefix) === -1;
const title = item.title.toLowerCase();
const noTitleMatch = title.indexOf(valueWithoutPrefix) === -1 && title.indexOf(valueWithoutColon) === -1;
item.droplab_hidden = noTitleMatch;
return item;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment