blob: fc6714f1e083778c9a597925ef4fcd0e06d56dba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# frozen_string_literal: true
module WorkItems
module Widgets
class Hierarchy < Base
def parent
work_item.work_item_parent
end
def children
work_item.work_item_children_by_relative_position
end
def ancestors
work_item.ancestors
end
def self.quick_action_commands
[:set_parent, :add_child]
end
def self.quick_action_params
[:set_parent, :add_child]
end
def self.process_quick_action_param(param_name, value)
return super unless param_name.in?(quick_action_params) && value.present?
return { parent: value } if param_name == :set_parent
return { children: value } if param_name == :add_child
end
end
end
end
|