netzke-core 1.0.1.0 → 6.5.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5625e5b8c41cdcbe1a42398968f2690302f8a23f
4
- data.tar.gz: 6a9440742423fca06ffa20e3eb303d2d6265b3e8
3
+ metadata.gz: 364a0ced50530abfe4cd40c8476fd1488f38c36f
4
+ data.tar.gz: 9246a6f3e5d5ad641d42676cc90bd1eb48978eb0
5
5
  SHA512:
6
- metadata.gz: a8b1c61d559f9bff94e344741048c30894553013656602a81562664d01571d9e7f124332efa8f30efa944f092a09c0bd3a28ffc8a86242540a3b3f33fe29bdc5
7
- data.tar.gz: 7570d49b12911111e3c1f17bdb1768f82e9bf7dbcdb57f9d8494a3af125e8e5e4112d6bcd2ecfd5964f29ec26096d5b8e0ed442749728541dd874a3074275c99
6
+ metadata.gz: d3d0e972371a38f2c2c091a5f5d398e8c9f0eb66f793e78c68abcc894dc6720cee2bd766b0c1f7b41916e959748ee8bb0f8ae4d1721b0e1060703dd56e95cce2
7
+ data.tar.gz: ec16ea789abd4c62c8a22fb4c6bfb816e927f3a5ed6d4558da0b2ca196c84bdc9ac1701e0c84a2f42e94a4befb6406c1d62a3ad5d55b2a5138264fa4d5ea6d9e
data/CHANGELOG.md CHANGED
@@ -1,128 +1,13 @@
1
- # v1.0.1.0 - 2016-05-01
2
-
3
- * New `Netzke::Core.default_routes` config option.
4
-
5
- # v1.0.0.0 - 2016-01-04
6
-
7
- ## New and improved
8
-
9
- * Routing (see README)
10
-
11
- * Introduce `Base#f` method that defines an inline wrapper for the client-side function that gets called in the scope of the component. This simplifies, for example, specifying handlers for buttons and tools, but also can be used in a few other occasions, where an Ext JS configuration option requires a function. See `spec/rails_app/app/components/actions.rb` for an example.
12
-
13
- * Introduce `Base#l` method that converts the passed string to JSON literal; useful for asigning JS functions inline
14
- (see below).
15
-
16
- * There's no longer need to call `netzke` in routes.rb unless you want to modify routing defaults.
17
-
18
- * The `action` DSL method now also accepts a list of endpoints, e.g.:
19
-
20
- action :do_something, :do_something_else
21
-
22
- * `netzkeNotify` (former `netzkeFeedback`) now accepts the `title` option
23
-
24
- * Calling `callParent` in JS functions from the "mixins" will now properly call the previous override if that was defined; see `spec/rails_app/app/components/js_mixins.rb` for an example.
25
-
26
- ## Breaking changes
27
-
28
- * A component's subfolders for client-class scripts and stylesheets have been consolidated from `javascripts`/`stylesheets` into `client`
29
-
30
- * The client methods for endpoints are now created on the `this.server` object, so, you need to prefix the endpoint calls with `.server`, e.g. `this.server.doSomething()`. For details, see the updated "Client-server interaction" section in the README.
31
-
32
- * `Base#js_configure` has been renamed to `Base#configure_client`
33
-
34
- * `Base.js_configure` has been renamed to `Base.client_class`. There's also no longer need to call it just for the purpose of including the default mixin (which is now `<component_name>/client/<component_name>.js`).
35
-
36
- * Assigning inline JS functions inside the `client_class` (former `js_configure`) block no longer automatically makes a JSON literal
37
- of them; instead, you need to wrap it with the `l` method accessible for all components:
38
-
39
- client_class do |c|
40
- c.netzke_on_refresh = l(<<-JS)
41
- function(){
42
- this.setTitle("Refresh tool clicked");
43
- }
44
- JS
45
- end
46
-
47
- * `Base.css_configure` has been renamed to `Base.client_styles`.
48
-
49
- * The `mixin` method in the former `js_configure` block (now `client_class`) has been renamed to `include`.
50
-
51
- * Changes to endpoints API.
52
-
53
- * Droped the `this` parameter from endpoint block on server side. Instead, use the `client` accessor, implicitely defined for you, for example:
54
-
55
- endpoint :do_something do |arg1|
56
- client.set_title("Recieved #{arg1}")
57
- end
1
+ # v6.5.0.0 - WIP
58
2
 
