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
a510791b
Commit
a510791b
authored
Dec 02, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add label and milestone dropdowns
parent
78b9e7c6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
0 deletions
+69
-0
app/assets/javascripts/filtered_search/dropdown_label.js.es6
app/assets/javascripts/filtered_search/dropdown_label.js.es6
+22
-0
app/assets/javascripts/filtered_search/dropdown_milestone.js.es6
...ets/javascripts/filtered_search/dropdown_milestone.js.es6
+22
-0
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+14
-0
app/views/shared/issuable/_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+11
-0
No files found.
app/assets/javascripts/filtered_search/dropdown_label.js.es6
0 → 100644
View file @
a510791b
/* eslint-disable no-param-reassign */
/*= require filtered_search/filtered_search_dropdown */
((global) => {
class DropdownLabel extends gl.FilteredSearchDropdown {
constructor(dropdown, input) {
super(dropdown, input);
this.listId = 'js-dropdown-label';
}
itemClicked(e) {
console.log('label clicked');
}
renderContent() {
super.renderContent();
droplab.setData(this.hookId, 'labels.json');
}
}
global.DropdownLabel = DropdownLabel;
})(window.gl || (window.gl = {}));
app/assets/javascripts/filtered_search/dropdown_milestone.js.es6
0 → 100644
View file @
a510791b
/* eslint-disable no-param-reassign */
/*= require filtered_search/filtered_search_dropdown */
((global) => {
class DropdownMilestone extends gl.FilteredSearchDropdown {
constructor(dropdown, input) {
super(dropdown, input);
this.listId = 'js-dropdown-milestone';
}
itemClicked(e) {
console.log('milestone clicked');
}
renderContent() {
super.renderContent();
droplab.setData(this.hookId, 'milestones.json');
}
}
global.DropdownMilestone = DropdownMilestone;
})(window.gl || (window.gl = {}));
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
a510791b
...
@@ -80,6 +80,8 @@
...
@@ -80,6 +80,8 @@
let dropdownHint;
let dropdownHint;
let dropdownAuthor;
let dropdownAuthor;
let dropdownAssignee;
let dropdownAssignee;
let dropdownMilestone;
let dropdownLabel;
class FilteredSearchManager {
class FilteredSearchManager {
constructor() {
constructor() {
...
@@ -116,6 +118,18 @@
...
@@ -116,6 +118,18 @@
}
}
dropdownAssignee.render();
dropdownAssignee.render();
} else if (match.key === 'milestone') {
if (!dropdownMilestone) {
dropdownMilestone = new gl.DropdownMilestone(document.querySelector('#js-dropdown-milestone'), document.querySelector('.filtered-search'));
}
dropdownMilestone.render();
} else if (match.key === 'label') {
if (!dropdownLabel) {
dropdownLabel = new gl.DropdownLabel(document.querySelector('#js-dropdown-label'), document.querySelector('.filtered-search'));
}
dropdownLabel.render();
}
}
} else if (!match && this.currentDropdown !== 'hint') {
} else if (!match && this.currentDropdown !== 'hint') {
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
a510791b
...
@@ -42,6 +42,17 @@
...
@@ -42,6 +42,17 @@
{{name}}
{{name}}
%span
%span
{{username}}
{{username}}
#js-dropdown-milestone
.dropdown-menu
{
'data-dropdown'
=>
true
}
%ul
{
'data-dynamic'
=>
true
}
%li
%button
.btn.btn-link
{{title}}
#js-dropdown-label
.dropdown-menu
{
'data-dropdown'
=>
true
}
%ul
{
'data-dynamic'
=>
true
}
%li
%button
.btn.btn-link
%span
.dropdown-label-box
{
'style'
:
'
background:
{{
color
}}
'
}
{{title}}
.pull-right
.pull-right
-
if
boards_page
-
if
boards_page
#js-boards-seach
.issue-boards-search
#js-boards-seach
.issue-boards-search
...
...
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