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
Tatuya Kamada
gitlab-ce
Commits
976893ec
Commit
976893ec
authored
Nov 14, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for labels containing single/double quote
parent
8be49531
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
app/assets/javascripts/filtered_search/filtered_search_tokenizer.es6
...javascripts/filtered_search/filtered_search_tokenizer.es6
+12
-2
spec/features/issues/filter_issues_spec.rb
spec/features/issues/filter_issues_spec.rb
+5
-7
No files found.
app/assets/javascripts/filtered_search/filtered_search_tokenizer.es6
View file @
976893ec
...
...
@@ -62,10 +62,20 @@
const keyMatch = this.validTokenKeys.filter(v => v.key === tokenKey)[0];
const symbolMatch = this.validTokenKeys.filter(v => v.symbol === tokenSymbol)[0];
if (tokenValue.indexOf('"') !== -1) {
const doubleQuoteIndex = tokenValue.indexOf('"');
const singleQuoteIndex = tokenValue.indexOf('\'');
const doubleQuoteExist = doubleQuoteIndex !== -1;
const singleQuoteExist = singleQuoteIndex !== -1;
if ((doubleQuoteExist && !singleQuoteExist) ||
(doubleQuoteExist && singleQuoteExist && doubleQuoteIndex < singleQuoteIndex)) {
// " is found and is in front of ' (if any)
lastQuotation = '"';
incompleteToken = true;
} else if (tokenValue.indexOf('\'') !== -1) {
} else if ((singleQuoteExist && !doubleQuoteExist) ||
(doubleQuoteExist && singleQuoteExist && singleQuoteIndex < doubleQuoteIndex)) {
// ' is found and is in front of " (if any)
lastQuotation = '\'';
incompleteToken = true;
}
...
...
spec/features/issues/filter_issues_spec.rb
View file @
976893ec
...
...
@@ -242,14 +242,12 @@ describe 'Filter issues', feature: true do
end
it
'single quotes containing double quotes'
do
# TODO: Actual bug
double_quotes_label
=
create
(
:label
,
project:
project
,
title:
'won"t fix'
)
double_quotes_label_issue
=
create
(
:issue
,
title:
"Issue with double quotes label"
,
project:
project
)
double_quotes_label_issue
.
labels
<<
double_quotes_label
# double_quotes_label = create(:label, project: project, title: 'won"t fix')
# double_quotes_label_issue = create(:issue, title: "Issue with double quotes label", project: project)
# double_quotes_label_issue.labels << double_quotes_label
# input_filtered_search("label:'#{double_quotes_label.title}'")
# expect_issues_list_count(1)
input_filtered_search
(
"label:~'
#{
double_quotes_label
.
title
}
'"
)
expect_issues_list_count
(
1
)
end
it
'double quotes containing single quotes'
do
...
...
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