BigW Consortium Gitlab

Commit 639a0b19 by Phil Hughes

Fixed milestone dropdown label not persisting

parent c4847664
......@@ -55,10 +55,14 @@ module MilestonesHelper
end
end
def milestone_dropdown_selected_text
def milestone_dropdown_selected_text(selected)
project = @target_project || @project || @projects
Milestone.of_projects(project).where(title: params[:milestone_title]).first().try(:name)
if selected.is_a? Integer
Milestone.of_projects(project).where(id: selected).first.try(:title)
else
Milestone.of_projects(project).where(title: selected).first.try(:title)
end
end
def milestone_remaining_days(milestone)
......
- project = @target_project || @project || @projects
- extra_class = extra_class || ''
- selected_text = milestone_dropdown_selected_text
- selected_text = milestone_dropdown_selected_text(selected)
- if selected.present?
= hidden_field_tag(name, selected)
= dropdown_tag(milestone_dropdown_label(selected_text), options: { title: "Filter by milestone", toggle_class: "js-milestone-select js-filter-submit #{extra_class}", filter: true, dropdown_class: "dropdown-menu-selectable",
......
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