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
Léo-Paul Géneau
gitlab-ce
Commits
f01ce091
Commit
f01ce091
authored
Mar 20, 2017
by
Clement Ho
Committed by
Alfredo Sumaran
Mar 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset filters after click
parent
87b9cee3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
app/assets/javascripts/filtered_search/filtered_search_dropdown.js
...s/javascripts/filtered_search/filtered_search_dropdown.js
+2
-1
spec/features/merge_requests/reset_filters_spec.rb
spec/features/merge_requests/reset_filters_spec.rb
+20
-0
No files found.
app/assets/javascripts/filtered_search/filtered_search_dropdown.js
View file @
f01ce091
...
...
@@ -38,6 +38,7 @@
gl
.
FilteredSearchDropdownManager
.
addWordToInput
(
this
.
filter
,
value
,
true
);
}
this
.
resetFilters
();
this
.
dismissDropdown
();
this
.
dispatchInputEvent
();
}
...
...
@@ -107,7 +108,7 @@
const
hook
=
this
.
getCurrentHook
();
if
(
hook
)
{
const
data
=
hook
.
list
.
data
;
const
data
=
hook
.
list
.
data
||
[]
;
const
results
=
data
.
map
((
o
)
=>
{
const
updated
=
o
;
updated
.
droplab_hidden
=
false
;
...
...
spec/features/merge_requests/reset_filters_spec.rb
View file @
f01ce091
...
...
@@ -49,6 +49,26 @@ feature 'Merge requests filter clear button', feature: true, js: true do
end
end
context
'when multiple label filters have been applied'
do
let!
(
:label
)
{
create
(
:label
,
project:
project
,
name:
'Frontend'
)
}
let
(
:filter_dropdown
)
{
find
(
"#js-dropdown-label .filter-dropdown"
)
}
before
do
visit_merge_requests
(
project
)
init_label_search
end
it
'filters bug label'
do
filtered_search
.
set
(
'~bug'
)
filter_dropdown
.
find
(
'.filter-dropdown-item'
,
text:
bug
.
title
).
click
init_label_search
expect
(
filter_dropdown
.
find
(
'.filter-dropdown-item'
,
text:
bug
.
title
)).
to
be_visible
expect
(
filter_dropdown
.
find
(
'.filter-dropdown-item'
,
text:
label
.
title
)).
to
be_visible
end
end
context
'when a text search has been conducted'
do
it
'resets the text search filter'
do
visit_merge_requests
(
project
,
search:
'Bug'
)
...
...
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