summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-07-03 11:17:55 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-07-03 11:17:55 +0000
commit063b035d931d0676cf427fa8de49966360cbf42b (patch)
tree2b47a0aac0196a7fdbba66b716b7bb76f7d4a675 /app
parent2443ab69206f7cbd9a6ac2e96308695a01b85c7a (diff)
parentb8430dddbd413c87f77ba7f02d9b0a0cd4ec42ad (diff)
downloadgitlab-ce-063b035d931d0676cf427fa8de49966360cbf42b.tar.gz
Merge branch '34116-milestone-filtering-on-group-issues' into 'master'
Use correct milestones for filtering on Group Issues Closes #34116 See merge request !12374
Diffstat (limited to 'app')
-rw-r--r--app/controllers/groups/milestones_controller.rb3
-rw-r--r--app/helpers/milestones_helper.rb2
2 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb
index e52fa766044..6b1d418fc9a 100644
--- a/app/controllers/groups/milestones_controller.rb
+++ b/app/controllers/groups/milestones_controller.rb
@@ -11,6 +11,9 @@ class Groups::MilestonesController < Groups::ApplicationController
@milestone_states = GlobalMilestone.states_count(@projects)
@milestones = Kaminari.paginate_array(milestones).page(params[:page])
end
+ format.json do
+ render json: milestones.map { |m| m.for_display.slice(:title, :name) }
+ end
end
end
diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb
index a230db22fa2..f346e20e807 100644
--- a/app/helpers/milestones_helper.rb
+++ b/app/helpers/milestones_helper.rb
@@ -74,6 +74,8 @@ module MilestonesHelper
project = @target_project || @project
if project
namespace_project_milestones_path(project.namespace, project, :json)
+ elsif @group
+ group_milestones_path(@group, :json)
else
dashboard_milestones_path(:json)
end