Skip to content
Snippets Groups Projects
Verified Commit 51563a71 authored by Jan Provaznik's avatar Jan Provaznik Committed by GitLab
Browse files

Merge branch 'hly-cleanup-issuable-service-code' into 'master'

Remove unused params in issuable base service

See merge request !174226



Merged-by: Jan Provaznik's avatarJan Provaznik <jprovaznik@gitlab.com>
Approved-by: default avatarEugenia Grieff <egrieff@gitlab.com>
Approved-by: Jan Provaznik's avatarJan Provaznik <jprovaznik@gitlab.com>
Reviewed-by: Heinrich Lee Yu's avatarHeinrich Lee Yu <heinrich@gitlab.com>
Co-authored-by: Heinrich Lee Yu's avatarHeinrich Lee Yu <heinrich@gitlab.com>
parents 826cfde2 56fc3f19
No related branches found
No related tags found
1 merge request!174226Remove unused params in issuable base service
Pipeline #1569088168 passed
......@@ -282,13 +282,9 @@ def update(issuable)
change_additional_attributes(issuable)
assign_requested_assignees(issuable)
assign_requested_crm_contacts(issuable)
widget_params = filter_widget_params
initialize_callbacks!(issuable)
if issuable.changed? || params.present? || widget_params.present? || @callbacks.present?
if issuable.changed? || params.present? || @callbacks.present?
issuable.assign_attributes(allowed_update_params(params))
before_update(issuable)
......@@ -447,6 +443,9 @@ def change_additional_attributes(issuable)
change_subscription(issuable)
change_todo(issuable)
toggle_award(issuable)
assign_requested_assignees(issuable)
assign_requested_crm_contacts(issuable)
end
def change_state(issuable)
......@@ -627,10 +626,6 @@ def update_issuable_sla(issuable)
issuable_sla.update(issuable_closed: issuable.closed?)
end
def filter_widget_params
params.delete(:widget_params)
end
def filter_contact_params(issuable)
return if params.slice(:add_contacts, :remove_contacts).empty?
return if can?(current_user, :set_issue_crm_contacts, issuable)
......
......@@ -7,7 +7,6 @@ class UpdateService < ::Issues::UpdateService
def initialize(container:, current_user: nil, params: {}, perform_spam_check: false, widget_params: {})
@extra_params = params.delete(:extra_params) || {}
params[:widget_params] = true if widget_params.present?
super(container: container, current_user: current_user, params: params, perform_spam_check: perform_spam_check)
......
......@@ -48,10 +48,14 @@
context 'when updating widgets' do
context 'for the progress widget' do
let_it_be(:objective_type) { create(:work_item_type, :objective) }
let(:widget_params) { { progress_widget: { progress: 50 } } }
before do
stub_licensed_features(epics: true, okrs: true)
work_item.update!(work_item_type: objective_type)
end
it_behaves_like 'update service that triggers GraphQL work_item_updated subscription' do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment