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
4923a0ab
Commit
4923a0ab
authored
Mar 08, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix filtered search visual token editing dropdown
parent
56b755ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
app/assets/javascripts/filtered_search/filtered_search_manager.js
...ts/javascripts/filtered_search/filtered_search_manager.js
+5
-3
spec/features/issues/filtered_search/visual_tokens_spec.rb
spec/features/issues/filtered_search/visual_tokens_spec.rb
+16
-0
No files found.
app/assets/javascripts/filtered_search/filtered_search_manager.js
View file @
4923a0ab
...
...
@@ -39,6 +39,7 @@
this
.
checkForBackspaceWrapper
=
this
.
checkForBackspace
.
bind
(
this
);
this
.
removeSelectedTokenWrapper
=
this
.
removeSelectedToken
.
bind
(
this
);
this
.
unselectEditTokensWrapper
=
this
.
unselectEditTokens
.
bind
(
this
);
this
.
editTokenWrapper
=
this
.
editToken
.
bind
(
this
);
this
.
tokenChange
=
this
.
tokenChange
.
bind
(
this
);
this
.
filteredSearchInput
.
form
.
addEventListener
(
'
submit
'
,
this
.
handleFormSubmit
);
...
...
@@ -51,7 +52,7 @@
this
.
filteredSearchInput
.
addEventListener
(
'
click
'
,
this
.
tokenChange
);
this
.
filteredSearchInput
.
addEventListener
(
'
keyup
'
,
this
.
tokenChange
);
this
.
tokensContainer
.
addEventListener
(
'
click
'
,
FilteredSearchManager
.
selectToken
);
this
.
tokensContainer
.
addEventListener
(
'
dblclick
'
,
FilteredSearchManager
.
editToken
);
this
.
tokensContainer
.
addEventListener
(
'
dblclick
'
,
this
.
editTokenWrapper
);
this
.
clearSearchButton
.
addEventListener
(
'
click
'
,
this
.
clearSearchWrapper
);
document
.
addEventListener
(
'
click
'
,
gl
.
FilteredSearchVisualTokens
.
unselectTokens
);
document
.
addEventListener
(
'
click
'
,
this
.
unselectEditTokensWrapper
);
...
...
@@ -69,7 +70,7 @@
this
.
filteredSearchInput
.
removeEventListener
(
'
click
'
,
this
.
tokenChange
);
this
.
filteredSearchInput
.
removeEventListener
(
'
keyup
'
,
this
.
tokenChange
);
this
.
tokensContainer
.
removeEventListener
(
'
click
'
,
FilteredSearchManager
.
selectToken
);
this
.
tokensContainer
.
removeEventListener
(
'
dblclick
'
,
FilteredSearchManager
.
editToken
);
this
.
tokensContainer
.
removeEventListener
(
'
dblclick
'
,
this
.
editTokenWrapper
);
this
.
clearSearchButton
.
removeEventListener
(
'
click
'
,
this
.
clearSearchWrapper
);
document
.
removeEventListener
(
'
click
'
,
gl
.
FilteredSearchVisualTokens
.
unselectTokens
);
document
.
removeEventListener
(
'
click
'
,
this
.
unselectEditTokensWrapper
);
...
...
@@ -138,11 +139,12 @@
}
}
static
editToken
(
e
)
{
editToken
(
e
)
{
const
token
=
e
.
target
.
closest
(
'
.js-visual-token
'
);
if
(
token
)
{
gl
.
FilteredSearchVisualTokens
.
editToken
(
token
);
this
.
tokenChange
();
}
}
...
...
spec/features/issues/filtered_search/visual_tokens_spec.rb
View file @
4923a0ab
...
...
@@ -226,6 +226,22 @@ describe 'Visual tokens', js: true, feature: true do
end
end
describe
'editing multiple tokens'
do
before
do
input_filtered_search
(
'author:@root assignee:none'
,
submit:
false
)
first
(
'.tokens-container .filtered-search-token'
).
double_click
end
it
'opens author dropdown'
do
expect
(
page
).
to
have_css
(
'#js-dropdown-author'
,
visible:
true
)
end
it
'opens assignee dropdown'
do
find
(
'.tokens-container .filtered-search-token'
,
text:
'Assignee'
).
double_click
expect
(
page
).
to
have_css
(
'#js-dropdown-assignee'
,
visible:
true
)
end
end
describe
'add new token after editing existing token'
do
before
do
input_filtered_search
(
'author:@root assignee:none'
,
submit:
false
)
...
...
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