59
- * Endpoint calls now accept any number of arguments (including zero), with client-side signature matching the server-side `endpoint` block, for example:
3
+ * Support for Ext JS 6.5
4
+ * Support for Rails 5.1
5
+ * New version convention: the first 2 numbers correspond to the major Ext JS and Rails versions respectively.
60
6
 
61
- # server side
62
- endpoint :assign_user do |user_id, table_id|
63
- end
64
-
65
- // client side
66
- this.server.assignUser(userId, tableId)
67
-
68
- ---
69
-
70
- # server side (0 arguments)
71
- endpoint :clear_data do
72
- end
73
-
74
- // client side
75
- this.server.clearData()
76
-
77
- * Whatever endpoint's server-side block returns will become the argument for the client-side callback function, for example:
78
-
79
- # server side
80
- endpoint :get_data do |params|
81
- [1, 2, 3]
82
- end
83
-
84
- // client side
85
- this.server.getData(params, function(result) {
86
- // result equals [1, 2, 3]
87
- })
88
-
89
- * Internal rework of component loading, which also changes some API and behavior.
90
-
91
- * If the loaded component is a window, its `show` method is called after loading. This can be prevented by the callback function returning `false` (which will also prevent other types of loaded components to be inserted into the container).
92
-
93
- * On the client, the `clientConfig` config option has been renamed to `serverConfig`.
94
-
95
- * To specify that a child component is eagerly loaded, the option is moved out of the block into the DSL `component` method parameter (also renamed to `eager_load`):
96
-
97
- # BEFORE
98
- component :foo do |c|
99
- c.eager_loading = true
100
- ...
101
- end
102
-
103
- # NOW
104
- component :foo, eager_load: true do |c|
105
- ...
106
- end
107
-
108
- Unless a component is declared as eagerly loaded, its config is no longer accessible on the client side (which means component is meant to be dynamically loadable).
109
-
110
- * Specifying `bbar` and other toolbars in `configure_client` (former `js_configure`) no longer works. They must now be in the main `configure` method.
111
-
112
- * Default handler name for actions is now prefixed with `netzkeOn` instead of `on`. E.g., for `action :do_something`, the handler
113
- must be called `netzkeOnDoSomething`.
114
-
115
- * `netzkeFeedback` has been renamed to `netzkeNotify`
116
-
117
- * `Core.js_feedback_delay` has been renamed to `Core.client_notification_delay`
118
-
119
- * `onNetzkeSessionExpired` has been renamed to `netzkeOnSessionExpired`
120
-
121
- * Experimental support for HAML removed
122
-
123
- * Drop possibility to list panel tools merely as symbols, as this was too limiting (e.g. Netzke was overriding the handler signature). As of now, use the `Base#f` method to specify the handler (will no longer be automatically set for you); see `spec/rails_app/app/components/tools.rb` for an example.
7
+ # v1.0.1.0 - 2016-05-01
124
8
 
125
- * `Base::Plugin` won't set `this.cmp` for you any longer, but rather receive it as a parameter for `init()`
9
+ * New `Netzke::Core.default_routes` config option.
126
10
 
127
11
  ---
