Class: WorkItems::Widgets::HierarchyService::UpdateService

Inherits:
BaseService show all
Defined in:
app/services/work_items/widgets/hierarchy_service/update_service.rb

Constant Summary collapse

INVALID_RELATIVE_POSITION_ERROR =
'Relative position is not valid.'
CHILDREN_REORDERING_ERROR =
'Relative position cannot be combined with childrenIds.'
UNRELATED_ADJACENT_HIERARCHY_ERROR =
'The adjacent work item\'s parent must match the new parent work item.'
INVALID_ADJACENT_PARENT_ERROR =
'The adjacent work item\'s parent must match the current parent work item.'

Constants inherited from BaseService

BaseService::WidgetError

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #service_params, #widget, #work_item

Attributes inherited from BaseService

#current_user, #params, #project

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Methods inherited from BaseService

#initialize

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

This class inherits a constructor from WorkItems::Widgets::BaseService

Instance Method Details

#before_update_in_transaction(params:) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'app/services/work_items/widgets/hierarchy_service/update_service.rb', line 12

def before_update_in_transaction(params:)
  return unless params.present?

  if positioning?(params)
    service_response!(handle_positioning(params))
  else
    service_response!(handle_hierarchy_changes(params))
  end
end