GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 9022070f authored by Douwe Maan's avatar Douwe Maan

Merge branch 'olirogers/gitlab-ce-project-milestone-order' into 'master'

Fix milestone order in project and issue edit lists to due_date

_Originally opened at !2579 by @olirogers._

- - -

This MR orders the milestones by due date (earliest first) in the project and edit issue view. These suggestions were made be @orih in #6001 and fixes #6001.

This continues the work of !1934 to order milestones.

I found this annoying when creating milestones, found #6001 but no attached MR. This is my first for this project - comments and criticisms welcome.

See merge request !2780
parents e45bc034 a7567ca1
......@@ -57,6 +57,7 @@ v 8.4.4
- Update omniauth-saml gem to 1.4.2
- Prevent long-running backup tasks from timing out the database connection
- Add a Project setting to allow guests to view build logs (defaults to true)
- Sort project milestones by due date including issue editor (Oliver Rogers / Orih)
v 8.4.3
- Increase lfs_objects size column to 8-byte integer to allow files larger
......@@ -11,11 +11,12 @@ class Projects::MilestonesController < Projects::ApplicationController
respond_to :html
def index
@milestones = case params[:state]
when 'all'; @project.milestones.order("state, due_date DESC")
when 'closed'; @project.milestones.closed.order("due_date DESC")
else"due_date ASC")
@milestones =
case params[:state]
when 'all' then @project.milestones.reorder(due_date: :desc, title: :asc)
when 'closed' then @project.milestones.closed.reorder(due_date: :desc, title: :asc)
else :asc, title: :asc)
@milestones = @milestones.includes(:project)
@milestones =[:page]).per(PER_PAGE)
......@@ -44,14 +44,14 @@ def url_for_issue(issue_iid, project = @project, options = {})
def bulk_update_milestone_options
milestones = project_active_milestones.to_a
milestones = :asc, title: :asc).to_a
options_from_collection_for_select(milestones, 'id', 'title', params[:milestone_id])
def milestone_options(object)
milestones =
milestones = :asc, title: :asc).to_a
options_from_collection_for_select(milestones, 'id', 'title', object.milestone_id)
......@@ -69,7 +69,7 @@ def status_box_class(item)
def issue_button_visibility(issue, closed)
def issue_button_visibility(issue, closed)
return 'hidden' if issue.closed? == closed
......@@ -98,10 +98,6 @@ def project_nav_tab?(name)
project_nav_tabs.include? name
def project_active_milestones"due_date, title ASC")
def project_for_deploy_key(deploy_key)
if deploy_key.projects.include?(@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