summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-03-24 08:40:46 +0000
committerPhil Hughes <me@iamphill.com>2016-03-29 11:58:11 +0100
commita6d7c695215e442af88e261b2013bf0c99fcea23 (patch)
tree4241311d2b9a03688d08c124c2e87077565d836d
parentc9dea7761dc69ff38d101d06e0e636e1f3b2a0c4 (diff)
downloadgitlab-ce-a6d7c695215e442af88e261b2013bf0c99fcea23.tar.gz
Updated to only include upcoming on filters
Fixes tests
-rw-r--r--app/assets/javascripts/milestone_select.js.coffee23
-rw-r--r--app/views/shared/issuable/_milestone_dropdown.html.haml4
2 files changed, 24 insertions, 3 deletions
diff --git a/app/assets/javascripts/milestone_select.js.coffee b/app/assets/javascripts/milestone_select.js.coffee
index 5f5f38e0d47..bbad685a8ed 100644
--- a/app/assets/javascripts/milestone_select.js.coffee
+++ b/app/assets/javascripts/milestone_select.js.coffee
@@ -11,6 +11,7 @@ class @MilestoneSelect
selectedMilestone = $dropdown.data('selected')
showNo = $dropdown.data('show-no')
showAny = $dropdown.data('show-any')
+ showUpcoming = $dropdown.data('show-upcoming')
useId = $dropdown.data('use-id')
defaultLabel = $dropdown.data('default-label')
issuableId = $dropdown.data('issuable-id')
@@ -34,7 +35,6 @@ class @MilestoneSelect
id: '0'
title: 'No Milestone'
}, {
- upcoming: true
id: '#upcoming'
title: 'Upcoming'
}]
@@ -44,6 +44,7 @@ class @MilestoneSelect
$.ajax(
url: milestonesUrl
).done (data) ->
+<<<<<<< c9dea7761dc69ff38d101d06e0e636e1f3b2a0c4
if $dropdown.hasClass "js-extra-options"
if showNo
data.unshift(
@@ -56,6 +57,26 @@ class @MilestoneSelect
isAny: true
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
data.splice 2, 0, 'divider'
diff --git a/app/views/shared/issuable/_milestone_dropdown.html.haml b/app/views/shared/issuable/_milestone_dropdown.html.haml
index 1c79494f816..05841ba4392 100644
--- a/app/views/shared/issuable/_milestone_dropdown.html.haml
+++ b/app/views/shared/issuable/_milestone_dropdown.html.haml
@@ -1,7 +1,7 @@
- if 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",
- 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
+= 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, 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
%ul.dropdown-footer-list
- if can? current_user, :admin_milestone, @project