BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
78b9e7c6
Commit
78b9e7c6
authored
Dec 02, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add author dropdown
parent
ce124772
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
4 deletions
+40
-4
dropdown_author.js.es6
...assets/javascripts/filtered_search/dropdown_author.js.es6
+22
-0
filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+9
-4
_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+9
-0
No files found.
app/assets/javascripts/filtered_search/dropdown_author.js.es6
0 → 100644
View file @
78b9e7c6
/* eslint-disable no-param-reassign */
/*= require filtered_search/filtered_search_dropdown */
((global) => {
class DropdownAuthor extends gl.FilteredSearchDropdown {
constructor(dropdown, input) {
super(dropdown, input);
this.listId = 'js-dropdown-author';
}
itemClicked(e) {
console.log('author clicked');
}
renderContent() {
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=');
}
}
global.DropdownAuthor = DropdownAuthor;
})(window.gl || (window.gl = {}));
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
78b9e7c6
...
...
@@ -78,6 +78,7 @@
}
let dropdownHint;
let dropdownAuthor;
let dropdownAssignee;
class FilteredSearchManager {
...
...
@@ -103,10 +104,14 @@
this.dismissCurrentDropdown();
this.currentDropdown = match.key;
if (match.key === 'assignee') {
if (!dropdownAssignee) {
if (match.key === 'author') {
if (!dropdownAuthor) {
dropdownAuthor = new gl.DropdownAuthor(document.querySelector('#js-dropdown-author'), document.querySelector('.filtered-search'));
}
// document.querySelector('.filtered-search').setAttribute('data-dropdown-trigger', '#js-dropdown-assignee');
dropdownAuthor.render();
} else if (match.key === 'assignee') {
if (!dropdownAssignee) {
dropdownAssignee = new gl.DropdownAssignee(document.querySelector('#js-dropdown-assignee'), document.querySelector('.filtered-search'));
}
...
...
@@ -119,7 +124,7 @@
this.currentDropdown = 'hint';
if (!dropdownHint) {
dropdownHint = new gl.DropdownHint(document.querySelector('#js-dropdown-hint'), document.querySelector('.filtered-search'),
'hint'
);
dropdownHint = new gl.DropdownHint(document.querySelector('#js-dropdown-hint'), document.querySelector('.filtered-search'),
this.currentDropdown
);
}
dropdownHint.render();
}
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
78b9e7c6
...
...
@@ -24,6 +24,15 @@
{{hint}}
%span
.js-filter-tag
{{tag}}
#js-dropdown-author
.dropdown-menu
{
'data-dropdown'
=>
true
}
%ul
{
'data-dynamic'
=>
true
}
%li
%button
.btn.btn-link
%img
.avatar.avatar-inline
{
'src'
:
'
{{
avatar_url
}}
', width: '
30
'
}
%strong
{{name}}
%span
{{username}}
#js-dropdown-assignee
.dropdown-menu
{
'data-dropdown'
=>
true
}
%ul
{
'data-dynamic'
=>
true
}
%li
...
...
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