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
end
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
output = content_tag(:span, toggle_text, class: "dropdown-toggle-text #{'is-default' if toggle_text == default_label}")
output << icon('chevron-down')
......
......@@ -115,8 +115,9 @@ module LabelsHelper
end
def labels_filter_path
project = @target_project || @project
if @project
namespace_project_labels_path(@project.namespace, @project, :json)
namespace_project_labels_path(project.namespace, project, :json)
else
dashboard_labels_path(:json)
end
......
......@@ -47,8 +47,9 @@ module MilestonesHelper
end
def milestones_filter_dropdown_path
project = @target_project || @project
if @project
namespace_project_milestones_path(@project.namespace, @project, :json)
namespace_project_milestones_path(project.namespace, project, :json)
else
dashboard_milestones_path(:json)
end
......
......@@ -14,7 +14,7 @@
- if selected.present?
- if selected.respond_to?('any?')
- selected = project.labels.find_by_id(selected) || selected
- selected = project.labels.where(id: selected) || selected
- selected.each do |label|
- id = label.try(:id) || 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