marty 0.5.41 → 1.0.0

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.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -2
  3. data/app/components/marty/api_auth_view.rb +5 -8
  4. data/app/components/marty/auth_app.rb +8 -9
  5. data/app/components/marty/auth_app/{javascripts → client}/auth_app.js +4 -4
  6. data/app/components/marty/config_view.rb +7 -9
  7. data/app/components/marty/extras/misc.rb +14 -1
  8. data/app/components/marty/form.rb +1 -1
  9. data/app/components/marty/grid.rb +27 -14
  10. data/app/components/marty/grid_append_only.rb +3 -5
  11. data/app/components/marty/import_type_view.rb +8 -11
  12. data/app/components/marty/live_search_grid_panel.rb +3 -3
  13. data/app/components/marty/main_auth_app.rb +17 -19
  14. data/app/components/marty/mcfly_grid_panel.rb +13 -15
  15. data/app/components/marty/new_posting_form.rb +5 -5
  16. data/app/components/marty/new_posting_window.rb +1 -1
  17. data/app/components/marty/panel.rb +2 -2
  18. data/app/components/marty/posting_grid.rb +19 -28
  19. data/app/components/marty/posting_window.rb +6 -7
  20. data/app/components/marty/promise_view.rb +23 -24
  21. data/app/components/marty/promise_view/{stylesheets → client}/promise_view.css +0 -0
  22. data/app/components/marty/report_form.rb +11 -10
  23. data/app/components/marty/report_select.rb +17 -15
  24. data/app/components/marty/reporting.rb +2 -2
  25. data/app/components/marty/script_form.rb +34 -38
  26. data/app/components/marty/script_form/{javascripts → client}/Ext.ux.form.field.CodeMirror.js +0 -0
  27. data/app/components/marty/script_form/{stylesheets → client}/codemirror.css +0 -0
  28. data/app/components/marty/script_form/{javascripts → client}/codemirror.js +0 -0
  29. data/app/components/marty/script_form/{stylesheets → client}/delorean.css +0 -0
  30. data/app/components/marty/script_form/{javascripts → client}/mode/clike/clike.js +0 -0
  31. data/app/components/marty/script_form/{javascripts → client}/mode/clike/index.html +0 -0
  32. data/app/components/marty/script_form/{javascripts → client}/mode/clike/scala.html +0 -0
  33. data/app/components/marty/script_form/{javascripts → client}/mode/clojure/clojure.js +0 -0
  34. data/app/components/marty/script_form/{javascripts → client}/mode/clojure/index.html +0 -0
  35. data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/LICENSE +0 -0
  36. data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/coffeescript.js +0 -0
  37. data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/index.html +0 -0
  38. data/app/components/marty/script_form/{javascripts → client}/mode/commonlisp/commonlisp.js +0 -0
  39. data/app/components/marty/script_form/{javascripts → client}/mode/commonlisp/index.html +0 -0
  40. data/app/components/marty/script_form/{javascripts → client}/mode/css/css.js +0 -0
  41. data/app/components/marty/script_form/{javascripts → client}/mode/css/index.html +0 -0
  42. data/app/components/marty/script_form/{javascripts → client}/mode/css/test.js +0 -0
  43. data/app/components/marty/script_form/{javascripts → client}/mode/delorean/delorean.js +0 -0
  44. data/app/components/marty/script_form/{javascripts → client}/mode/diff/diff.js +0 -0
  45. data/app/components/marty/script_form/{javascripts → client}/mode/diff/index.html +0 -0
  46. data/app/components/marty/script_form/{javascripts → client}/mode/ecl/ecl.js +0 -0
  47. data/app/components/marty/script_form/{javascripts → client}/mode/ecl/index.html +0 -0
  48. data/app/components/marty/script_form/{javascripts → client}/mode/erlang/erlang.js +0 -0
  49. data/app/components/marty/script_form/{javascripts → client}/mode/erlang/index.html +0 -0
  50. data/app/components/marty/script_form/{javascripts → client}/mode/gfm/gfm.js +0 -0
  51. data/app/components/marty/script_form/{javascripts → client}/mode/gfm/index.html +0 -0
  52. data/app/components/marty/script_form/{javascripts → client}/mode/go/go.js +0 -0
  53. data/app/components/marty/script_form/{javascripts → client}/mode/go/index.html +0 -0
  54. data/app/components/marty/script_form/{javascripts → client}/mode/groovy/groovy.js +0 -0
  55. data/app/components/marty/script_form/{javascripts → client}/mode/groovy/index.html +0 -0
  56. data/app/components/marty/script_form/{javascripts → client}/mode/haskell/haskell.js +0 -0
  57. data/app/components/marty/script_form/{javascripts → client}/mode/haskell/index.html +0 -0
  58. data/app/components/marty/script_form/{javascripts → client}/mode/haxe/haxe.js +0 -0
  59. data/app/components/marty/script_form/{javascripts → client}/mode/haxe/index.html +0 -0
  60. data/app/components/marty/script_form/{javascripts → client}/mode/htmlembedded/htmlembedded.js +0 -0
  61. data/app/components/marty/script_form/{javascripts → client}/mode/htmlembedded/index.html +0 -0
  62. data/app/components/marty/script_form/{javascripts → client}/mode/htmlmixed/htmlmixed.js +0 -0
  63. data/app/components/marty/script_form/{javascripts → client}/mode/htmlmixed/index.html +0 -0
  64. data/app/components/marty/script_form/{javascripts → client}/mode/javascript/index.html +0 -0
  65. data/app/components/marty/script_form/{javascripts → client}/mode/javascript/javascript.js +0 -0
  66. data/app/components/marty/script_form/{javascripts → client}/mode/jinja2/index.html +0 -0
  67. data/app/components/marty/script_form/{javascripts → client}/mode/jinja2/jinja2.js +0 -0
  68. data/app/components/marty/script_form/{javascripts → client}/mode/less/index.html +0 -0
  69. data/app/components/marty/script_form/{javascripts → client}/mode/less/less.js +0 -0
  70. data/app/components/marty/script_form/{javascripts → client}/mode/lua/index.html +0 -0
  71. data/app/components/marty/script_form/{javascripts → client}/mode/lua/lua.js +0 -0
  72. data/app/components/marty/script_form/{javascripts → client}/mode/markdown/index.html +0 -0
  73. data/app/components/marty/script_form/{javascripts → client}/mode/markdown/markdown.js +0 -0
  74. data/app/components/marty/script_form/{javascripts → client}/mode/markdown/test.js +0 -0
  75. data/app/components/marty/script_form/{javascripts → client}/mode/mysql/index.html +0 -0
  76. data/app/components/marty/script_form/{javascripts → client}/mode/mysql/mysql.js +0 -0
  77. data/app/components/marty/script_form/{javascripts → client}/mode/ntriples/index.html +0 -0
  78. data/app/components/marty/script_form/{javascripts → client}/mode/ntriples/ntriples.js +0 -0
  79. data/app/components/marty/script_form/{javascripts → client}/mode/ocaml/index.html +0 -0
  80. data/app/components/marty/script_form/{javascripts → client}/mode/ocaml/ocaml.js +0 -0
  81. data/app/components/marty/script_form/{javascripts → client}/mode/pascal/LICENSE +0 -0
  82. data/app/components/marty/script_form/{javascripts → client}/mode/pascal/index.html +0 -0
  83. data/app/components/marty/script_form/{javascripts → client}/mode/pascal/pascal.js +0 -0
  84. data/app/components/marty/script_form/{javascripts → client}/mode/perl/LICENSE +0 -0
  85. data/app/components/marty/script_form/{javascripts → client}/mode/perl/index.html +0 -0
  86. data/app/components/marty/script_form/{javascripts → client}/mode/perl/perl.js +0 -0
  87. data/app/components/marty/script_form/{javascripts → client}/mode/php/index.html +0 -0
  88. data/app/components/marty/script_form/{javascripts → client}/mode/php/php.js +0 -0
  89. data/app/components/marty/script_form/{javascripts → client}/mode/pig/index.html +0 -0
  90. data/app/components/marty/script_form/{javascripts → client}/mode/pig/pig.js +0 -0
  91. data/app/components/marty/script_form/{javascripts → client}/mode/plsql/index.html +0 -0
  92. data/app/components/marty/script_form/{javascripts → client}/mode/plsql/plsql.js +0 -0
  93. data/app/components/marty/script_form/{javascripts → client}/mode/properties/index.html +0 -0
  94. data/app/components/marty/script_form/{javascripts → client}/mode/properties/properties.js +0 -0
  95. data/app/components/marty/script_form/{javascripts → client}/mode/python/LICENSE.txt +0 -0
  96. data/app/components/marty/script_form/{javascripts → client}/mode/python/index.html +0 -0
  97. data/app/components/marty/script_form/{javascripts → client}/mode/python/python.js +0 -0
  98. data/app/components/marty/script_form/{javascripts → client}/mode/r/LICENSE +0 -0
  99. data/app/components/marty/script_form/{javascripts → client}/mode/r/index.html +0 -0
  100. data/app/components/marty/script_form/{javascripts → client}/mode/r/r.js +0 -0
  101. data/app/components/marty/script_form/{javascripts → client}/mode/rpm/changes/changes.js +0 -0
  102. data/app/components/marty/script_form/{javascripts → client}/mode/rpm/changes/index.html +0 -0
  103. data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/index.html +0 -0
  104. data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/spec.css +0 -0
  105. data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/spec.js +0 -0
  106. data/app/components/marty/script_form/{javascripts → client}/mode/rst/index.html +0 -0
  107. data/app/components/marty/script_form/{javascripts → client}/mode/rst/rst.js +0 -0
  108. data/app/components/marty/script_form/{javascripts → client}/mode/ruby/LICENSE +0 -0
  109. data/app/components/marty/script_form/{javascripts → client}/mode/ruby/index.html +0 -0
  110. data/app/components/marty/script_form/{javascripts → client}/mode/ruby/ruby.js +0 -0
  111. data/app/components/marty/script_form/{javascripts → client}/mode/rust/index.html +0 -0
  112. data/app/components/marty/script_form/{javascripts → client}/mode/rust/rust.js +0 -0
  113. data/app/components/marty/script_form/{javascripts → client}/mode/scheme/index.html +0 -0
  114. data/app/components/marty/script_form/{javascripts → client}/mode/scheme/scheme.js +0 -0
  115. data/app/components/marty/script_form/{javascripts → client}/mode/shell/index.html +0 -0
  116. data/app/components/marty/script_form/{javascripts → client}/mode/shell/shell.js +0 -0
  117. data/app/components/marty/script_form/{javascripts → client}/mode/sieve/LICENSE +0 -0
  118. data/app/components/marty/script_form/{javascripts → client}/mode/sieve/index.html +0 -0
  119. data/app/components/marty/script_form/{javascripts → client}/mode/sieve/sieve.js +0 -0
  120. data/app/components/marty/script_form/{javascripts → client}/mode/smalltalk/index.html +0 -0
  121. data/app/components/marty/script_form/{javascripts → client}/mode/smalltalk/smalltalk.js +0 -0
  122. data/app/components/marty/script_form/{javascripts → client}/mode/smarty/index.html +0 -0
  123. data/app/components/marty/script_form/{javascripts → client}/mode/smarty/smarty.js +0 -0
  124. data/app/components/marty/script_form/{javascripts → client}/mode/sparql/index.html +0 -0
  125. data/app/components/marty/script_form/{javascripts → client}/mode/sparql/sparql.js +0 -0
  126. data/app/components/marty/script_form/{javascripts → client}/mode/stex/index.html +0 -0
  127. data/app/components/marty/script_form/{javascripts → client}/mode/stex/stex.js +0 -0
  128. data/app/components/marty/script_form/{javascripts → client}/mode/stex/test.js +0 -0
  129. data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/index.html +0 -0
  130. data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/tiddlywiki.css +0 -0
  131. data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/tiddlywiki.js +0 -0
  132. data/app/components/marty/script_form/{javascripts → client}/mode/tiki/index.html +0 -0
  133. data/app/components/marty/script_form/{javascripts → client}/mode/tiki/tiki.css +0 -0
  134. data/app/components/marty/script_form/{javascripts → client}/mode/tiki/tiki.js +0 -0
  135. data/app/components/marty/script_form/{javascripts → client}/mode/vb/LICENSE.txt +0 -0
  136. data/app/components/marty/script_form/{javascripts → client}/mode/vb/index.html +0 -0
  137. data/app/components/marty/script_form/{javascripts → client}/mode/vb/vb.js +0 -0
  138. data/app/components/marty/script_form/{javascripts → client}/mode/vbscript/index.html +0 -0
  139. data/app/components/marty/script_form/{javascripts → client}/mode/vbscript/vbscript.js +0 -0
  140. data/app/components/marty/script_form/{javascripts → client}/mode/velocity/index.html +0 -0
  141. data/app/components/marty/script_form/{javascripts → client}/mode/velocity/velocity.js +0 -0
  142. data/app/components/marty/script_form/{javascripts → client}/mode/verilog/index.html +0 -0
  143. data/app/components/marty/script_form/{javascripts → client}/mode/verilog/verilog.js +0 -0
  144. data/app/components/marty/script_form/{javascripts → client}/mode/xml/index.html +0 -0
  145. data/app/components/marty/script_form/{javascripts → client}/mode/xml/xml.js +0 -0
  146. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/LICENSE +0 -0
  147. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/index.html +0 -0
  148. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/index.html +0 -0
  149. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testBase.js +0 -0
  150. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testEmptySequenceKeyword.js +0 -0
  151. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testMultiAttr.js +0 -0
  152. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testNamespaces.js +0 -0
  153. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testProcessingInstructions.js +0 -0
  154. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testQuotes.js +0 -0
  155. data/app/components/marty/script_form/{javascripts → client}/mode/xquery/xquery.js +0 -0
  156. data/app/components/marty/script_form/{javascripts → client}/mode/yaml/index.html +0 -0
  157. data/app/components/marty/script_form/{javascripts → client}/mode/yaml/yaml.js +0 -0
  158. data/app/components/marty/script_form/{stylesheets → client}/theme/ambiance.css +0 -0
  159. data/app/components/marty/script_form/{stylesheets → client}/theme/blackboard.css +0 -0
  160. data/app/components/marty/script_form/{stylesheets → client}/theme/cobalt.css +0 -0
  161. data/app/components/marty/script_form/{stylesheets → client}/theme/eclipse.css +0 -0
  162. data/app/components/marty/script_form/{stylesheets → client}/theme/elegant.css +0 -0
  163. data/app/components/marty/script_form/{stylesheets → client}/theme/erlang-dark.css +0 -0
  164. data/app/components/marty/script_form/{stylesheets → client}/theme/lesser-dark.css +0 -0
  165. data/app/components/marty/script_form/{stylesheets → client}/theme/monokai.css +0 -0
  166. data/app/components/marty/script_form/{stylesheets → client}/theme/neat.css +0 -0
  167. data/app/components/marty/script_form/{stylesheets → client}/theme/night.css +0 -0
  168. data/app/components/marty/script_form/{stylesheets → client}/theme/rubyblue.css +0 -0
  169. data/app/components/marty/script_form/{stylesheets → client}/theme/vibrant-ink.css +0 -0
  170. data/app/components/marty/script_form/{stylesheets → client}/theme/xq-dark.css +0 -0
  171. data/app/components/marty/script_form/{javascripts → client}/util/closetag.js +0 -0
  172. data/app/components/marty/script_form/{javascripts → client}/util/dialog.css +0 -0
  173. data/app/components/marty/script_form/{javascripts → client}/util/dialog.js +0 -0
  174. data/app/components/marty/script_form/{javascripts → client}/util/foldcode.js +0 -0
  175. data/app/components/marty/script_form/{javascripts → client}/util/formatting.js +0 -0
  176. data/app/components/marty/script_form/{javascripts → client}/util/javascript-hint.js +0 -0
  177. data/app/components/marty/script_form/{javascripts → client}/util/loadmode.js +0 -0
  178. data/app/components/marty/script_form/{javascripts → client}/util/match-highlighter.js +0 -0
  179. data/app/components/marty/script_form/{javascripts → client}/util/multiplex.js +0 -0
  180. data/app/components/marty/script_form/{javascripts → client}/util/overlay.js +0 -0
  181. data/app/components/marty/script_form/{javascripts → client}/util/pig-hint.js +0 -0
  182. data/app/components/marty/script_form/{javascripts → client}/util/runmode-standalone.js +0 -0
  183. data/app/components/marty/script_form/{javascripts → client}/util/runmode.js +0 -0
  184. data/app/components/marty/script_form/{javascripts → client}/util/search.js +0 -0
  185. data/app/components/marty/script_form/{javascripts → client}/util/searchcursor.js +0 -0
  186. data/app/components/marty/script_form/{javascripts → client}/util/simple-hint.css +0 -0
  187. data/app/components/marty/script_form/{javascripts → client}/util/simple-hint.js +0 -0
  188. data/app/components/marty/script_form/{javascripts → client}/util/xml-hint.js +0 -0
  189. data/app/components/marty/script_grid.rb +24 -32
  190. data/app/components/marty/script_tester.rb +11 -11
  191. data/app/components/marty/scripting.rb +12 -12
  192. data/app/components/marty/simple_app.rb +2 -2
  193. data/app/components/marty/simple_app/{javascripts → client}/simple_app.js +0 -0
  194. data/app/components/marty/simple_app/{javascripts → client}/statusbar_ext.js +0 -0
  195. data/app/components/marty/tag_grid.rb +15 -21
  196. data/app/components/marty/user_view.rb +41 -57
  197. data/lib/marty/monkey.rb +1 -1
  198. data/lib/marty/version.rb +1 -1
  199. data/marty.gemspec +3 -2
  200. data/spec/dummy/app/assets/{stylesheets → client}/application.css +0 -0
  201. data/spec/dummy/app/assets/client/application.js +15 -0
  202. data/spec/features/scripting_spec.rb +17 -0
  203. data/spec/features/user_view_spec.rb +15 -15
  204. data/spec/spec_helper.rb +9 -0
  205. metadata +189 -174
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cc0b3b8b64fe73e733f400846ff9e944b1dc113
4
- data.tar.gz: 87db6321d7a7d2117e2b55bea1979bc0a8ac8e2d
3
+ metadata.gz: 8f0f6b19ce2c15e5918e27386f89e6bf83bc3738
4
+ data.tar.gz: 3da45154c7ad5476a9748af3b11ac158bbdf12d6
5
5
  SHA512:
