diff options
5 files changed, 11 insertions, 9 deletions
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 9a3216cbd05..c9e636fb65e 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -271,7 +271,7 @@ class Projects::IssuesController < Projects::ApplicationController end def issue_params - params.permit(*issue_params_attributes) + params.require(:issue).permit(*issue_params_attributes) end def issue_params_attributes diff --git a/app/controllers/projects/merge_requests/application_controller.rb b/app/controllers/projects/merge_requests/application_controller.rb index b5335509b11..6602b204fcb 100644 --- a/app/controllers/projects/merge_requests/application_controller.rb +++ b/app/controllers/projects/merge_requests/application_controller.rb @@ -17,7 +17,7 @@ class Projects::MergeRequests::ApplicationController < Projects::ApplicationCont end def merge_request_params - params.permit(merge_request_params_attributes) + params.require(:merge_request).permit(merge_request_params_attributes) end def merge_request_params_attributes diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 6f887accf58..64a64958691 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -247,7 +247,8 @@ module IssuablesHelper def close_issuable_url(issuable) params = {} - params[:state_event] = :close + params[issuable.model_name.to_s.underscore] = {} + params[issuable.model_name.to_s.underscore][:state_event] = :close params[:format] = :json if issuable.is_a?(Issue) issuable_url(issuable, params) @@ -255,7 +256,8 @@ module IssuablesHelper def reopen_issuable_url(issuable) params = {} - params[:state_event] = :reopen + params[issuable.model_name.to_s.underscore] = {} + params[issuable.model_name.to_s.underscore][:state_event] = :reopen params[:format] = :json if issuable.is_a?(Issue) issuable_url(issuable, params) diff --git a/app/views/shared/issuable/_close_reopen_button.html.haml b/app/views/shared/issuable/_close_reopen_button.html.haml index 4d8721ab54a..fc8729d10d4 100644 --- a/app/views/shared/issuable/_close_reopen_button.html.haml +++ b/app/views/shared/issuable/_close_reopen_button.html.haml @@ -1,10 +1,10 @@ - is_current_user = current_user == issuable.author - display_issuable_type = issuable.model_name.human.downcase -- button_method = issuable.is_a?(MergeRequest) ? 'put' : '' +- button_method = issuable.is_a?(MergeRequest) ? :put : nil - if can_update && is_current_user - = link_to "Close #{display_issuable_type}", close_issuable_url(issuable), { method: button_method, class: "hidden-xs hidden-sm btn btn-close btn-grouped #{'hidden' if issuable.closed?}", title: "Close #{display_issuable_type}" } - = link_to "Reopen #{display_issuable_type}", reopen_issuable_url(issuable), { method: button_method, class: "hidden-xs hidden-sm btn btn-reopen btn-grouped #{'hidden' unless issuable.closed?}", title: "Reopen #{display_issuable_type}" } + = link_to "Close #{display_issuable_type}", close_issuable_url(issuable), method: button_method, class: "hidden-xs hidden-sm btn btn-close btn-grouped #{'hidden' if issuable.closed?}", title: "Close #{display_issuable_type}" + = link_to "Reopen #{display_issuable_type}", reopen_issuable_url(issuable), method: button_method, class: "hidden-xs hidden-sm btn btn-reopen btn-grouped #{'hidden' unless issuable.closed?}", title: "Reopen #{display_issuable_type}" - elsif can_update && !is_current_user = render 'shared/issuable/close_reopen_report_toggle', issuable: issuable - else diff --git a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml b/app/views/shared/issuable/_close_reopen_report_toggle.html.haml index 8a68fd83d92..5a616c377f2 100644 --- a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml +++ b/app/views/shared/issuable/_close_reopen_report_toggle.html.haml @@ -4,10 +4,10 @@ - button_responsive_class = 'hidden-xs hidden-sm' - button_class = "#{button_responsive_class} btn btn-grouped js-issuable-close-button issuable-close-button" - toggle_class = "#{button_responsive_class} btn btn-nr dropdown-toggle js-issuable-close-toggle" -- button_method = issuable.is_a?(MergeRequest) ? 'put' : '' +- button_method = issuable.is_a?(MergeRequest) ? :put : nil .pull-left.btn-group.prepend-left-10.issuable-close-dropdown.droplab-dropdown.js-issuable-close-dropdown - = link_to "#{display_button_action} #{display_issuable_type}", close_reopen_issuable_url(issuable), { method: button_method, class: "#{button_class} btn-#{button_action}", title: "#{display_button_action} #{display_issuable_type}" } + = link_to "#{display_button_action} #{display_issuable_type}", close_reopen_issuable_url(issuable), method: button_method, class: "#{button_class} btn-#{button_action}", title: "#{display_button_action} #{display_issuable_type}" = button_tag type: 'button', class: "#{toggle_class} btn-#{button_action}-color", data: { 'dropdown-trigger' => '#issuable-close-menu' }, 'aria-label' => 'Toggle dropdown' do = icon('caret-down', class: 'toggle-icon icon') |