Commit 9a1feb65 authored by Phil Hughes's avatar Phil Hughes

Fixed labels & milestones loading the wrong path

parent 3582861c
...@@ -40,7 +40,11 @@ module DropdownsHelper ...@@ -40,7 +40,11 @@ module DropdownsHelper
end end
def dropdown_toggle(toggle_text, data_attr, options = {}) def dropdown_toggle(toggle_text, data_attr, options = {})
default_label = options[:data][:default_label] default_label = if options[:data]
options[:data][:default_label]
else
''
end
content_tag(:button, class: "dropdown-menu-toggle #{options[:toggle_class] if options.has_key?(:toggle_class)}", id: (options[:id] if options.has_key?(:id)), type: "button", data: data_attr) do content_tag(:button, class: "dropdown-menu-toggle #{options[:toggle_class] if options.has_key?(:toggle_class)}", id: (options[:id] if options.has_key?(:id)), type: "button", data: data_attr) do
output = content_tag(:span, toggle_text, class: "dropdown-toggle-text #{'is-default' if toggle_text == default_label}") output = content_tag(:span, toggle_text, class: "dropdown-toggle-text #{'is-default' if toggle_text == default_label}")
output << icon('chevron-down') output << icon('chevron-down')
......
...@@ -115,8 +115,9 @@ module LabelsHelper ...@@ -115,8 +115,9 @@ module LabelsHelper
end end
def labels_filter_path def labels_filter_path
project = @target_project || @project
if @project if @project
namespace_project_labels_path(@project.namespace, @project, :json) namespace_project_labels_path(project.namespace, project, :json)
else else
dashboard_labels_path(:json) dashboard_labels_path(:json)
end end
......
...@@ -47,8 +47,9 @@ module MilestonesHelper ...@@ -47,8 +47,9 @@ module MilestonesHelper
end end
def milestones_filter_dropdown_path def milestones_filter_dropdown_path
project = @target_project || @project
if @project if @project
namespace_project_milestones_path(@project.namespace, @project, :json) namespace_project_milestones_path(project.namespace, project, :json)
else else
dashboard_milestones_path(:json) dashboard_milestones_path(:json)
end end
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
- if selected.present? - if selected.present?
- if selected.respond_to?('any?') - if selected.respond_to?('any?')
- selected = project.labels.find_by_id(selected) || selected - selected = project.labels.where(id: selected) || selected
- selected.each do |label| - selected.each do |label|
- id = label.try(:id) || label - id = label.try(:id) || label
- title = label.try(:title) || label - title = label.try(:title) || label
......
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