6
- metadata.gz: ec029611b74c122897ad1497d9ff9ab06b68198354ab942e542759b8bbbfb553c37527615749c3eb14d62e6420fa2bb64df28b41c7a1afb41758ba9ccc6fc07c
7
- data.tar.gz: fabfcf96a6a52c4211d0fac59ff573844246ce08f4c752dbe70c339b1c4c041bf84e4354221302b0528a81ea7ff89211ba3840095af0a89fc93f4fb3feecaf94
6
+ metadata.gz: 44bd77724a580c2bd0ea7cbf22db382135dfe8bd4f853a9ca9c5299edfd25daa2f1a79421f4b85accd8364711a4183ccaa844a6c99be710d14b28f5a2cc16a60
7
+ data.tar.gz: 28623145da5a246f826bd5879e2b1c5dab4a39fb73af9e45ce65e48c448dadb8bdb97746b1aacfac38672ef4ef0ef6c98a755238ef3c438730b3dbdb3745afea
data/Gemfile CHANGED
@@ -18,10 +18,11 @@ group :development, :test do
18
18
  gem 'selenium-webdriver'
19
19
  gem 'timecop'
20
20
  gem 'database_cleaner'
21
+
21
22
  gem 'netzke-core'
22
23
  gem 'netzke-basepack'
