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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d301791c
Commit
d301791c
authored
Jun 09, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests
parent
e796555b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
app/helpers/dropdowns_helper.rb
app/helpers/dropdowns_helper.rb
+2
-2
app/views/shared/issuable/_label_page_default.html.haml
app/views/shared/issuable/_label_page_default.html.haml
+1
-1
spec/features/issues/filter_by_labels_spec.rb
spec/features/issues/filter_by_labels_spec.rb
+15
-0
No files found.
app/helpers/dropdowns_helper.rb
View file @
d301791c
...
@@ -67,9 +67,9 @@ module DropdownsHelper
...
@@ -67,9 +67,9 @@ module DropdownsHelper
end
end
end
end
def
dropdown_filter
(
placeholder
)
def
dropdown_filter
(
placeholder
,
search_id:
nil
)
content_tag
:div
,
class:
"dropdown-input"
do
content_tag
:div
,
class:
"dropdown-input"
do
filter_output
=
search_field_tag
nil
,
nil
,
class:
"dropdown-input-field"
,
placeholder:
placeholder
filter_output
=
search_field_tag
search_id
,
nil
,
class:
"dropdown-input-field"
,
placeholder:
placeholder
filter_output
<<
icon
(
'search'
,
class:
"dropdown-input-search"
)
filter_output
<<
icon
(
'search'
,
class:
"dropdown-input-search"
)
filter_output
<<
icon
(
'times'
,
class:
"dropdown-input-clear js-dropdown-input-clear"
,
role:
"button"
)
filter_output
<<
icon
(
'times'
,
class:
"dropdown-input-clear js-dropdown-input-clear"
,
role:
"button"
)
...
...
app/views/shared/issuable/_label_page_default.html.haml
View file @
d301791c
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
-
filter_placeholder
=
local_assigns
.
fetch
(
:filter_placeholder
,
'Search labels'
)
-
filter_placeholder
=
local_assigns
.
fetch
(
:filter_placeholder
,
'Search labels'
)
.dropdown-page-one
.dropdown-page-one
=
dropdown_title
(
title
)
=
dropdown_title
(
title
)
=
dropdown_filter
(
filter_placeholder
)
=
dropdown_filter
(
filter_placeholder
,
search_id:
"label-name"
)
=
dropdown_content
=
dropdown_content
-
if
@project
&&
show_footer
-
if
@project
&&
show_footer
=
dropdown_footer
do
=
dropdown_footer
do
...
...
spec/features/issues/filter_by_labels_spec.rb
View file @
d301791c
...
@@ -199,4 +199,19 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -199,4 +199,19 @@ feature 'Issue filtering by Labels', feature: true do
end
end
end
end
end
end
context
'dropdown filtering'
,
js:
true
do
it
'should filter by label name'
do
page
.
within
'.labels-filter'
do
click_button
'Label'
wait_for_ajax
fill_in
'label-name'
,
with:
'bug'
page
.
within
'.dropdown-content'
do
expect
(
page
).
not_to
have_content
'enhancement'
expect
(
page
).
to
have_content
'bug'
end
end
end
end
end
end
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