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
Tatuya Kamada
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
4 deletions
+40
-4
app/assets/javascripts/filtered_search/dropdown_author.js.es6
...assets/javascripts/filtered_search/dropdown_author.js.es6
+22
-0
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+9
-4
app/views/shared/issuable/_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 @@
...
@@ -78,6 +78,7 @@
}
}
let dropdownHint;
let dropdownHint;
let dropdownAuthor;
let dropdownAssignee;
let dropdownAssignee;
class FilteredSearchManager {
class FilteredSearchManager {
...
@@ -103,10 +104,14 @@
...
@@ -103,10 +104,14 @@
this.dismissCurrentDropdown();
this.dismissCurrentDropdown();
this.currentDropdown = match.key;
this.currentDropdown = match.key;
if (match.key === 'assignee') {
if (match.key === 'author') {
if (!dropdownAssignee) {
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'));
dropdownAssignee = new gl.DropdownAssignee(document.querySelector('#js-dropdown-assignee'), document.querySelector('.filtered-search'));
}
}
...
@@ -119,7 +124,7 @@
...
@@ -119,7 +124,7 @@
this.currentDropdown = 'hint';
this.currentDropdown = 'hint';
if (!dropdownHint) {
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();
dropdownHint.render();
}
}
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
78b9e7c6
...
@@ -24,6 +24,15 @@
...
@@ -24,6 +24,15 @@
{{hint}}
{{hint}}
%span
.js-filter-tag
%span
.js-filter-tag
{{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
}
#js-dropdown-assignee
.dropdown-menu
{
'data-dropdown'
=>
true
}
%ul
{
'data-dynamic'
=>
true
}
%ul
{
'data-dynamic'
=>
true
}
%li
%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