Commit a6d7c695 authored by Phil Hughes's avatar Phil Hughes

Updated to only include upcoming on filters

Fixes tests
parent c9dea776
...@@ -11,6 +11,7 @@ class @MilestoneSelect ...@@ -11,6 +11,7 @@ class @MilestoneSelect
selectedMilestone = $dropdown.data('selected') selectedMilestone = $dropdown.data('selected')
showNo = $dropdown.data('show-no') showNo = $dropdown.data('show-no')
showAny = $dropdown.data('show-any') showAny = $dropdown.data('show-any')
showUpcoming = $dropdown.data('show-upcoming')
useId = $dropdown.data('use-id') useId = $dropdown.data('use-id')
defaultLabel = $dropdown.data('default-label') defaultLabel = $dropdown.data('default-label')
issuableId = $dropdown.data('issuable-id') issuableId = $dropdown.data('issuable-id')
...@@ -34,7 +35,6 @@ class @MilestoneSelect ...@@ -34,7 +35,6 @@ class @MilestoneSelect
id: '0' id: '0'
title: 'No Milestone' title: 'No Milestone'
}, { }, {
upcoming: true
id: '#upcoming' id: '#upcoming'
title: 'Upcoming' title: 'Upcoming'
}] }]
...@@ -44,6 +44,7 @@ class @MilestoneSelect ...@@ -44,6 +44,7 @@ class @MilestoneSelect
$.ajax( $.ajax(
url: milestonesUrl url: milestonesUrl
).done (data) -> ).done (data) ->
<<<<<<< c9dea7761dc69ff38d101d06e0e636e1f3b2a0c4
if $dropdown.hasClass "js-extra-options" if $dropdown.hasClass "js-extra-options"
if showNo if showNo
data.unshift( data.unshift(
...@@ -56,6 +57,26 @@ class @MilestoneSelect ...@@ -56,6 +57,26 @@ class @MilestoneSelect
isAny: true isAny: true
title: 'Any Milestone' title: 'Any Milestone'
) )
=======
extraOptions = []
if showAny
extraOptions.push(
isAny: true
title: 'Any Milestone'
)
if showNo
extraOptions.push(
id: '0'
title: 'No Milestone'
)
if showUpcoming
extraOptions.push(
id: '#upcoming'
title: 'Upcoming'
)
>>>>>>> Updated to only include upcoming on filters
if data.length > 2 if data.length > 2
data.splice 2, 0, 'divider' data.splice 2, 0, 'divider'
......
- if params[:milestone_title] - if params[:milestone_title]
= hidden_field_tag(:milestone_title, params[:milestone_title]) = hidden_field_tag(:milestone_title, params[:milestone_title])
= dropdown_tag(h(params[:milestone_title].presence || "Milestone"), options: { title: "Filter by milestone", toggle_class: 'js-milestone-select js-filter-submit js-extra-options', filter: true, dropdown_class: "dropdown-menu-selectable", = dropdown_tag(h(params[:milestone_title].presence || "Milestone"), options: { title: "Filter by milestone", toggle_class: 'js-milestone-select js-filter-submit', filter: true, dropdown_class: "dropdown-menu-selectable",
placeholder: "Search milestones", footer_content: @project.present?, data: { show_no: true, show_any: true, field_name: "milestone_title", selected: params[:milestone_title], project_id: @project.try(:id), milestones: milestones_filter_dropdown_path, default_label: "Milestone" } }) do placeholder: "Search milestones", footer_content: @project.present?, data: { show_no: true, show_any: true, show_upcoming: true, field_name: "milestone_title", selected: params[:milestone_title], project_id: @project.try(:id), milestones: milestones_filter_dropdown_path, default_label: "Milestone" } }) do
- if @project - if @project
%ul.dropdown-footer-list %ul.dropdown-footer-list
- if can? current_user, :admin_milestone, @project - if can? current_user, :admin_milestone, @project
......
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