diff options
Diffstat (limited to 'app/controllers/projects/issues_controller.rb')
-rw-r--r-- | app/controllers/projects/issues_controller.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index b4d89db20c5..b16f3dd9d82 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -33,7 +33,7 @@ class Projects::IssuesController < Projects::ApplicationController before_action :authorize_create_issue!, only: [:new, :create] # Allow modify issue - before_action :authorize_update_issuable!, only: [:edit, :update, :move] + before_action :authorize_update_issuable!, only: [:edit, :update, :move, :reorder] # Allow create a new branch and empty WIP merge request from current issue before_action :authorize_create_merge_request_from!, only: [:create_merge_request] @@ -132,6 +132,16 @@ class Projects::IssuesController < Projects::ApplicationController render_conflict_response end + def reorder + service = Issues::ReorderService.new(project, current_user, reorder_params) + + if service.execute(issue) + head :ok + else + head :unprocessable_entity + end + end + def related_branches @related_branches = Issues::RelatedBranchesService.new(project, current_user).execute(issue) @@ -239,6 +249,10 @@ class Projects::IssuesController < Projects::ApplicationController ] + [{ label_ids: [], assignee_ids: [], update_task: [:index, :checked, :line_number, :line_source] }] end + def reorder_params + params.permit(:move_before_id, :move_after_id, :group_full_path) + end + def store_uri if request.get? && !request.xhr? store_location_for :user, request.fullpath |