Class: Marty::PromiseView

Inherits:
Netzke::Tree::Base
  • Object
show all
Extended by:
Permissions
Defined in:
app/components/marty/promise_view.rb

Constant Summary

Constants included from Permissions

Marty::Permissions::NETZKE_ENDPOINTS

Instance Method Summary collapse

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?

Instance Method Details

#bbarObject



52
53
54
# File 'app/components/marty/promise_view.rb', line 52

def bbar
  [:clear, '->', :refresh, :download]
end

#class_can?(op) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/components/marty/promise_view.rb', line 21

def class_can?(op)
  self.class.can_perform_action?(op)
end

#configure(c) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'app/components/marty/promise_view.rb', line 25

def configure(c)
  super
  c.title = I18n.t('jobs.promise_view')
  c.model = 'Marty::VwPromise'
  c.attributes = [
    { name: :title, xtype: :treecolumn },
    :user__login,
    :job_id,
    :priority,
    :start_dt,
    :end_dt,
    :status,
    :cformat,
    :error,
  ]
  c.root_visible = false
  c.paging = :none
  c.bbar = bbar
  c.read_only = true
  c.permissions = {
    create: class_can?(:create),
    read:   class_can?(:read),
    update: class_can?(:update),
    delete: class_can?(:delete)
  }
end

#get_records(params) ⇒ Object



80
81
82
83
# File 'app/components/marty/promise_view.rb', line 80

def get_records params
  search_scope = config[:live_search_scope] || :live_search
  Marty::VwPromise.children_for_id(params[:id], params[search_scope])
end