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
Léo-Paul Géneau
gitlab-ce
Commits
97d6f5b6
Commit
97d6f5b6
authored
Aug 31, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed escaping issue with labels filter
Closes #15552
parent
4d042afe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
3 deletions
+13
-3
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+1
-1
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+1
-1
app/views/shared/issuable/_label_dropdown.html.haml
app/views/shared/issuable/_label_dropdown.html.haml
+1
-1
spec/features/issues/filter_issues_spec.rb
spec/features/issues/filter_issues_spec.rb
+10
-0
No files found.
app/assets/javascripts/gl_dropdown.js
View file @
97d6f5b6
...
@@ -556,7 +556,7 @@
...
@@ -556,7 +556,7 @@
if
(
isInput
)
{
if
(
isInput
)
{
field
=
$
(
this
.
el
);
field
=
$
(
this
.
el
);
}
else
{
}
else
{
field
=
this
.
dropdown
.
parent
().
find
(
"
input[name='
"
+
fieldName
+
"
'][value='
"
+
value
+
"
']
"
);
field
=
this
.
dropdown
.
parent
().
find
(
"
input[name='
"
+
fieldName
+
"
'][value='
"
+
escape
(
value
)
+
"
']
"
);
}
}
if
(
el
.
hasClass
(
ACTIVE_CLASS
))
{
if
(
el
.
hasClass
(
ACTIVE_CLASS
))
{
el
.
removeClass
(
ACTIVE_CLASS
);
el
.
removeClass
(
ACTIVE_CLASS
);
...
...
app/assets/javascripts/labels_select.js
View file @
97d6f5b6
...
@@ -164,7 +164,7 @@
...
@@ -164,7 +164,7 @@
instance
.
addInput
(
this
.
fieldName
,
label
.
id
);
instance
.
addInput
(
this
.
fieldName
,
label
.
id
);
}
}
}
}
if
(
$form
.
find
(
"
input[type='hidden'][name='
"
+
(
$dropdown
.
data
(
'
fieldName
'
))
+
"
'][value='
"
+
(
this
.
id
(
label
))
+
"
']
"
).
length
)
{
if
(
$form
.
find
(
"
input[type='hidden'][name='
"
+
(
$dropdown
.
data
(
'
fieldName
'
))
+
"
'][value='
"
+
escape
(
this
.
id
(
label
))
+
"
']
"
).
length
)
{
selectedClass
.
push
(
'
is-active
'
);
selectedClass
.
push
(
'
is-active
'
);
}
}
if
(
$dropdown
.
hasClass
(
'
js-multiselect
'
)
&&
removesAll
)
{
if
(
$dropdown
.
hasClass
(
'
js-multiselect
'
)
&&
removesAll
)
{
...
...
app/views/shared/issuable/_label_dropdown.html.haml
View file @
97d6f5b6
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
-
if
params
[
:label_name
].
present?
-
if
params
[
:label_name
].
present?
-
if
params
[
:label_name
].
respond_to?
(
'any?'
)
-
if
params
[
:label_name
].
respond_to?
(
'any?'
)
-
params
[
:label_name
].
each
do
|
label
|
-
params
[
:label_name
].
each
do
|
label
|
=
hidden_field_tag
"label_name[]"
,
label
,
id:
nil
=
hidden_field_tag
"label_name[]"
,
u
(
label
)
,
id:
nil
.dropdown
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
class:
classes
.
join
(
' '
),
type:
"button"
,
data:
dropdown_data
}
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
class:
classes
.
join
(
' '
),
type:
"button"
,
data:
dropdown_data
}
%span
.dropdown-toggle-text
%span
.dropdown-toggle-text
...
...
spec/features/issues/filter_issues_spec.rb
View file @
97d6f5b6
...
@@ -8,6 +8,7 @@ describe 'Filter issues', feature: true do
...
@@ -8,6 +8,7 @@ describe 'Filter issues', feature: true do
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
)
}
let!
(
:issue1
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:issue1
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:wontfix
)
{
create
(
:label
,
project:
project
,
title:
"Won't fix"
)
}
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
...
@@ -107,6 +108,15 @@ describe 'Filter issues', feature: true do
...
@@ -107,6 +108,15 @@ describe 'Filter issues', feature: true do
end
end
expect
(
find
(
'.js-label-select .dropdown-toggle-text'
)).
to
have_content
(
label
.
title
)
expect
(
find
(
'.js-label-select .dropdown-toggle-text'
)).
to
have_content
(
label
.
title
)
end
end
it
'filters by wont fix labels'
do
find
(
'.dropdown-menu-labels a'
,
text:
label
.
title
).
click
page
.
within
'.labels-filter'
do
expect
(
page
).
to
have_content
wontfix
.
title
click_link
wontfix
.
title
end
expect
(
find
(
'.js-label-select .dropdown-toggle-text'
)).
to
have_content
(
wontfix
.
title
)
end
end
end
describe
'Filter issues for assignee and label from issues#index'
do
describe
'Filter issues for assignee and label from issues#index'
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