Commit 439a7280 authored by Phil Hughes's avatar Phil Hughes

Any label & no label out weigh other labels - these two will clear previously selected labels

Fixed issue with no label not working correctly
parent 75626d5f
...@@ -389,13 +389,13 @@ class GitLabDropdown ...@@ -389,13 +389,13 @@ class GitLabDropdown
else else
selectedObject selectedObject
else else
if !value? if not @options.multiSelect or el.hasClass('dropdown-clear-active')
field.remove()
if not @options.multiSelect
@dropdown.find(".#{ACTIVE_CLASS}").removeClass ACTIVE_CLASS @dropdown.find(".#{ACTIVE_CLASS}").removeClass ACTIVE_CLASS
@dropdown.parent().find("input[name='#{fieldName}']").remove() @dropdown.parent().find("input[name='#{fieldName}']").remove()
if !value?
field.remove()
# Toggle active class for the tick mark # Toggle active class for the tick mark
el.addClass ACTIVE_CLASS el.addClass ACTIVE_CLASS
......
...@@ -201,16 +201,21 @@ class @LabelsSelect ...@@ -201,16 +201,21 @@ class @LabelsSelect
callback data callback data
renderRow: (label) -> renderRow: (label) ->
selectedClass = '' removesAll = label.id is 0 or label.id is undefined
selectedClass = []
if $form.find("input[type='hidden']\ if $form.find("input[type='hidden']\
[name='#{$dropdown.data('fieldName')}']\ [name='#{$dropdown.data('fieldName')}']\
[value='#{this.id(label)}']").length [value='#{this.id(label)}']").length
selectedClass = 'is-active' selectedClass.push 'is-active'
if $dropdown.hasClass('js-multiselect') and removesAll
selectedClass.push 'dropdown-clear-active'
color = if label.color? then "<span class='dropdown-label-box' style='background-color: #{label.color}'></span>" else "" color = if label.color? then "<span class='dropdown-label-box' style='background-color: #{label.color}'></span>" else ""
"<li> "<li>
<a href='#' class='#{selectedClass}'> <a href='#' class='#{selectedClass.join(' ')}'>
#{color} #{color}
#{label.title} #{label.title}
</a> </a>
...@@ -237,9 +242,7 @@ class @LabelsSelect ...@@ -237,9 +242,7 @@ class @LabelsSelect
defaultLabel defaultLabel
fieldName: $dropdown.data('field-name') fieldName: $dropdown.data('field-name')
id: (label) -> id: (label) ->
if label.isAny? if $dropdown.hasClass("js-filter-submit") and not label.isAny?
''
else if $dropdown.hasClass "js-filter-submit"
label.title label.title
else else
label.id label.id
......
...@@ -117,7 +117,7 @@ class IssuableFinder ...@@ -117,7 +117,7 @@ class IssuableFinder
end end
def filter_by_no_label? def filter_by_no_label?
labels? && params[:label_name] == Label::None.title labels? && params[:label_name].include?(Label::None.title)
end end
def labels def labels
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment