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
21a638e8
Commit
21a638e8
authored
Mar 20, 2020
by
Rajat Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix filtered search tokenization
parent
062dcdf9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
app/assets/javascripts/filtered_search/dropdown_operator.js
app/assets/javascripts/filtered_search/dropdown_operator.js
+3
-3
changelogs/unreleased/filtered-search-bug.yml
changelogs/unreleased/filtered-search-bug.yml
+5
-0
spec/features/issues/filtered_search/visual_tokens_spec.rb
spec/features/issues/filtered_search/visual_tokens_spec.rb
+13
-0
No files found.
app/assets/javascripts/filtered_search/dropdown_operator.js
View file @
21a638e8
...
...
@@ -24,10 +24,12 @@ export default class DropdownOperator extends FilteredSearchDropdown {
if
(
selected
.
tagName
===
'
LI
'
)
{
if
(
selected
.
hasAttribute
(
'
data-value
'
))
{
const
name
=
FilteredSearchVisualTokens
.
getLastTokenPartial
();
const
operator
=
selected
.
dataset
.
value
;
FilteredSearchVisualTokens
.
removeLastTokenPartial
();
FilteredSearchDropdownManager
.
addWordToInput
({
tokenName
:
this
.
filter
,
tokenName
:
name
,
tokenOperator
:
operator
,
clicked
:
false
,
});
...
...
@@ -38,8 +40,6 @@ export default class DropdownOperator extends FilteredSearchDropdown {
}
renderContent
(
forceShowList
=
false
)
{
this
.
filter
=
FilteredSearchVisualTokens
.
getLastTokenPartial
();
const
dropdownData
=
[
{
tag
:
'
equal
'
,
...
...
changelogs/unreleased/filtered-search-bug.yml
0 → 100644
View file @
21a638e8
---
title
:
Fix filtered search tokenization
merge_request
:
27648
author
:
type
:
fixed
spec/features/issues/filtered_search/visual_tokens_spec.rb
View file @
21a638e8
...
...
@@ -162,4 +162,17 @@ describe 'Visual tokens', :js do
])
end
end
it
'does retain hint token when mix of typing and clicks are performed'
do
input_filtered_search
(
'label:'
,
extra_space:
false
,
submit:
false
)
expect
(
page
).
to
have_css
(
'#js-dropdown-operator'
,
visible:
true
)
find
(
'#js-dropdown-operator li[data-value="="]'
).
click
token
=
page
.
all
(
'.tokens-container .js-visual-token'
)[
0
]
expect
(
token
.
find
(
'.name'
).
text
).
to
eq
(
'Label'
)
expect
(
token
.
find
(
'.operator'
).
text
).
to
eq
(
'='
)
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