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
Jérome Perrin
gitlab-ce
Commits
45bfff3d
Commit
45bfff3d
authored
Oct 14, 2016
by
Airat Shigapov
Committed by
Robert Speicher
Oct 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Escape quotes in gl_dropdown values to prevent exceptions
parent
4482d199
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
0 deletions
+36
-0
CHANGELOG.md
CHANGELOG.md
+1
-0
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+2
-0
spec/features/issues/filter_by_milestone_spec.rb
spec/features/issues/filter_by_milestone_spec.rb
+16
-0
spec/features/merge_requests/filter_by_milestone_spec.rb
spec/features/merge_requests/filter_by_milestone_spec.rb
+17
-0
No files found.
CHANGELOG.md
View file @
45bfff3d
...
...
@@ -10,6 +10,7 @@ Please view this file on the master branch, on stable branches it's out of date.
-
Add hover to trash icon in notes !7008 (blackst0ne)
-
Escape ref and path for relative links !6050 (winniehell)
-
Fixed link typo on /help/ui to Alerts section. !6915 (Sam Rose)
-
Fix filtering of milestones with quotes in title (airatshigapov)
-
Simpler arguments passed to named_route on toggle_award_url helper method
-
Fix: Backup restore doesn't clear cache
-
API: Fix project deploy keys 400 and 500 errors when adding an existing key. !6784 (Joshua Welsh)
...
...
app/assets/javascripts/gl_dropdown.js
View file @
45bfff3d
...
...
@@ -549,6 +549,8 @@
value
=
this
.
options
.
id
?
this
.
options
.
id
(
data
)
:
data
.
id
;
fieldName
=
this
.
options
.
fieldName
;
if
(
value
)
{
value
=
value
.
toString
().
replace
(
/'/g
,
'
\\\'
'
)
};
field
=
this
.
dropdown
.
parent
().
find
(
"
input[name='
"
+
fieldName
+
"
'][value='
"
+
value
+
"
']
"
);
if
(
field
.
length
)
{
selected
=
true
;
...
...
spec/features/issues/filter_by_milestone_spec.rb
View file @
45bfff3d
...
...
@@ -58,6 +58,22 @@ feature 'Issue filtering by Milestone', feature: true do
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
end
context
'when milestone has single quotes in title'
do
background
do
milestone
.
update
(
name:
"rock 'n' roll"
)
end
scenario
'filters by a specific Milestone'
,
js:
true
do
create
(
:issue
,
project:
project
,
milestone:
milestone
)
create
(
:issue
,
project:
project
)
visit_issues
(
project
)
filter_by_milestone
(
milestone
.
title
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
end
end
def
visit_issues
(
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
...
...
spec/features/merge_requests/filter_by_milestone_spec.rb
View file @
45bfff3d
...
...
@@ -67,6 +67,23 @@ feature 'Merge Request filtering by Milestone', feature: true do
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
1
)
end
context
'when milestone has single quotes in title'
do
background
do
milestone
.
update
(
name:
"rock 'n' roll"
)
end
scenario
'filters by a specific Milestone'
,
js:
true
do
create
(
:merge_request
,
:with_diffs
,
source_project:
project
,
milestone:
milestone
)
create
(
:merge_request
,
:simple
,
source_project:
project
)
visit_merge_requests
(
project
)
filter_by_milestone
(
milestone
.
title
)
expect
(
page
).
to
have_issuable_counts
(
open:
1
,
closed:
0
,
all:
1
)
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
1
)
end
end
def
visit_merge_requests
(
project
)
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
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