23
- gem 'netzke-testing' #, path: File.expand_path('../../netzke-testing', __FILE__)
24
+ gem 'netzke-testing'
24
25
 
25
- #gem 'marty_rspec', path: File.expand_path('../../marty_rspec', __FILE__)
26
26
  gem 'marty_rspec'
27
+
27
28
  end
@@ -9,22 +9,19 @@ class Marty::ApiAuthView < Marty::McflyGridPanel
9
9
 
10
10
  c.title = I18n.t('api_auth', default: "API Authorization")
11
11
  c.model = "Marty::ApiAuth"
12
- c.columns = [:app_name, :api_key, :script_name]
13
-
14
- c.enable_extended_search = false
15
-
16
- c.data_store.sorters = {property: :app_name, direction: 'ASC'}
12
+ c.attributes = [:app_name, :api_key, :script_name]
13
+ c.store_config.merge!({sorters: [{property: :app_name, direction: 'ASC'}]})
17
14
  end
18
15
 
19
- column :app_name do |c|
16
+ attribute :app_name do |c|
20
17
  c.flex = 1
21
18
  end
22
19
 
23
- column :api_key do |c|
20
+ attribute :api_key do |c|
24
21
  c.flex = 1
25
22
  end
26
23
 
27
- column :script_name do |c|
24
+ attribute :script_name do |c|
28
25
  c.flex = 1
