marty 1.0.19 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 501c6d947ba93588c498a93f344a67afcada46d4
4
- data.tar.gz: cb43351636316da62a7f36a647c0bbb75b4606f1
3
+ metadata.gz: 6ef8c8c7b0bd818fee36e9a1b008e993ee03f0a0
4
+ data.tar.gz: 170c2f758a76d4a6dd5b468afddec69b549639bd
5
5
  SHA512:
6
- metadata.gz: 6f6b3b737550c1f47b935c3540f715b28cb0b7b006a89c7886666c42b87616926361436f8ae51a9fd6dfaaba7ded4c6bc1c21f49102d90a5a37c5b09fa5baf4b
7
- data.tar.gz: 9ff3ce10b787de57073fc73acd55852c0f685d26a49d1e61bc4aa0854ca8a86f9917a2a44c435928db3584e22e2521480b5cd9a14975818de22b5bf52872c3e6
6
+ metadata.gz: fac49a429c93d733c9e80ff8125a6ee384cd8c84e0ef3c935191488f2c8f57ac573182b9a84a69727ba5f2da3bc53dc5aea49093362260bc34e3c3adcda4a9e1
7
+ data.tar.gz: 549351e7df063500acb9144d392b61324b22f305abcba00121a6e5e16499db8aefb84ef7f6483d13b9d0f6af3f18398b75e53ac3884181965f36e620ee675245
@@ -0,0 +1,133 @@
1
+ class Marty::EventView < Marty::Grid
2
+ has_marty_permissions \
3
+ read: :any,
4
+ update: [:admin],
5
+ delete: [:admin]
6
+
7
+ def configure(c)
8
+ super
9
+
10
+ c.title ||= I18n.t('events', default: "Events")
11
+ c.model = "Marty::Event"
12
+ c.paging = :buffered
13
+ c.editing = :in_form
14
+ c.attributes = [
15
+ :id,
16
+ :klass,
17
+ :subject_id,
18
+ :enum_event_operation,
19
+ :start_dt,
20
+ :end_dt,
21
+ :expire_secs,
22
+ :promise_job_id,
23
+ :promise_start_dt,
24
+ :promise_end_dt,
25
+ :promise_status,
26
+ :error,
27
+ :comment,
28
+ ]
29
+
30
+ c.store_config.merge!({sorters: [{property: :id,
31
+ direction: 'DESC',
32
+ }]})
33
+ end
34
+
35
+ action :delete do |a|
36
+ super(a)
37
+ a.icon = :user_delete
38
+ end
39
+
40
+ def default_context_menu
41
+ []
42
+ end
43
+
44
+ attribute :klass do |c|
45
+ c.text = I18n.t("event_grid.klass")
46
+ c.width = 100
47
+ c.read_only = true
48
+ end
49
+
50
+ attribute :subject_id do |c|
51
+ c.text = I18n.t("event_grid.subject_id")
52
+ c.width = 50
53
+ c.read_only = true
54
+ end
55
+
56
+ attribute :enum_event_operation do |c|
57
+ c.text = I18n.t("event_grid.enum_event_operation")
58
+ c.width = 100
59
+ c.read_only = true
60
+ end
61
+
62
+ attribute :start_dt_dt do |c|
63
+ c.text = I18n.t("event_grid.start_dt")
64
+ c.format = "Y-m-d H:i:s"
65
+ end
66
+
67
+ attribute :end_dt_dt do |c|
68
+ c.text = I18n.t("event_grid.end_dt")
69
+ c.format = "Y-m-d H:i:s"
70
+ end
71
+
72
+ attribute :error do |c|
73
+ error_map = {
74
+ nil => "",
75
+ true => "Error",
76
+ false => "Success",
77
+ }
78
+ map_error = error_map.each_with_object({}) { |(k, v), h| h[v] = k }
79
+ editor_config = {
80
+ trigger_action: :all,
81
+ xtype: :combo,
82
+ store: ["Success", "Error", ""],
83
+ }
84
+ c.column_config = { editor: editor_config }
85
+ c.field_config = editor_config
86
+ c.text = I18n.t("event_grid.error")
87
+ c.type = :string
88
+ c.width = 150
89
+ c.getter = lambda {|r| error_map[r.error]}
90
+ c.setter = lambda {|r, v| r.error = map_error[v]}
91
+ end
92
+
93
+ attribute :comment do |c|
94
+ c.text = I18n.t("event_grid.comment")
95
+ c.width = 400
96
+ end
97
+
98
+ def promise_getter(field)
99
+ lambda { |r|
100
+ return nil unless r.promise_id
101
+ return nil unless p = Marty::Promise.where(id: r.promise_id).first
102
+ p.send(field)
103
+ }
104
+ end
105
+ attribute :promise_job_id do |c|
106
+ c.text = I18n.t("event_grid.promise_job_id")
107
+ c.getter = promise_getter(:job_id)
108
+ c.read_only = true
109
+ end
110
+
111
+ attribute :promise_start_dt do |c|
112
+ c.text = I18n.t("event_grid.promise_start_dt")
113
+ c.width = 150
114
+ c.getter = promise_getter(:start_dt)
115
+ c.read_only = true
116
+ end
117
+
118
+ attribute :promise_end_dt do |c|
119
+ c.text = I18n.t("event_grid.promise_end_dt")
120
+ c.width = 150
121
+ c.getter = promise_getter(:end_dt)
122
+ c.read_only = true
123
+ end
124
+
125
+ attribute :promise_status do |c|
126
+ c.text = I18n.t("event_grid.promise_status")
127
+ c.getter = promise_getter(:status)
128
+ c.read_only = true
129
+ end
130
+
131
+ end
132
+
133
+ EventView = Marty::EventView
@@ -4,6 +4,7 @@ require 'marty/posting_window'
4
4
  require 'marty/new_posting_window'
