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
d3ff691d
Commit
d3ff691d
authored
Jun 02, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue with dropdown toggle not updating
Added tests
parent
f4eb5572
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
2 deletions
+32
-2
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+6
-2
app/assets/javascripts/issuable.js.coffee
app/assets/javascripts/issuable.js.coffee
+1
-0
spec/features/issues/filter_by_labels_spec.rb
spec/features/issues/filter_by_labels_spec.rb
+25
-0
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
d3ff691d
...
@@ -211,6 +211,7 @@ class GitLabDropdown
...
@@ -211,6 +211,7 @@ class GitLabDropdown
@
dropdown
.
on
"shown.bs.dropdown"
,
@
opened
@
dropdown
.
on
"shown.bs.dropdown"
,
@
opened
@
dropdown
.
on
"hidden.bs.dropdown"
,
@
hidden
@
dropdown
.
on
"hidden.bs.dropdown"
,
@
hidden
$
(
@
el
).
on
"update.label"
,
@
updateLabel
@
dropdown
.
on
"click"
,
".dropdown-menu, .dropdown-menu-close"
,
@
shouldPropagate
@
dropdown
.
on
"click"
,
".dropdown-menu, .dropdown-menu-close"
,
@
shouldPropagate
@
dropdown
.
on
'keyup'
,
(
e
)
=>
@
dropdown
.
on
'keyup'
,
(
e
)
=>
if
e
.
which
is
27
# Escape key
if
e
.
which
is
27
# Escape key
...
@@ -453,7 +454,7 @@ class GitLabDropdown
...
@@ -453,7 +454,7 @@ class GitLabDropdown
# Toggle the dropdown label
# Toggle the dropdown label
if
@
options
.
toggleLabel
if
@
options
.
toggleLabel
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggleLabel
@
updateLabel
()
else
else
selectedObject
selectedObject
else
if
el
.
hasClass
(
INDETERMINATE_CLASS
)
else
if
el
.
hasClass
(
INDETERMINATE_CLASS
)
...
@@ -480,7 +481,7 @@ class GitLabDropdown
...
@@ -480,7 +481,7 @@ class GitLabDropdown
# Toggle the dropdown label
# Toggle the dropdown label
if
@
options
.
toggleLabel
if
@
options
.
toggleLabel
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggl
eLabel
(
selectedObject
,
el
)
@
updat
eLabel
(
selectedObject
,
el
)
if
value
?
if
value
?
if
!
field
.
length
and
fieldName
if
!
field
.
length
and
fieldName
@
addInput
(
fieldName
,
value
)
@
addInput
(
fieldName
,
value
)
...
@@ -579,6 +580,9 @@ class GitLabDropdown
...
@@ -579,6 +580,9 @@ class GitLabDropdown
# Scroll the dropdown content up
# Scroll the dropdown content up
$dropdownContent
.
scrollTop
(
listItemTop
-
dropdownContentTop
)
$dropdownContent
.
scrollTop
(
listItemTop
-
dropdownContentTop
)
updateLabel
:
(
selected
=
null
,
el
=
null
)
=>
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggleLabel
(
selected
,
el
)
$
.
fn
.
glDropdown
=
(
opts
)
->
$
.
fn
.
glDropdown
=
(
opts
)
->
return
@
.
each
->
return
@
.
each
->
if
(
!
$
.
data
@
,
'glDropdown'
)
if
(
!
$
.
data
@
,
'glDropdown'
)
...
...
app/assets/javascripts/issuable.js.coffee
View file @
d3ff691d
...
@@ -54,6 +54,7 @@ issuable_created = false
...
@@ -54,6 +54,7 @@ issuable_created = false
# Submit the form to get new data
# Submit the form to get new data
Issuable
.
filterResults
$
(
'.filter-form'
)
Issuable
.
filterResults
$
(
'.filter-form'
)
$
(
'.js-label-select'
).
trigger
(
'update.label'
)
toggleLabelFilters
:
->
toggleLabelFilters
:
->
$filteredLabels
=
$
(
'.filtered-labels'
)
$filteredLabels
=
$
(
'.filtered-labels'
)
...
...
spec/features/issues/filter_by_labels_spec.rb
View file @
d3ff691d
...
@@ -174,4 +174,29 @@ feature 'Issue filtering by Labels', feature: true do
...
@@ -174,4 +174,29 @@ feature 'Issue filtering by Labels', feature: true do
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"feature"
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"feature"
end
end
end
end
context
'remove filtered labels'
,
js:
true
do
before
do
page
.
within
'.labels-filter'
do
click_button
'Label'
click_link
'bug'
find
(
'.dropdown-menu-close'
).
click
end
page
.
within
'.filtered-labels'
do
expect
(
page
).
to
have_content
'bug'
end
end
it
'should allow user to remove filtered labels'
do
page
.
within
'.filtered-labels'
do
first
(
'.js-label-filter-remove'
).
click
expect
(
page
).
not_to
have_content
'bug'
end
page
.
within
'.labels-filter'
do
expect
(
page
).
not_to
have_content
'bug'
end
end
end
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