Commit fd8d9777 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ccr/extract_EE_code_5942' into 'master'

Extract EE specific files, closes #5942

Closes #5942

See merge request gitlab-org/gitlab-ee!5771
parents e18ed65e 9b67b920
module IssuableActions module IssuableActions
prepend EE::IssuableActions
extend ActiveSupport::Concern extend ActiveSupport::Concern
included do included do
...@@ -7,6 +8,19 @@ module IssuableActions ...@@ -7,6 +8,19 @@ module IssuableActions
before_action :authorize_admin_issuable!, only: :bulk_update before_action :authorize_admin_issuable!, only: :bulk_update
end end
def permitted_keys
[
:issuable_ids,
:assignee_id,
:milestone_id,
:state_event,
:subscription_event,
label_ids: [],
add_label_ids: [],
remove_label_ids: []
]
end
def show def show
respond_to do |format| respond_to do |format|
format.html format.html
...@@ -140,25 +154,15 @@ module IssuableActions ...@@ -140,25 +154,15 @@ module IssuableActions
end end
def bulk_update_params def bulk_update_params
permitted_keys = [ permitted_keys_array = permitted_keys.dup
:issuable_ids,
:assignee_id,
:milestone_id,
:state_event,
:subscription_event,
:weight,
label_ids: [],
add_label_ids: [],
remove_label_ids: []
]
if resource_name == 'issue' if resource_name == 'issue'
permitted_keys << { assignee_ids: [] } permitted_keys_array << { assignee_ids: [] }
else else
permitted_keys.unshift(:assignee_id) permitted_keys_array.unshift(:assignee_id)
end end
params.require(:update).permit(permitted_keys) params.require(:update).permit(permitted_keys_array)
end end
def resource_name def resource_name
......
module IssuableCollections module IssuableCollections
prepend EE::IssuableCollections
extend ActiveSupport::Concern extend ActiveSupport::Concern
include SortingHelper include SortingHelper
include Gitlab::IssuableMetadata include Gitlab::IssuableMetadata
...@@ -140,8 +141,6 @@ module IssuableCollections ...@@ -140,8 +141,6 @@ module IssuableCollections
when 'milestone_due_desc' then sort_value_milestone when 'milestone_due_desc' then sort_value_milestone
when 'downvotes_asc' then sort_value_popularity when 'downvotes_asc' then sort_value_popularity
when 'downvotes_desc' then sort_value_popularity when 'downvotes_desc' then sort_value_popularity
when 'weight_asc' then sort_value_weight
when 'weight_desc' then sort_value_weight
else value else value
end end
end end
......
module EE
module IssuableActions
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
EE_PERMITTED_KEYS = %w[
weight
].freeze
override :permitted_keys
def permitted_keys
@permitted_keys ||= (super + EE_PERMITTED_KEYS).freeze
end
end
end
module EE
module IssuableCollections
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
# Update old values to the actual ones.
override :update_cookie_value
def update_cookie_value(value)
if value == 'weight_asc' || value == 'weight_desc'
sort_value_weight
else
super
end
end
end
end
title: Extract EE specific files
merge_request: !5771
type: added
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