29
26
  end
30
27
  end
@@ -3,8 +3,8 @@
3
3
  # == Extending Marty::AuthApp
4
4
  # DOCFIX
5
5
  class Marty::AuthApp < Marty::SimpleApp
6
- js_configure do |c|
7
- c.mixin
6
+ client_class do |c|
7
+ c.include :auth_app
8
8
  end
9
9
 
10
10
  # Set the Logout button if current_user is set
@@ -37,20 +37,19 @@ class Marty::AuthApp < Marty::SimpleApp
37
37
  c.text = "Sign out #{Mcfly.whodunnit.name}" if Mcfly.whodunnit
38
38
  end
39
39
 
40
- endpoint :sign_in do |params,this|
40
+ endpoint :sign_in do |params|
41
41
  user = Marty::User.try_to_login(params[:login], params[:password])
42
-
43
42
  if user
44
43
  Netzke::Base.controller.set_user(user)
45
- this.netzke_set_result(true)
44
+ client.netzke_set_result(true)
46
45
  else
47
- this.netzke_set_result(false)
48
- this.netzke_feedback("Wrong credentials")
46
+ client.netzke_set_result(false)
47
+ client.netzke_notify("Wrong credentials")
49
48
  end
50
49
  end
51
50
 
52
- endpoint :sign_out do |params,this|
51
+ endpoint :sign_out do
53
52
  Netzke::Base.controller.logout_user
