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
prepend EE::IssuableActions
extend ActiveSupport::Concern
included do
......@@ -7,6 +8,19 @@ module IssuableActions
before_action :authorize_admin_issuable!, only: :bulk_update
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
respond_to do |format|
format.html
......@@ -140,25 +154,15 @@ module IssuableActions
end
def bulk_update_params
permitted_keys = [
:issuable_ids,
:assignee_id,
:milestone_id,
:state_event,
:subscription_event,
:weight,
label_ids: [],
add_label_ids: [],
remove_label_ids: []
]
permitted_keys_array = permitted_keys.dup
if resource_name == 'issue'
permitted_keys << { assignee_ids: [] }
permitted_keys_array << { assignee_ids: [] }
else
permitted_keys.unshift(:assignee_id)
permitted_keys_array.unshift(:assignee_id)
end
params.require(:update).permit(permitted_keys)
params.require(:update).permit(permitted_keys_array)
end
def resource_name
......
module IssuableCollections
prepend EE::IssuableCollections
extend ActiveSupport::Concern
include SortingHelper
include Gitlab::IssuableMetadata
......@@ -140,8 +141,6 @@ module IssuableCollections
when 'milestone_due_desc' then sort_value_milestone
when 'downvotes_asc' 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
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