Commit 0a81c000 authored by Phil Hughes's avatar Phil Hughes

Fixed 'no label' being in dropdown toggle label

parent 70d5493e
......@@ -212,7 +212,7 @@ class @LabelsSelect
$a = $('<a href="#">')
selectedClass = []
removesAll = label.id is 0 or not label.id?
removesAll = label.id <= 0 or not label.id?
if $dropdown.hasClass('js-filter-bulk-update')
indeterminate = instance.indeterminateIds
......@@ -281,7 +281,7 @@ class @LabelsSelect
selectedIds = $("input[name='#{fieldName}']").map(-> @value).get()
selected = _.filter glDropdown.fullData, (label) ->
selectedIds.indexOf("#{label[propertyName]}") >= 0 if label[propertyName]?
selectedIds.indexOf("#{label[propertyName]}") >= 0 if label[propertyName]? and label.id > 0
if selected.length is 1
selected[0].title
......@@ -292,11 +292,9 @@ class @LabelsSelect
defaultLabel: defaultLabel
fieldName: fieldName
id: (label) ->
return if label.id <= 0
if $dropdown.hasClass('js-issuable-form-dropdown')
if label.id is 0
return
else
return label.id
return label.id
if $dropdown.hasClass("js-filter-submit") and not label.isAny?
label.title
......
......@@ -7,7 +7,7 @@
- classes = local_assigns.fetch(:classes, [])
- selected = local_assigns.fetch(:selected, nil)
- selected_toggle = local_assigns.fetch(:selected_toggle, nil)
- dropdown_data = {toggle: 'dropdown', field_name: "label_name[]", show_no: "true", show_any: "true", selected: selected, project_id: project.try(:id), labels: labels_filter_path, default_label: "Label"}
- dropdown_data = {toggle: 'dropdown', field_name: "label_name[]", show_no: "true", show_any: "true", selected: selected, project_id: project.try(:id), labels: labels_filter_path, default_label: "Labels"}
- dropdown_data.merge!(data_options)
- classes << 'js-extra-options' if extra_options
- classes << 'js-filter-submit' if filter_submit
......
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