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
Jérome Perrin
gitlab-ce
Commits
f1f3b311
Commit
f1f3b311
authored
May 18, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicated code
parent
a3eabcc2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
18 deletions
+15
-18
app/assets/javascripts/filtered_search/dropdown_hint.js
app/assets/javascripts/filtered_search/dropdown_hint.js
+7
-14
app/assets/javascripts/filtered_search/filtered_search_token_keys.js
...javascripts/filtered_search/filtered_search_token_keys.js
+4
-0
app/views/shared/issuable/_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+4
-4
No files found.
app/assets/javascripts/filtered_search/dropdown_hint.js
View file @
f1f3b311
...
@@ -53,20 +53,13 @@ class DropdownHint extends gl.FilteredSearchDropdown {
...
@@ -53,20 +53,13 @@ class DropdownHint extends gl.FilteredSearchDropdown {
}
}
renderContent
()
{
renderContent
()
{
const
dropdownData
=
[];
const
dropdownData
=
gl
.
FilteredSearchTokenKeys
.
get
()
.
map
(
tokenKey
=>
({
[].
forEach
.
call
(
this
.
input
.
closest
(
'
.filtered-search-box-input-container
'
).
querySelectorAll
(
'
.dropdown-menu
'
),
(
dropdownMenu
)
=>
{
icon
:
`fa-
${
tokenKey
.
icon
}
`
,
const
{
icon
,
hint
,
tag
,
type
}
=
dropdownMenu
.
dataset
;
hint
:
tokenKey
.
key
,
if
(
icon
&&
hint
&&
tag
)
{
tag
:
`<
${
tokenKey
.
symbol
}${
tokenKey
.
key
}
>`
,
dropdownData
.
push
(
type
:
tokenKey
.
type
,
Object
.
assign
({
}));
icon
:
`fa-
${
icon
}
`
,
hint
,
tag
:
`<
${
tag
}
>`
,
},
type
&&
{
type
}),
);
}
});
this
.
droplab
.
changeHookList
(
this
.
hookId
,
this
.
dropdown
,
[
Filter
],
this
.
config
);
this
.
droplab
.
changeHookList
(
this
.
hookId
,
this
.
dropdown
,
[
Filter
],
this
.
config
);
this
.
droplab
.
setData
(
this
.
hookId
,
dropdownData
);
this
.
droplab
.
setData
(
this
.
hookId
,
dropdownData
);
...
...
app/assets/javascripts/filtered_search/filtered_search_token_keys.js
View file @
f1f3b311
...
@@ -3,21 +3,25 @@ const tokenKeys = [{
...
@@ -3,21 +3,25 @@ const tokenKeys = [{
type
:
'
string
'
,
type
:
'
string
'
,
param
:
'
username
'
,
param
:
'
username
'
,
symbol
:
'
@
'
,
symbol
:
'
@
'
,
icon
:
'
pencil
'
,
},
{
},
{
key
:
'
assignee
'
,
key
:
'
assignee
'
,
type
:
'
string
'
,
type
:
'
string
'
,
param
:
'
username
'
,
param
:
'
username
'
,
symbol
:
'
@
'
,
symbol
:
'
@
'
,
icon
:
'
user
'
,
},
{
},
{
key
:
'
milestone
'
,
key
:
'
milestone
'
,
type
:
'
string
'
,
type
:
'
string
'
,
param
:
'
title
'
,
param
:
'
title
'
,
symbol
:
'
%
'
,
symbol
:
'
%
'
,
icon
:
'
clock-o
'
,
},
{
},
{
key
:
'
label
'
,
key
:
'
label
'
,
type
:
'
array
'
,
type
:
'
array
'
,
param
:
'
name[]
'
,
param
:
'
name[]
'
,
symbol
:
'
~
'
,
symbol
:
'
~
'
,
icon
:
'
tag
'
,
}];
}];
const
alternativeTokenKeys
=
[{
const
alternativeTokenKeys
=
[{
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
f1f3b311
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
{{hint}}
{{hint}}
%span
.js-filter-tag.dropdown-light-content
%span
.js-filter-tag.dropdown-light-content
{{tag}}
{{tag}}
#js-dropdown-author
.filtered-search-input-dropdown-menu.dropdown-menu
{
data:
{
icon:
'pencil'
,
hint:
'author'
,
tag:
'@author'
}
}
#js-dropdown-author
.filtered-search-input-dropdown-menu.dropdown-menu
%ul
.filter-dropdown
{
data:
{
dynamic:
true
,
dropdown:
true
}
}
%ul
.filter-dropdown
{
data:
{
dynamic:
true
,
dropdown:
true
}
}
%li
.filter-dropdown-item
%li
.filter-dropdown-item
%button
.btn.btn-link.dropdown-user
%button
.btn.btn-link.dropdown-user
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
{{name}}
{{name}}
%span
.dropdown-light-content
%span
.dropdown-light-content
@{{username}}
@{{username}}
#js-dropdown-assignee
.filtered-search-input-dropdown-menu.dropdown-menu
{
data:
{
icon:
'user'
,
hint:
'assignee'
,
tag:
'@assignee'
}
}
#js-dropdown-assignee
.filtered-search-input-dropdown-menu.dropdown-menu
%ul
{
data:
{
dropdown:
true
}
}
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'none'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'none'
}
}
%button
.btn.btn-link
%button
.btn.btn-link
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
{{name}}
{{name}}
%span
.dropdown-light-content
%span
.dropdown-light-content
@{{username}}
@{{username}}
#js-dropdown-milestone
.filtered-search-input-dropdown-menu.dropdown-menu
{
data:
{
icon:
'clock-o'
,
hint:
'milestone'
,
tag:
'%milestone'
}
}
#js-dropdown-milestone
.filtered-search-input-dropdown-menu.dropdown-menu
%ul
{
data:
{
dropdown:
true
}
}
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'none'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'none'
}
}
%button
.btn.btn-link
%button
.btn.btn-link
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
%li
.filter-dropdown-item
%li
.filter-dropdown-item
%button
.btn.btn-link.js-data-value
%button
.btn.btn-link.js-data-value
{{title}}
{{title}}
#js-dropdown-label
.filtered-search-input-dropdown-menu.dropdown-menu
{
data:
{
icon:
'tag'
,
hint:
'label'
,
tag:
'~label'
,
type:
'array'
}
}
#js-dropdown-label
.filtered-search-input-dropdown-menu.dropdown-menu
%ul
{
data:
{
dropdown:
true
}
}
%ul
{
data:
{
dropdown:
true
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'none'
}
}
%li
.filter-dropdown-item
{
data:
{
value:
'none'
}
}
%button
.btn.btn-link
%button
.btn.btn-link
...
...
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