Commit c53f2d8e authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Revert parent param removal

parent 55dd0d72
......@@ -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
......
......@@ -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
......
......@@ -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)
......
- 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
......
......@@ -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')
......
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