module Ecoportal module API class V2 class Page class Component class ActionsField < Page::Component passboolean :create_actions passthrough :required_completed passboolean :filled_in? passarray :permitted_person_schema_ids, order_matters: false passboolean :enable_attaching_actions passarray :action_ids, :all_actions, order_matters: false passarray :open_actions, :closed_actions, :overdue_actions, order_matters: false passthrough :actions_hash passarray :action_recurrence_ids, order_matters: false def empty? action_ids.to_a.empty? end # Adds a task with `name` short description # @return [Ecoportal::API::V2::Page::Component::Action] def attach_action (*ids, force: false) raise "Can't attach actions" unless enable_attaching_actions && force action_ids << ids end def to_s(delimiter: "\n") action_ids.join(delimiter) end end end end end end end