Class: Marty::EventView

Inherits:
Grid
  • Object
show all
Defined in:
app/components/marty/event_view.rb

Constant Summary

Constants included from Permissions

Permissions::NETZKE_ENDPOINTS

Instance Method Summary collapse

Methods inherited from Grid

#child_components, #class_can?, #configure_form_window, #get_json_sorter, #has_search_action?, #initialize, #linked_components

Methods included from Permissions

#can_call_endpoint?, #can_perform_action?, #can_perform_actions, #current_user_roles, extended, #has_any_perm?, #has_marty_permissions, #has_perm?

Constructor Details

This class inherits a constructor from Marty::Grid

Instance Method Details

#configure(c) ⇒ Object



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
# File 'app/components/marty/event_view.rb', line 7

def configure(c)
  super

  c.title ||= I18n.t('events', default: 'Events')
  c.model                  = 'Marty::Event'
  c.paging                 = :buffered
  c.editing                = :in_form
  c.attributes             = [
    :id,
    :klass,
    :subject_id,
    :enum_event_operation,
    :start_dt,
    :end_dt,
    :expire_secs,
    :promise_job_id,
    :promise_start_dt,
    :promise_end_dt,
    :promise_status,
    :error,
    :comment,
  ]

  c.store_config.merge!(sorters: [{ property: :id,
                               direction: 'DESC',
                                   }])
  Marty::Event.cleanup
end

#default_context_menuObject



36
37
38
# File 'app/components/marty/event_view.rb', line 36

def default_context_menu
  []
end

#promise_getter(field) ⇒ Object



94
95
96
97
98
99
100
101
# File 'app/components/marty/event_view.rb', line 94

def promise_getter(field)
  lambda { |r|
    return nil unless r.promise_id
    return nil unless p = Marty::Promise.where(id: r.promise_id).first

    p.send(field)
  }
end