54
- this.netzke_set_result(true)
53
+ client.netzke_set_result(true)
55
54
  end
56
55
  end
@@ -1,5 +1,5 @@
1
1
  {
2
- onSignIn: function() {
2
+ netzkeOnSignIn: function() {
3
3
  var me = this;
4
4
  this.signinWin = this.signinWin || Ext.create('Ext.Window', {
5
5
  width: 300,
@@ -12,7 +12,7 @@
12
12
  var values = form.getForm().getValues();
13
13
 
14
14
  // calling the endpoint
15
- me.signIn(values, function(res) {
15
+ me.server.signIn(values, function(res) {
16
16
  if (res) {
17
17
  if (!me.authSpecMode) { this.signinWin.close(); }
18
18
  Ext.Msg.show({
@@ -75,8 +75,8 @@
75
75
  this.signinWin.down('textfield').focus(false, 100);
76
76
  },
77
77
 
78
- onSignOut: function() {
79
- this.signOut(null, function(success) {
78
+ netzkeOnSignOut: function() {
79
+ this.server.signOut(null, function(success) {
80
80
  if (success) {
81
81
  Ext.Msg.show({
82
82
  title: "Signed out",
@@ -12,10 +12,9 @@ class Marty::ConfigView < Marty::Grid
12
12
 
13
13
  c.title = I18n.t('config', default: "Config")
14
14
  c.model = "Marty::Config"
15
- c.columns = [:key, :value, :description]
16
-
17
- c.enable_extended_search = false
18
- c.data_store.sorters = {property: :key, direction: 'ASC'}
15
+ c.attributes = [:key, :value, :description]
16
+ c.store_config.merge!({sorters: [{property: :key, direction: 'ASC'}]})
17
+ c.editing = :both
19
18
  end
20
19
 
21
20
  # need a getter / setter to call the []= and [] methods now
@@ -31,7 +30,7 @@ class Marty::ConfigView < Marty::Grid
31
30
  }
32
31
  end
33
32
 
34
- def default_fields_for_forms
33
+ def default_form_items
35
34
  [
36
35
  :key,
37
36
  {
@@ -53,18 +52,17 @@ class Marty::ConfigView < Marty::Grid
53
52
  ]
54
53
  end
55
54
 
56
- column :key do |c|
55
+ attribute :key do |c|
57
56
  c.flex = 1
58
57
  end
59
58
 
60
- column :value do |c|
59
+ attribute :value do |c|
61
60
  c.flex = 3
62
61
  c.getter = my_jsonb_getter
63
62
  c.setter = my_jsonb_setter
64
63
  end
65
- column :description do |c|
64
+ attribute :description do |c|
66
65
  c.flex = 1
67
- c.width = 200
68
66
  end
69
67
 
70
68
  end
@@ -1,6 +1,6 @@
1
1
  module Marty::Extras::Misc
2
2
  MM_OPTIONS = {
3
- editor: {
3
+ editor_config: {
4
4
  trigger_action: :all,
5
5
  xtype: :combo,
6
6
  store: (1..12).map {|x| [x, "%02d" % x]},
@@ -15,4 +15,17 @@ module Marty::Extras::Misc
15
15
  # didn't work.
16
16
  default_value: Date.today.month
17
17
  }
18
+ def self.numberfield_cfg(decimal_places)
19
+ {
20
+ format: "0." + "0"*decimal_places,
21
+ xtype: 'numbercolumn',
22
+ editor_config: { hide_trigger: true,
23
+ decimal_precision: decimal_places },
24
+ field_config: { decimal_precision: decimal_places,
25
+ xtype: :numberfield,
26
+ hide_trigger: true,
27
+ key_nav_enabled: false,
28
+ mouse_wheel_enabled: false }
29
+ }
30
+ end
18
31
  end
@@ -1,4 +1,4 @@
1
1
  # Netzke Form with Marty permissions
2
- class Marty::Form < Netzke::Basepack::Form
2
+ class Marty::Form < Netzke::Form::Base
3
3
  extend ::Marty::Permissions
4
4
  end
@@ -1,9 +1,10 @@
1
- class Marty::Grid < ::Netzke::Basepack::Grid
1
+ class Marty::Grid < ::Netzke::Grid::Base
2
+
2
3
  extend ::Marty::Permissions
3
4
 
4
5
  has_marty_permissions read: :any
5
6
 
6
- def preconfigure_record_window(c)
7
+ def configure_form_window(c)
7
8
  super
8
9
  # Fix Add in form/Edit in form modal popup width
9
10
  # Netzke 0.10.1 defaults width to 80% of screen which is too wide
@@ -12,30 +13,42 @@ class Marty::Grid < ::Netzke::Basepack::Grid
12
13
  c.width = 475
13
14
  end
14
15
 
15
- js_configure do |c|
16
+ client_class do |c|
16
17
  # For some reason the grid update function was removed in Netzke
17
18
  # 0.10.1. So, add it here.
18
- c.cm_update = <<-JS
19
+ c.cm_update = l(<<-JS)
19
20
  function() {
20
21
  this.store.load();
21
22
  }
22
23
  JS
24
+
25
+ end
26
+
27
+ def class_can?(op)
28
+ self.class.can_perform_action?(op)
23
29
  end
24
30
 
25
31
  def configure(c)
26
32
  super
27
33
 
28
- create = self.class.can_perform_action?(:create)
29
- read = self.class.can_perform_action?(:read)
30
- update = self.class.can_perform_action?(:update)
31
- delete = self.class.can_perform_action?(:delete)
34
+ c.permissions = {
35
+ create: class_can?(:create),
36
+ read: class_can?(:read),
37
+ update: class_can?(:update),
38
+ delete: class_can?(:delete)
39
+ }
40
+ c.editing = :both
41
+ c.store_config = {page_size: 30}
42
+ end
32
43
 
33
- c.prohibit_create = !create
34
- c.prohibit_read = !read
35
- c.prohibit_update = !update
36
- c.prohibit_delete = !delete
44
+ def has_search_action?
45
+ false
46
+ end
37
47
 
38
- c.enable_edit_inline = update
39
- c.enable_edit_in_form = update
48
+ def get_json_sorter(json_col, field)
49
+ lambda do |r, dir|
50
+ r.order("#{json_col} ->> '#{field}' " + dir.to_s)
51
+ end
40
52
  end
53
+
41
54
  end
@@ -2,11 +2,9 @@ class Marty::GridAppendOnly < Marty::McflyGridPanel
2
2
  def configure(c)
3
3
  super
4
4
 
5
- c.enable_extended_search = false
6
- c.prohibit_update = true
5
+ c.paging = :pagination
6
+ c.editing = :in_form
7
+ c.permissions[:update] = false
7
8
  end
8
9
 
9
- def default_bbar
10
- [:del, :add_in_form]
11
- end
12
10
  end
@@ -10,7 +10,7 @@ class Marty::ImportTypeView < Marty::Grid
10
10
 
11
11
  c.title = I18n.t('import_type', default: "ImportType")
12
12
  c.model = "Marty::ImportType"
13
- c.columns =
13
+ c.attributes =
14
14
  [
15
15
  :name,
16
16
  :role__name,
@@ -19,33 +19,30 @@ class Marty::ImportTypeView < Marty::Grid
19
19
  :validation_function,
20
20
  :preprocess_function,
21
21
  ]
22
-
23
- c.enable_extended_search = false
24
-
25
- c.data_store.sorters = {property: :name, direction: 'ASC'}
22
+ c.store_config.merge!({sorters: [{property: :name, direction: 'ASC'}]})
26
23
  end
27
24
 
28
- column :name do |c|
25
+ attribute :name do |c|
29
26
  c.flex = 1
30
27
  end
31
28
 
32
- column :role__name do |c|
29
+ attribute :role__name do |c|
33
30
  c.width = 150
34
31
  end
35
32
 
36
- column :db_model_name do |c|
33
+ attribute :db_model_name do |c|
37
34
  c.flex = 1
38
35
  end
39
36
 
40
- column :cleaner_function do |c|
37
+ attribute :cleaner_function do |c|
41
38
  c.flex = 1
42
39
  end
43
40
 
44
- column :validation_function do |c|
41
+ attribute :validation_function do |c|
45
42
  c.flex = 1
46
43
  end
47
44
 
48
- column :preprocess_function do |c|
45
+ attribute :preprocess_function do |c|
49
46
  c.flex = 1
50
47
  end
51
48
  end
@@ -13,8 +13,8 @@
13
13
  #
14
14
 
15
15
  class Marty::LiveSearchGridPanel < Marty::McflyGridPanel
16
- js_configure do |c|
17
- c.listen_fn = <<-JS
16
+ client_class do |c|
17
+ c.listen_fn = l(<<-JS)
18
18
  function(obj, search_text) {
19
19
  var lg = this.ownerCt.ownerCt;
20
20
  lg.getStore().getProxy().extraParams.live_search = search_text;
@@ -39,7 +39,7 @@ class Marty::LiveSearchGridPanel < Marty::McflyGridPanel
39
39
 
40
40
  def get_records(params)
41
41
  search_scope = config[:live_search_scope] || :live_search
42
- data_class.send(search_scope, params && params[:live_search] || '').scoping do
42
+ model.send(search_scope, params && params[:live_search] || '').scoping do
43
43
  super
44
44
  end
45
45
  end
@@ -183,38 +183,36 @@ class Marty::MainAuthApp < Marty::AuthApp
183
183
  a.disabled = Marty::Util.warped? || !self.class.has_posting_perm?
184
184
  end
185
185
 
186
- js_configure do |c|
187
- c.on_new_posting = <<-JS
186
+ client_class do |c|
187
+ c.netzke_on_new_posting = l(<<-JS)
188
188
  function(params) {
189
- this.netzkeLoadComponent({
190
- name: "new_posting_window",
191
- callback: function(w) { w.show(); },
189
+ this.netzkeLoadComponent("new_posting_window",
190
+ { callback: function(w) { w.show(); },
192
191
  });
193
192
  }
194
193
  JS
195
194
 
196
- c.on_select_posting = <<-JS
195
+ c.netzke_on_select_posting = l(<<-JS)
197
196
  function(params) {
198
- this.netzkeLoadComponent({
199
- name: "posting_window",
200
- callback: function(w) { w.show(); },
197
+ this.netzkeLoadComponent("posting_window",
198
+ { callback: function(w) { w.show(); },
201
199
  });
202
200
  }
203
201
  JS
204
202
 
205
- c.on_reload = <<-JS
203
+ c.netzke_on_reload = l(<<-JS)
206
204
  function(params) {
207
205
  window.location.reload();
208
206
  }
209
207
  JS
210
208
 
211
- c.on_select_now = <<-JS
209
+ c.netzke_on_select_now = l(<<-JS)
212
210
  function(params) {
213
- this.serverSelectPosting({});
211
+ this.server.selectPosting({});
214
212
  }
215
213
  JS
216
214
 
217
- c.on_reload_scripts = <<-JS
215
+ c.netzke_on_reload_scripts = l(<<-JS)
218
216
  function(params) {
219
217
  var me = this;
220
218
  Ext.Msg.show({
@@ -224,7 +222,7 @@ class Marty::MainAuthApp < Marty::AuthApp
224
222
  buttons: Ext.Msg.OKCANCEL,
225
223
  prompt: true,
226
224
  fn: function (btn, value) {
227
- btn == "ok" && value == "RELOAD" && me.serverReloadScripts({});
225
+ btn == "ok" && value == "RELOAD" && me.server.reloadScripts({});
228
226
  }
229
227
  });
230
228
  }
@@ -237,13 +235,13 @@ class Marty::MainAuthApp < Marty::AuthApp
237
235
  a.icon = :timeline_marker
238
236
  end
239
237
 
240
- endpoint :server_select_posting do |params, this|
238
+ endpoint :select_posting do |params|
241
239
  sid = params && params[0]
242
240
  Marty::Util.set_posting_id(sid)
243
241
  posting = sid && Marty::Posting.find(sid)
244
242
 
245
- this.netzke_feedback "Selected '#{posting ? posting.name : 'NOW'}'"
246
- this.on_reload 1
243
+ client.netzke_notify "Selected '#{posting ? posting.name : 'NOW'}'"
244
+ client.netzke_on_reload 1
247
245
  end
248
246
 
249
247
  action :select_now do |a|
@@ -270,9 +268,9 @@ class Marty::MainAuthApp < Marty::AuthApp
270
268
  c.disabled = Marty::Util.warped?
271
269
  end
272
270
 
273
- endpoint :server_reload_scripts do |params, this|
271
+ endpoint :reload_scripts do |params|
274
272
  Marty::Script.load_scripts
275
- this.netzke_feedback 'Scripts have been reloaded'
273
+ client.netzke_notify 'Scripts have been reloaded'
276
274
  end
277
275
  end
278
276
 
@@ -4,22 +4,21 @@ class Marty::McflyGridPanel < Marty::Grid
4
4
 
5
5
  warped = Marty::Util.warped?
6
6
 
7
- c.enable_extended_search = false
8
- c.enable_edit_in_form &&= !warped
9
- c.prohibit_update ||= warped
10
- c.prohibit_delete ||= warped
11
- c.prohibit_create ||= warped
12
- #c.prohibit_read ||= !self.class.has_any_perm?
7
+ c.editing = !warped && c.editing || :none
8
+
9
+ [:update, :delete, :create].each do |perm|
10
+ c.permissions[perm] = false if warped
11
+ end
13
12
 
14
13
  # default sort all Mcfly grids with id
15
- c.data_store.sorters ||= {property: :id, direction: 'ASC'}
14
+ c.store_config.merge!({sorters: [{property: :id, direction: 'ASC'}]})
16
15
  end
17
16
 
18
17
  def get_records(params)
19
18
  ts = Mcfly.normalize_infinity(Marty::Util.get_posting_time)
20
- tb = data_class.table_name
19
+ tb = model.table_name
21
20
 
22
- data_class.where("#{tb}.obsoleted_dt >= ? AND #{tb}.created_dt < ?",
21
+ model.where("#{tb}.obsoleted_dt >= ? AND #{tb}.created_dt < ?",
23
22
  ts, ts).scoping do
24
23
  super
25
24
  end
@@ -27,21 +26,20 @@ class Marty::McflyGridPanel < Marty::Grid
27
26
 
28
27
  ######################################################################
29
28
 
30
- def augment_column_config(c)
29
+ def augment_attribute_config(c)
31
30
  super
32
31
 
33
32
  # Set mcfly_scope if the attribute is a mcfly association
34
- if !c[:scope] && data_adapter.association_attr?(c)
33
+ if !c[:scope] && model_adapter.association_attr?(c)
35
34
  assoc_name, assoc_method = c[:name].split('__')
36
35
  begin
37
- aklass = data_class.reflect_on_association(assoc_name.to_sym).klass
36
+ aklass = model.reflect_on_association(assoc_name.to_sym).klass
38
37
  rescue
39
- raise "trouble finding #{assoc_name} assoc class on #{data_class}"
38
+ raise "trouble finding #{assoc_name} assoc class on #{model}"
40
39
  end
41
-
42
40
  c[:scope] = Mcfly.has_mcfly?(aklass) ?
43
41
  self.class.mcfly_scope(assoc_method || 'id') :
44
- self.class.sorted_scope(assoc_method || 'id')
42
+ self.class.sorted_scope(assoc_method || 'id')
45
43
  end
46
44
  end
47
45