summaryrefslogtreecommitdiff
path: root/app/controllers/projects/milestones_controller.rb
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2018-03-01 16:09:25 -0600
committerJose Ivan Vargas <jvargas@gitlab.com>2018-03-06 16:32:26 -0600
commita16547e5c2d42bfe7af025556e90f0f895a97f59 (patch)
tree093a4c25545f78454fda80c681570e264aab143b /app/controllers/projects/milestones_controller.rb
parentf42397d19a735de2e5ae38725270614826ec05da (diff)
downloadgitlab-ce-a16547e5c2d42bfe7af025556e90f0f895a97f59.tar.gz
used respond_to formats for persisting flash messages insteadjivl-new-modal-project-labels-milestones
Diffstat (limited to 'app/controllers/projects/milestones_controller.rb')
-rw-r--r--app/controllers/projects/milestones_controller.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/controllers/projects/milestones_controller.rb b/app/controllers/projects/milestones_controller.rb
index 9a4e99c39e9..ff93147d00f 100644
--- a/app/controllers/projects/milestones_controller.rb
+++ b/app/controllers/projects/milestones_controller.rb
@@ -1,6 +1,5 @@
class Projects::MilestonesController < Projects::ApplicationController
include MilestoneActions
- include FlashHelper
before_action :check_issuables_available!
before_action :milestone, only: [:edit, :update, :destroy, :show, :merge_requests, :participants, :labels, :promote]
@@ -72,7 +71,16 @@ class Projects::MilestonesController < Projects::ApplicationController
def promote
Milestones::PromoteService.new(project, current_user).execute(milestone)
- redirect_to project_milestones_path(project, body_data: get_body_data_page(project_milestones_path(project))), status: 303
+
+ flash[:notice] = "#{milestone.title} promoted to group milestone"
+ respond_to do |format|
+ format.html do
+ redirect_to project_milestones_path(project)
+ end
+ format.json do
+ render json: { url: project_milestones_path(project) }
+ end
+ end
rescue Milestones::PromoteService::PromoteMilestoneError => error
redirect_to milestone, alert: error.message
end