5
5
  require 'marty/import_type_view'
6
6
  require 'marty/user_view'
7
+ require 'marty/event_view'
7
8
  require 'marty/promise_view'
8
9
  require 'marty/api_auth_view'
9
10
  require 'marty/config_view'
@@ -55,6 +56,7 @@ class Marty::MainAuthApp < Marty::AuthApp
55
56
  :user_view,
56
57
  :config_view,
57
58
  :api_auth_view,
59
+ :event_view,
58
60
  :reload_scripts,
59
61
  :load_seed,
60
62
  ] + background_jobs_menu
@@ -167,6 +169,13 @@ class Marty::MainAuthApp < Marty::AuthApp
167
169
  !self.class.has_user_manager_perm?
168
170
  end
169
171
 
172
+ action :event_view do |a|
173
+ a.text = I18n.t("event_view")
174
+ a.handler = :netzke_load_component_by_action
175
+ a.icon = :application_view_list
176
+ a.disabled = !self.class.has_admin_perm?
177
+ end
178
+
170
179
  action :config_view do |a|
171
180
  a.text = I18n.t("config_view")
172
181
  a.handler = :netzke_load_component_by_action
@@ -419,6 +428,7 @@ class Marty::MainAuthApp < Marty::AuthApp
419
428
  end
420
429
  component :import_type_view
421
430
  component :user_view
431
+ component :event_view
422
432
  component :config_view
423
433
  component :api_auth_view do |c|
424
434
  c.disabled = Marty::Util.warped?
@@ -16,6 +16,7 @@ en:
16
16
  applications: Applications
17
17
  create_posting: Create
18
18
  api_auth: API Authorization
19
+ event_view: Event View
19
20
 
20
21
  roles:
21
22
  viewer: Viewer
@@ -57,6 +58,21 @@ en:
57
58
  select_roles: Select one or more roles
58
59
  created_dt: Last Checked In
59
60
 
61
+ event_grid:
62
+ title: Events
63
+ klass: Class
64
+ subject_id: ID
65
+ enum_event_operation: Operation
66
+ expire_secs: Expire Secs
67
+ error: Completion Status
68
+ start_dt: Started At
69
+ end_dt: Ended At
70
+ promise_start_dt: Promise Started At
71
+ promise_end_dt: Promise Ended At
72
+ promise_job_id: Promise Job ID
73
+ promise_status: Promise Status
74
+ comment: Comment
75
+
60
76
  script_form:
61
77
  save: Save
62
78
  checkin: Check In
data/lib/marty/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "1.0.19"
2
+ VERSION = "1.0.20"
3
3
  end
@@ -339,6 +339,7 @@ feature 'under Applications menu, Scripting workflows', js: true do
339
339
  end
340
340
 
341
341
  and_by 'script is gone' do
342
+ wait_for_ready
342
343
  expect(script_grid.row_count).to eq 4
343
344
  end
344
345
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.19
4
+ version: 1.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arman Bostani
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2017-01-23 00:00:00.000000000 Z
17
+ date: 2017-01-31 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: pg
@@ -178,6 +178,7 @@ files:
178
178
  - app/components/marty/auth_app.rb
179
179
  - app/components/marty/auth_app/client/auth_app.js
180
180
  - app/components/marty/config_view.rb
181
+ - app/components/marty/event_view.rb
181
182
  - app/components/marty/extras/layout.rb
182
183
  - app/components/marty/extras/misc.rb
183
184
  - app/components/marty/form.rb