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
9c707348
Commit
9c707348
authored
Jan 20, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue when label or milestone had space
parent
1d5bd227
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
app/assets/javascripts/filtered_search/dropdown_utils.js.es6
app/assets/javascripts/filtered_search/dropdown_utils.js.es6
+13
-4
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js.es6
...s/filtered_search/filtered_search_dropdown_manager.js.es6
+2
-2
spec/features/issues/filtered_search/filter_issues_spec.rb
spec/features/issues/filtered_search/filter_issues_spec.rb
+12
-0
No files found.
app/assets/javascripts/filtered_search/dropdown_utils.js.es6
View file @
9c707348
...
...
@@ -83,14 +83,23 @@
return inputValue;
}
return inputValue.slice(0, right +
selectionStart +
1).trim();
return inputValue.slice(0, right + 1).trim();
}
static getInputSelectionPosition(input) {
const inputValue = input.value;
let inputValue = input.value;
// Replace all spaces inside quote marks with underscores
// This helps with matching the beginning & end of a token:key
inputValue = inputValue.replace(/"(.*?)"/g, str => str.replace(/\s/g, '_') );
const selectionStart = input.selectionStart;
let left = inputValue.slice(0, selectionStart + 1).search(/\S+$/);
const right = inputValue.slice(selectionStart).search(/\s/);
let right = inputValue.slice(selectionStart).search(/\s/);
if (right >= 0) {
right += selectionStart;
}
let left = inputValue.slice(0, right).search(/\S+$/);
if (selectionStart === 0) {
left = 0;
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js.es6
View file @
9c707348
...
...
@@ -74,7 +74,7 @@
right = inputValue.length;
}
input.value = `${inputValue.substr(0, left)}${word}${inputValue.substr(right
+ selectionStart
)}`;
input.value = `${inputValue.substr(0, left)}${word}${inputValue.substr(right)}`;
gl.FilteredSearchDropdownManager.updateInputCaretPosition(selectionStart, input);
}
...
...
@@ -90,7 +90,7 @@
right = inputValue.length;
}
input.setSelectionRange(selectionStart + right, selectionStart
+ right
);
input.setSelectionRange(selectionStart + right, selectionStart);
}
updateCurrentDropdownOffset() {
...
...
spec/features/issues/filtered_search/filter_issues_spec.rb
View file @
9c707348
...
...
@@ -553,6 +553,18 @@ describe 'Filter issues', js: true, feature: true do
expect
(
filtered_search
.
value
).
to
eq
(
"author:@
#{
user
.
username
}
label:~
#{
label
.
name
}
"
)
end
it
'changes label correctly space is in previous label'
do
input_filtered_search
(
"label:~
\"
#{
multiple_words_label
.
title
}
\"
"
,
submit:
false
)
select_search_at_index
(
0
)
page
.
within
'#js-dropdown-label'
do
click_button
label
.
name
end
expect
(
filtered_search
.
value
).
to
eq
(
"label:~
#{
label
.
name
}
"
)
end
end
describe
'filter issues by text'
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