128
- Please check [0-12](https://github.com/netzke/netzke-core/blob/0-12/CHANGELOG.md) for previous changes.
12
+
13
+ Please check [1-0-0](https://github.com/netzke/netzke-core/blob/1-0-0/CHANGELOG.md) for previous changes.
data/Gemfile CHANGED
@@ -2,16 +2,18 @@ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'rails', '~>4.2.0'
5
+ gem 'rails', '~>5.1.0'
6
6
  gem 'sqlite3'
7
7
  gem 'yard'
8
8
  gem 'rake'
9
9
 
10
10
  group :test do
11
11
  gem 'rspec'
12
- gem 'rspec-rails'
12
+ gem 'rspec-rails', '~> 3.5.0'
13
13
  gem 'capybara'
14
- gem 'selenium-webdriver'
14
+ gem 'capybara-selenium'
15
+ gem 'selenium-webdriver', '~> 3.4.4'
16
+ gem 'chromedriver-helper'
15
17
  end
16
18
 
17
19
  group :development do
@@ -20,5 +22,5 @@ end
20
22
 
21
23
  group :development, :test do
22
24
  gem 'pry-rails'
23
- gem 'netzke-testing', github: 'netzke/netzke-testing', branch: 'master'
25
+ gem 'netzke-testing', git: 'https://github.com/netzke/netzke-testing', branch: '6-5-0'
24
26
  end
data/README.md CHANGED
@@ -264,9 +264,9 @@ You can access the instance of the Netzke controller via `Netzke::Base.controlle
264
264
 
265
265
  ## Requirements
266
266
 
267
- * Ruby >= 1.9.3
268
- * Rails ~> 4.2.0
269
- * Ext JS = 5.1.1
267
+ * Ruby >= 2.3.0
268
+ * Rails ~> 5.1.0
269
+ * Ext JS = 6.5.1
270
270
 
271
271
  ## Installation
272
272
 
@@ -317,4 +317,4 @@ If you feel particularily generous, you can support the author by donating a cou
317
317
  * [Twitter](http://twitter.com/netzke) - latest news about the framework
318
318
 
319
319
  ---
320
- Copyright (c) 2009-2016 [Good Bit Labs](http://goodbitlabs.com/), released under the same license as [Ext JS](https://www.sencha.com/legal/#Sencha_Ext_JS)
320
+ Copyright (c) 2009-2017 [Good Bit Labs](http://goodbitlabs.com/), released under the same license as [Ext JS](https://www.sencha.com/legal/#Sencha_Ext_JS)
data/config/routes.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  Rails.application.routes.draw do
2
- if Netzke::Core.default_routes &&
3
- !Rails.application.routes.named_routes.routes[:netzke]
4
- netzke
2
+ if Netzke::Core.default_routes
3
+ netzke unless Rails.application.routes.named_routes.key? :netzke
5
4
  end
6
5
  end
data/javascripts/core.js CHANGED
@@ -25,8 +25,8 @@ Netzke.exception = function(msg) {
25
25
 
26
26
  // Check Ext JS version: both major and minor versions must be the same
27
27
  (function(){
28
- var requiredVersionMajor = 5,
29
- requiredVersionMinor = 1,
28
+ var requiredVersionMajor = 6,
29
+ requiredVersionMinor = 5,
30
30
  extVersion = Ext.getVersion('extjs'),
31
31
  currentVersionMajor = extVersion.getMajor(),
32
32
  currentVersionMinor = extVersion.getMinor(),
@@ -47,7 +47,7 @@ Ext.define('Netzke.Core.Routing', {
47
47
 
48
48
  netzkeTriggerInitialRoute: function(){
49
49
  var initToken = Ext.util.History.getToken();
50
- if (initToken) this.netzkeRouter.redirectTo(initToken, true);
50
+ if (initToken) { this.netzkeRouter.redirectTo(initToken, true); }
51
51
  },
52
52
 
53
53
  netzkeGetRoutes: function(){
@@ -56,8 +56,9 @@ Ext.define('Netzke.Core.Routing', {
56
56
  var handlerName = this.netzkeRoutes[route],
57
57
  handler = this[handlerName];
58
58
  if (!handler) Netzke.exception("Route handler " + handlerName + " is not defined");
59
- out[route] = handler.bind(this);
59
+ out[route] = { action: handler.bind(this) };
60
60
  }
61
61
  return out;
62
62
  }
63
63
  });
64
+
data/lib/netzke/base.rb CHANGED
@@ -12,6 +12,7 @@ require 'netzke/core/actions'
12
12
  require 'netzke/core/session'
13
13
  require 'netzke/core/core_i18n'
14
14
  require 'netzke/core/inheritance'
15
+ require 'netzke/core/support'
15
16
 
16
17
  module Netzke
17
18
  # The base class for every Netzke component. Its main responsibilities include:
@@ -83,7 +84,8 @@ module Netzke
83
84
  @item_id = conf[:item_id] || @name
84
85
 
85
86
  # Make +client_config+ accessible in +configure+ before calling +super+
86
- config.client_config = HashWithIndifferentAccess.new(conf.delete(:client_config))
87
+ client_config = Netzke::Support.permit_hash_params(conf.delete(:client_config))
88
+ config.client_config = HashWithIndifferentAccess.new(client_config)
87
89
 
88
90
  # Build complete component configuration
89
91
  configure(config)
@@ -121,7 +121,13 @@ module Netzke::Core
121
121
  component_name = params[:name].underscore.to_sym
122
122
 
123
123
  item_id = params[:item_id]
124
- cmp_instance = component_instance(component_name, {item_id: item_id, client_config: params[:client_config]})
124
+ cmp_instance = component_instance(
125
+ component_name,
126
+ {
127
+ item_id: item_id,
128
+ client_config: Netzke::Support.permit_hash_params(params[:client_config])
129
+ }
130
+ )
125
131
 
126
132
  if cmp_instance
127
133
  js, css = cmp_instance.js_missing_code(cache), cmp_instance.css_missing_code(cache)
@@ -156,7 +162,7 @@ module Netzke::Core
156
162
  component_name = component_name.to_sym
157
163
 
158
164
  ComponentConfig.new(component_name, self).tap do |cfg|
159
- cfg.client_config = HashWithIndifferentAccess.new(overrides[:client_config])
165
+ cfg.client_config = HashWithIndifferentAccess.new(Netzke::Support.permit_hash_params(overrides[:client_config]))
160
166
  cfg.item_id = overrides[:item_id]
161
167
 
162
168
  if respond_to?(:"#{component_name}_component")
@@ -21,7 +21,7 @@ module Netzke
21
21
  # +true+ otherwise
22
22
  def load_netzke(params = {})
23
23
  params[:minified] = !Rails.env.development? if params[:minified].nil?
24
- params[:theme] ||= "crisp"
24
+ params[:theme] ||= "triton"
25
25
 
26
26
  raw([netzke_html, netzke_css_include(params), netzke_css(params), netzke_js_include(params), netzke_js(params)].join("\n"))
27
27
  end
@@ -71,7 +71,7 @@ module Netzke
71
71
  # Link tags for all the required stylsheets
72
72
  def netzke_css_include(params)
73
73
  # ExtJS base
74
- res = ["#{Netzke::Core.ext_uri}/packages/ext-theme-#{params[:theme]}/build/resources/ext-theme-#{params[:theme]}-all.css"]
74
+ res = ["#{Netzke::Core.ext_uri}/build/classic/theme-#{params[:theme]}/resources/theme-#{params[:theme]}-all.css"]
75
75
 
76
76
  # Netzke-related dynamic css
77
77
  res << netzke_ext_path
@@ -97,7 +97,7 @@ module Netzke
97
97
  res << (params[:minified] ? "#{Netzke::Core.ext_uri}/build/ext-all.js" : "#{Netzke::Core.ext_uri}/build/ext-all-debug.js")
98
98
 
99
99
  # Ext I18n
100
- res << "#{Netzke::Core.ext_uri}/packages/ext-locale/build/ext-locale-#{I18n.locale}" if I18n.locale != :en
100
+ res << "#{Netzke::Core.ext_uri}/build/classic/locale/locale-#{I18n.locale}" if I18n.locale != :en
101
101
 
102
102
  # Netzke-related dynamic JavaScript
103
103
  res << netzke_ext_path
@@ -33,14 +33,14 @@ module Netzke
33
33
 
34
34
  # raw arguments from the client
35
35
  def remoting_args
36
- @_remoting_args ||= HashWithIndifferentAccess.new(@params.to_hash)[:data]
36
+ @_remoting_args ||= HashWithIndifferentAccess.new(data: @params[:data])[:data]
37
37
  end
38
38
  end
39
39
 
40
40
  extend ActiveSupport::Concern
41
41
 
42
42
  included do
43
- send(:before_filter, :set_controller_and_session)
43
+ send(:before_action, :set_controller_and_session)
44
44
  end
45
45
 
46
46
  module ClassMethods
@@ -63,18 +63,18 @@ module Netzke
63
63
  response = direct_response(direct_request, invoke_endpoint(direct_request))
64
64
  end
65
65
 
66
- render text: response.to_json, layout: false
66
+ render plain: response.to_json, layout: false
67
67
  end
68
68
 
69
69
  # On-the-fly generation of public/netzke/ext.[js|css]
70
70
  def ext
71
71
  respond_to do |format|
72
72
  format.js {
73
- render :text => Netzke::Core::DynamicAssets.ext_js(form_authenticity_token)
73
+ render js: Netzke::Core::DynamicAssets.ext_js(form_authenticity_token)
74
74
  }
75
75
 
76
76
  format.css {
77
- render :text => Netzke::Core::DynamicAssets.ext_css
77
+ render html: Netzke::Core::DynamicAssets.ext_css, content_type: 'text/css'
78
78
  }
79
79
  end
80
80
  end
@@ -124,9 +124,9 @@ module Netzke
124
124
  cmp_config[:client_config] = ActiveSupport::JSON.decode(params[:configs]).shift || {}
125
125
  component_instance = Netzke::Base.instance_by_config(cmp_config)
126
126
 
127
- render text: component_instance.invoke_endpoint(sub_components.join("__"), [params]).netzke_jsonify.to_json, layout: false
127
+ render plain: component_instance.invoke_endpoint(sub_components.join("__"), [params]).netzke_jsonify.to_json, layout: false
128
128
  else
129
- render text: { netzke_on_session_expired: [] }.to_json, layout: false
129
+ render plain: { netzke_on_session_expired: [] }.to_json, layout: false
130
130
  end
131
131
  end
132
132
 
@@ -0,0 +1,7 @@
1
+ module Netzke::Support
2
+ def self.permit_hash_params(params)
3
+ return params unless params
4
+ return params unless params.respond_to? :to_unsafe_h
5
+ params.to_unsafe_h
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  module Netzke
2
2
  module Core
3
- VERSION = "1.0.1.0"
3
+ VERSION = "6.5.0.0.rc1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netzke-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1.0
4
+ version: 6.5.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Gorin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-01 00:00:00.000000000 Z
11
+ date: 2017-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uglifier
@@ -106,6 +106,7 @@ files:
106
106
  - lib/netzke/core/session.rb
107
107
  - lib/netzke/core/state.rb
108
108
  - lib/netzke/core/stylesheets.rb
109
+ - lib/netzke/core/support.rb
109
110
  - lib/netzke/core/version.rb
110
111
  - lib/netzke/plugin.rb
111
112
  - lib/tasks/netzke_core_tasks.rake
@@ -131,9 +132,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
132
  version: 1.3.4
132
133
  requirements: []
133
134
  rubyforge_project:
134
- rubygems_version: 2.5.1
135
+ rubygems_version: 2.5.2
135
136
  signing_key:
136
137
  specification_version: 4
137
138
  summary: Client-server UI components with Sencha Ext JS and Ruby on Rails
138
139
  test_files: []
139
- has_rdoc: