netzke-core 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +16 -1
- data/Gemfile +12 -0
- data/README.md +22 -15
- data/Rakefile +19 -38
- data/app/controllers/netzke_controller.rb +1 -79
- data/javascripts/ext.js +17 -13
- data/lib/netzke/base.rb +6 -2
- data/lib/netzke/core/action_config.rb +7 -0
- data/lib/netzke/core/actions.rb +6 -32
- data/lib/netzke/core/client_class.rb +1 -1
- data/lib/netzke/core/component_config.rb +1 -1
- data/lib/netzke/core/composition.rb +17 -111
- data/lib/netzke/core/config_to_dsl_delegator.rb +0 -7
- data/lib/netzke/core/configuration.rb +48 -0
- data/lib/netzke/core/dsl_support.rb +71 -0
- data/lib/netzke/core/dynamic_assets.rb +10 -1
- data/lib/netzke/core/embedding.rb +2 -2
- data/lib/netzke/core/html.rb +29 -0
- data/lib/netzke/core/javascript.rb +32 -26
- data/lib/netzke/core/railz/action_view_ext/ext.rb +2 -2
- data/lib/netzke/core/railz/controller_extensions.rb +96 -3
- data/lib/netzke/core/railz/routes.rb +14 -3
- data/lib/netzke/core/ruby_ext/array.rb +4 -18
- data/lib/netzke/core/ruby_ext/hash.rb +19 -25
- data/lib/netzke/core/ruby_ext/time_with_zone.rb +1 -1
- data/lib/netzke/core/ruby_ext.rb +0 -2
- data/lib/netzke/core/session.rb +8 -1
- data/lib/netzke/core/state.rb +3 -3
- data/lib/netzke/core/version.rb +1 -1
- data/lib/netzke/core.rb +15 -7
- data/lib/netzke-core.rb +2 -9
- data/tasks/app_test_tasks.rake +94 -0
- data/tasks/rake_helper.rb +51 -0
- data/test/core_test_app/README +2 -2
- data/test/core_test_app/app/assets/javascripts/expect/expect.js +1253 -0
- data/test/core_test_app/app/assets/javascripts/mocha/mocha.js +5340 -0
- data/test/core_test_app/app/assets/stylesheets/mocha/mocha.css +231 -0
- data/test/core_test_app/app/components/{component_with_actions.rb → actions.rb} +7 -9
- data/test/core_test_app/app/components/{some_composite.rb → composition.rb} +16 -5
- data/test/core_test_app/app/components/{component_with_custom_css → css_inclusion}/stylesheets/custom.css +2 -2
- data/test/core_test_app/app/components/css_inclusion.rb +12 -0
- data/test/core_test_app/app/components/{component_loader/javascripts/component_loader.js → dynamic_loading/javascripts/dynamic_loading.js} +9 -1
- data/test/core_test_app/app/components/{component_loader.rb → dynamic_loading.rb} +12 -5
- data/test/core_test_app/app/components/{server_caller/javascripts/server_caller.js → endpoints/javascripts/endpoints.js} +10 -6
- data/test/core_test_app/app/components/{server_caller.rb → endpoints.rb} +12 -8
- data/test/core_test_app/app/components/{extended_server_caller.rb → endpoints_extended.rb} +6 -4
- data/test/core_test_app/app/components/ext_direct/composite.rb +5 -1
- data/test/core_test_app/app/components/feedback.rb +26 -0
- data/test/core_test_app/app/components/haml_panel/html/body.html.haml +10 -0
- data/test/core_test_app/app/components/haml_panel/html/server_response.html.haml +3 -0
- data/test/core_test_app/app/components/haml_panel.rb +32 -0
- data/test/core_test_app/app/components/hello_world.rb +1 -0
- data/test/core_test_app/app/components/js_inclusion/javascripts/extra_one.js +2 -0
- data/test/core_test_app/app/components/js_inclusion/javascripts/extra_two.js +2 -0
- data/test/core_test_app/app/components/js_inclusion/javascripts/js_inclusion.js +5 -0
- data/test/core_test_app/app/components/{component_with_js_mixin → js_inclusion}/javascripts/method_set_one.js +0 -0
- data/test/core_test_app/app/components/{component_with_js_mixin → js_inclusion}/javascripts/method_set_two.js +0 -0
- data/test/core_test_app/app/components/{component_with_js_mixin.rb → js_inclusion.rb} +3 -3
- data/test/core_test_app/app/components/js_inclusion_extended/javascripts/some_method_set.js +5 -0
- data/test/core_test_app/app/components/js_inclusion_extended.rb +6 -0
- data/test/core_test_app/app/components/loaded_css_inclusion.rb +22 -0
- data/test/core_test_app/app/components/{localized_panel.rb → localization.rb} +5 -5
- data/test/core_test_app/app/components/localization_extended.rb +2 -0
- data/test/core_test_app/app/components/persistence.rb +60 -0
- data/test/core_test_app/app/components/persistence_with_shared_state.rb +7 -0
- data/test/core_test_app/app/components/plugin_with_actions.rb +24 -0
- data/test/core_test_app/app/components/plugin_with_components.rb +3 -3
- data/test/core_test_app/app/components/plugin_with_endpoints.rb +29 -0
- data/test/core_test_app/app/components/plugins.rb +9 -0
- data/test/core_test_app/app/components/{kinda_complex_component → ruby_modules}/basic_stuff.rb +1 -1
- data/test/core_test_app/app/components/{kinda_complex_component → ruby_modules}/extra_stuff.rb +3 -3
- data/test/core_test_app/app/components/{kinda_complex_component.rb → ruby_modules.rb} +1 -1
- data/test/core_test_app/app/components/scoped/deeply_scoped/scoping.rb +10 -0
- data/test/core_test_app/app/components/scoped/scoping.rb +8 -0
- data/test/core_test_app/app/components/scoped/scoping_extended.rb +8 -0
- data/test/core_test_app/app/components/self_reloading.rb +25 -0
- data/test/core_test_app/app/components/server_counter/javascripts/server_counter.js +4 -4
- data/test/core_test_app/app/components/server_counter.rb +10 -10
- data/test/core_test_app/app/components/simple_authentication_component.rb +1 -0
- data/test/core_test_app/app/components/simple_component.rb +0 -4
- data/test/core_test_app/app/components/simple_composite.rb +1 -1
- data/test/core_test_app/app/components/simple_form_with_file_upload.rb +1 -2
- data/test/core_test_app/app/components/simple_tab_panel.rb +5 -3
- data/test/core_test_app/app/components/{panel_with_tools.rb → tools.rb} +3 -3
- data/test/core_test_app/app/components/window_with_simple_component.rb +1 -0
- data/test/core_test_app/app/controllers/alternative_controller.rb +10 -0
- data/test/core_test_app/app/controllers/specs_controller.rb +11 -0
- data/test/core_test_app/app/views/layouts/application.html.erb +19 -1
- data/test/core_test_app/app/views/simple_rails/multiple_nested.html.erb +2 -2
- data/test/core_test_app/config/boot.rb +3 -10
- data/test/core_test_app/config/environments/development.rb +1 -0
- data/test/core_test_app/config/initializers/netzke.rb +4 -1
- data/test/core_test_app/config/locales/en.yml +11 -4
- data/test/core_test_app/config/locales/es.yml +1 -4
- data/test/core_test_app/config/routes.rb +10 -1
- data/test/core_test_app/core_test_app.tmproj +254 -0
- data/test/core_test_app/db/development.sqlite3 +0 -0
- data/test/core_test_app/{lib/tasks/.gitkeep → db/test.sqlite3} +0 -0
- data/test/core_test_app/log/development.log +78046 -0
- data/test/core_test_app/log/production.log +18 -0
- data/test/core_test_app/log/test.log +120048 -0
- data/test/core_test_app/rails_app.tmproj +324 -0
- data/test/core_test_app/tmp/cache/assets/C8B/BF0/sprockets%2F54de2792b036d1dab855f88599503551 +0 -0
- data/test/core_test_app/tmp/cache/assets/C92/5A0/sprockets%2F39e75754782ee12179bf35c9a0971d80 +0 -0
- data/test/core_test_app/tmp/cache/assets/C99/720/sprockets%2F981d5a1b957a012e380b22011a6d176d +0 -0
- data/test/core_test_app/tmp/cache/assets/C9F/750/sprockets%2F20ce3d64040a5d3a0a8883bd60754356 +0 -0
- data/test/core_test_app/tmp/cache/assets/CC4/C00/sprockets%2Fc615df52887d8c2e67e8413576a419c5 +0 -0
- data/test/core_test_app/tmp/cache/assets/CF1/3F0/sprockets%2Fc69ee42924fab565a3533d56473ce878 +0 -0
- data/test/core_test_app/tmp/cache/assets/D0E/870/sprockets%2Fa593bf4fac106add88c9434141a49663 +0 -0
- data/test/core_test_app/tmp/cache/assets/D14/8E0/sprockets%2F20748e8d1d7d090d122904a9fe6f18fc +0 -0
- data/test/core_test_app/tmp/cache/assets/D3E/DA0/sprockets%2Fa175f1ac5996544b908ba3ba3f64c4f3 +0 -0
- data/test/core_test_app/tmp/cache/assets/D43/C00/sprockets%2F7bc60c758776356d615ab5edff201ee2 +0 -0
- data/test/core_test_app/tmp/cache/assets/D4B/C50/sprockets%2F8483b7e322da338e8f9eb3b30a957e9a +0 -0
- data/test/core_test_app/tmp/cache/assets/D64/090/sprockets%2F5a01ff309c3f2503eb5e4f5667cca4b3 +0 -0
- data/test/core_test_app/tmp/cache/assets/D8B/FB0/sprockets%2F7a86225caaa389f1be600b4f3a2d1ef0 +0 -0
- data/test/core_test_app/tmp/cache/assets/D98/9C0/sprockets%2F18b80e8fe200aebc522e561a867ea6fb +0 -0
- data/test/core_test_app/tmp/cache/assets/DB0/6E0/sprockets%2F03e33f5a4779eeb48bcfc86ee717fb55 +0 -0
- data/test/core_test_app/tmp/cache/assets/DED/7E0/sprockets%2Feaedd52ba538f19e4ab543a3e20ce2c4 +0 -0
- data/test/core_test_app/tmp/cache/assets/E07/FF0/sprockets%2Fb3c071e0a6de36f041adbbdaa8ab060b +0 -0
- data/test/core_test_app/tmp/capybara/capybara-20101214105940.html +40 -0
- data/test/core_test_app/tmp/capybara/capybara-20101214110642.html +40 -0
- data/test/core_test_app/tmp/capybara/capybara-20101214110749.html +40 -0
- data/test/core_test_app/tmp/capybara/capybara-20101214110750.html +40 -0
- data/test/core_test_app/tmp/capybara/capybara-20101214111025.html +40 -0
- data/test/core_test_app/tmp/capybara/capybara-20101214111027.html +40 -0
- data/test/core_test_app/tmp/capybara/capybara-20101214111213.html +40 -0
- data/test/core_test_app/tmp/capybara/capybara-20101214111214.html +40 -0
- data/test/core_test_app/tmp/capybara/capybara-20101214111332.html +40 -0
- data/test/core_test_app/tmp/capybara/capybara-20101214111333.html +40 -0
- data/test/core_test_app/{spec/component → tmp/pids/passenger.3000.pid.lock} +0 -0
- metadata +370 -133
- data/.autotest +0 -1
- data/.travis.yml +0 -18
- data/Manifest +0 -50
- data/config/ci/before-travis.sh +0 -10
- data/install.rb +0 -1
- data/lib/netzke/core/options_hash.rb +0 -27
- data/lib/netzke/core/ruby_ext/string.rb +0 -26
- data/lib/netzke/core/ruby_ext/symbol.rb +0 -13
- data/netzke-core.gemspec +0 -253
- data/test/core_test_app/.gitignore +0 -4
- data/test/core_test_app/.powrc +0 -4
- data/test/core_test_app/.rvmrc +0 -1
- data/test/core_test_app/Gemfile +0 -19
- data/test/core_test_app/Gemfile.lock +0 -147
- data/test/core_test_app/app/components/border_layout_panel.rb +0 -4
- data/test/core_test_app/app/components/card_component_loader.rb +0 -25
- data/test/core_test_app/app/components/component_with_custom_css.rb +0 -11
- data/test/core_test_app/app/components/component_with_js_mixin/javascripts/component_with_js_mixin.js +0 -5
- data/test/core_test_app/app/components/component_with_js_mixin/javascripts/extra_one.js +0 -2
- data/test/core_test_app/app/components/component_with_js_mixin/javascripts/extra_two.js +0 -2
- data/test/core_test_app/app/components/component_with_nested_through.rb +0 -28
- data/test/core_test_app/app/components/component_with_required_js.rb +0 -24
- data/test/core_test_app/app/components/dsl_delegated_properties.rb +0 -4
- data/test/core_test_app/app/components/dsl_delegated_properties_base.rb +0 -5
- data/test/core_test_app/app/components/extended_component_with_actions.rb +0 -9
- data/test/core_test_app/app/components/extended_component_with_js_mixin/javascripts/some_method_set.js +0 -5
- data/test/core_test_app/app/components/extended_component_with_js_mixin.rb +0 -10
- data/test/core_test_app/app/components/extended_localized_panel.rb +0 -2
- data/test/core_test_app/app/components/included.js +0 -5
- data/test/core_test_app/app/components/inline_composite.rb +0 -13
- data/test/core_test_app/app/components/loader_of_component_with_custom_css.rb +0 -23
- data/test/core_test_app/app/components/multipane_component_loader.rb +0 -41
- data/test/core_test_app/app/components/nested_component.rb +0 -17
- data/test/core_test_app/app/components/panel_with_plugin.rb +0 -9
- data/test/core_test_app/app/components/scoped_components/deep_scoped_components/some_deep_scoped_component.rb +0 -10
- data/test/core_test_app/app/components/scoped_components/extended_scoped_component.rb +0 -8
- data/test/core_test_app/app/components/scoped_components/some_scoped_component.rb +0 -8
- data/test/core_test_app/app/components/some_ext_component.rb +0 -8
- data/test/core_test_app/app/components/some_plugin.rb +0 -40
- data/test/core_test_app/app/components/stateful_component.rb +0 -46
- data/test/core_test_app/app/components/stateful_component_with_shared_state.rb +0 -11
- data/test/core_test_app/config/database.yml.travis +0 -11
- data/test/core_test_app/db/schema.rb +0 -29
- data/test/core_test_app/features/actions_and_tools.feature +0 -22
- data/test/core_test_app/features/basic.feature +0 -7
- data/test/core_test_app/features/client-server.feature +0 -19
- data/test/core_test_app/features/complex_component.feature +0 -18
- data/test/core_test_app/features/component.feature +0 -10
- data/test/core_test_app/features/component_loader.feature +0 -52
- data/test/core_test_app/features/composition.feature +0 -45
- data/test/core_test_app/features/config_to_dsl_delegation.feature +0 -10
- data/test/core_test_app/features/custom_css.feature +0 -17
- data/test/core_test_app/features/ext.direct.feature +0 -32
- data/test/core_test_app/features/file_inclusion.feature +0 -10
- data/test/core_test_app/features/i18n.feature +0 -35
- data/test/core_test_app/features/inheritance.feature +0 -18
- data/test/core_test_app/features/js_include.feature +0 -20
- data/test/core_test_app/features/nested_views.feature +0 -10
- data/test/core_test_app/features/persistence.feature +0 -34
- data/test/core_test_app/features/plugin.feature +0 -16
- data/test/core_test_app/features/rails_views.feature +0 -16
- data/test/core_test_app/features/scopes.feature +0 -14
- data/test/core_test_app/features/step_definitions/custom_css_steps.rb +0 -7
- data/test/core_test_app/features/step_definitions/generic_steps.rb +0 -64
- data/test/core_test_app/features/step_definitions/web_steps.rb +0 -219
- data/test/core_test_app/features/support/env.rb +0 -58
- data/test/core_test_app/features/support/paths.rb +0 -42
- data/test/core_test_app/spec/action_config_spec.rb +0 -15
- data/test/core_test_app/spec/actions_spec.rb +0 -96
- data/test/core_test_app/spec/base_spec.rb +0 -35
- data/test/core_test_app/spec/client_class_spec.rb +0 -17
- data/test/core_test_app/spec/composition_spec.rb +0 -118
- data/test/core_test_app/spec/core_ext_spec.rb +0 -27
- data/test/core_test_app/spec/endpoint_response_spec.rb +0 -17
- data/test/core_test_app/spec/javascript_spec.rb +0 -33
- data/test/core_test_app/spec/js_class_config_scope.rb +0 -37
- data/test/core_test_app/spec/panel_spec.rb +0 -11
- data/test/core_test_app/spec/services_spec.rb +0 -16
- data/test/core_test_app/spec/spec.opt +0 -2
- data/test/core_test_app/spec/spec_helper.rb +0 -27
- data/test/core_test_app/spec/state_spec.rb +0 -20
- data/test/core_test_app/vendor/plugins/.gitkeep +0 -0
- data/test/unit/core_ext_test.rb +0 -8
- data/test/unit/netzke_core_test.rb +0 -178
- data/uninstall.rb +0 -1
@@ -1,24 +0,0 @@
|
|
1
|
-
class ComponentWithRequiredJs < Netzke::Base
|
2
|
-
class_attribute :title
|
3
|
-
self.title = "My title"
|
4
|
-
|
5
|
-
js_configure do |c|
|
6
|
-
c.require "#{File.dirname(__FILE__)}/included.js"
|
7
|
-
c.extend = "Netzke.ComponentWithRequiredJs" # defined in required file
|
8
|
-
c.on_print_message = <<-JS
|
9
|
-
function(){
|
10
|
-
this.updateBodyWithMessage("Some message " + "shown in the body");
|
11
|
-
}
|
12
|
-
JS
|
13
|
-
|
14
|
-
c.active_tab = 0
|
15
|
-
c.title = title
|
16
|
-
end
|
17
|
-
|
18
|
-
action :print_message
|
19
|
-
|
20
|
-
def configure(c)
|
21
|
-
super
|
22
|
-
c.bbar = [:print_message]
|
23
|
-
end
|
24
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# A composite component which has its child components defined inline (as opposed to a using the "component" DSL method explicitely)
|
2
|
-
class InlineComposite < Netzke::Base
|
3
|
-
js_property :layout, :vbox
|
4
|
-
|
5
|
-
# Set width for all
|
6
|
-
js_property :defaults, {:width => "100%", :flex => 1}
|
7
|
-
|
8
|
-
items [{
|
9
|
-
:class_name => "ServerCaller"
|
10
|
-
},{
|
11
|
-
:class_name => "ExtendedServerCaller"
|
12
|
-
}]
|
13
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# Loads a component with custom CSS, to make sure that also dynamically loaded components get the correct CSS applied
|
2
|
-
class LoaderOfComponentWithCustomCss < Netzke::Base
|
3
|
-
component :component_with_custom_css do |c|
|
4
|
-
c.klass = ComponentWithCustomCss
|
5
|
-
end
|
6
|
-
|
7
|
-
action :load_component_with_custom_css
|
8
|
-
|
9
|
-
def configure(c)
|
10
|
-
super
|
11
|
-
c.title = "LoaderOfComponentWithCustomCss"
|
12
|
-
c.layout = :fit
|
13
|
-
c.bbar = [:load_component_with_custom_css]
|
14
|
-
end
|
15
|
-
|
16
|
-
js_configure do |c|
|
17
|
-
c.on_load_component_with_custom_css = <<-JS
|
18
|
-
function(params){
|
19
|
-
this.netzkeLoadComponent({name: 'component_with_custom_css', container: this});
|
20
|
-
}
|
21
|
-
JS
|
22
|
-
end
|
23
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
class MultipaneComponentLoader < Netzke::Base
|
2
|
-
js_property :layout, {:type => :hbox, :align => :stretch}
|
3
|
-
js_property :prevent_header, true
|
4
|
-
|
5
|
-
action :load_server_caller, :handler => :load_handler
|
6
|
-
action :load_component_loader, :handler => :load_handler
|
7
|
-
|
8
|
-
def configure(c)
|
9
|
-
super
|
10
|
-
c.items = [{
|
11
|
-
:title => "Container One",
|
12
|
-
:xtype => :panel,
|
13
|
-
:height => 200,
|
14
|
-
:flex => 1,
|
15
|
-
:border => true,
|
16
|
-
:bbar => [:load_server_caller, :load_component_loader],
|
17
|
-
:layout => :fit
|
18
|
-
},{
|
19
|
-
:title => "Container Two",
|
20
|
-
:xtype => :panel,
|
21
|
-
:height => 200,
|
22
|
-
:flex => 1,
|
23
|
-
:layout => :fit
|
24
|
-
}]
|
25
|
-
end
|
26
|
-
|
27
|
-
component :server_caller
|
28
|
-
|
29
|
-
js_method :load_handler, <<-JS
|
30
|
-
function(button){
|
31
|
-
var container = button.ownerCt.ownerCt;
|
32
|
-
this.netzkeLoadComponent({name: 'server_caller', container: container});
|
33
|
-
}
|
34
|
-
JS
|
35
|
-
|
36
|
-
def deliver_component_endpoint(params)
|
37
|
-
sleep 1 # for visual evaluation
|
38
|
-
super
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# FIXME
|
2
|
-
class NestedComponent < Netzke::Base
|
3
|
-
js_property :layout, :fit
|
4
|
-
|
5
|
-
def configure(c)
|
6
|
-
c.items = [:child.component]
|
7
|
-
end
|
8
|
-
|
9
|
-
component :child,
|
10
|
-
:class_name => "SimpleComponent",
|
11
|
-
:layout => 'accordion',
|
12
|
-
:items => [:grand_child_one.component, :grand_child_two.component],
|
13
|
-
:components => {
|
14
|
-
:grand_child_one => {:class_name => "SimpleComponent", :title => "Grand Child One"},
|
15
|
-
:grand_child_two => {:class_name => "NestedComponent", :title => "Grand Child Two", :lazy_loading => true}
|
16
|
-
}
|
17
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
module ScopedComponents
|
2
|
-
module DeepScopedComponents
|
3
|
-
class SomeDeepScopedComponent < ScopedComponents::SomeScopedComponent
|
4
|
-
js_configure do |c|
|
5
|
-
c.title = "Some Deep Scoped Component Title"
|
6
|
-
c.html = "Some Deep Scoped Component HTML"
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
class SomePlugin < Netzke::Plugin
|
2
|
-
action :action_one
|
3
|
-
|
4
|
-
js_configure do |c|
|
5
|
-
c.init = <<-JS
|
6
|
-
function(){
|
7
|
-
this.callParent(arguments);
|
8
|
-
this.cmp.tools = [{id: 'gear', handler: this.onGear, scope: this}];
|
9
|
-
|
10
|
-
this.cmp.addDocked({
|
11
|
-
dock: 'bottom',
|
12
|
-
xtype: 'toolbar',
|
13
|
-
items: [this.actions.actionOne]
|
14
|
-
});
|
15
|
-
}
|
16
|
-
JS
|
17
|
-
|
18
|
-
c.on_action_one = <<-JS
|
19
|
-
function(){
|
20
|
-
this.cmp.setTitle('Action one ' + 'triggered');
|
21
|
-
}
|
22
|
-
JS
|
23
|
-
|
24
|
-
c.on_gear = <<-JS
|
25
|
-
function(){
|
26
|
-
this.processGear();
|
27
|
-
}
|
28
|
-
JS
|
29
|
-
|
30
|
-
c.process_gear_callback = <<-JS
|
31
|
-
function(newTitle){
|
32
|
-
this.cmp.setTitle(newTitle);
|
33
|
-
}
|
34
|
-
JS
|
35
|
-
end
|
36
|
-
|
37
|
-
endpoint :process_gear do |params, this|
|
38
|
-
this.process_gear_callback("Server response")
|
39
|
-
end
|
40
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# Shows how component session and state can be used for persistence
|
2
|
-
class StatefulComponent < Netzke::Base
|
3
|
-
action :set_session_data do |a|
|
4
|
-
a.text = "Set session and state"
|
5
|
-
end
|
6
|
-
|
7
|
-
action :reset_session_data do |a|
|
8
|
-
a.text = "Reset session and state"
|
9
|
-
end
|
10
|
-
|
11
|
-
def configure(c)
|
12
|
-
super
|
13
|
-
c.persistence = true
|
14
|
-
c.bbar = [:set_session_data, :reset_session_data]
|
15
|
-
|
16
|
-
# title will be gotten from component's state
|
17
|
-
c.title = state[:title] || "Default Title"
|
18
|
-
|
19
|
-
# body content will be stored directly in component's session
|
20
|
-
c.html = component_session[:html_content] || "Default HTML"
|
21
|
-
end
|
22
|
-
|
23
|
-
js_configure do |c|
|
24
|
-
c.on_set_session_data = <<-JS
|
25
|
-
function(){
|
26
|
-
this.serverSetSessionData();
|
27
|
-
}
|
28
|
-
JS
|
29
|
-
|
30
|
-
c.on_reset_session_data = <<-JS
|
31
|
-
function(){
|
32
|
-
this.serverResetSessionData();
|
33
|
-
}
|
34
|
-
JS
|
35
|
-
end
|
36
|
-
|
37
|
-
endpoint :server_set_session_data do |params, this|
|
38
|
-
component_session[:html_content] = "HTML from session"
|
39
|
-
state[:title] = "Title From State"
|
40
|
-
end
|
41
|
-
|
42
|
-
endpoint :server_reset_session_data do |params,this|
|
43
|
-
component_session.clear
|
44
|
-
state.clear
|
45
|
-
end
|
46
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# This component shares state with StatefulComponent by setting +persistence_key+ to that component's js_id (which is used as persestence_key by default)
|
2
|
-
class StatefulComponentWithSharedState < Netzke::Base
|
3
|
-
def configure(c)
|
4
|
-
super
|
5
|
-
c.persistence = true
|
6
|
-
c.persistence_key = :stateful_component
|
7
|
-
|
8
|
-
# title will be gotten from component's state
|
9
|
-
c.title = state[:title] || "Default Title"
|
10
|
-
end
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# Warning: The database defined as "test" will be erased and
|
2
|
-
# re-generated from your development database when you run "rake".
|
3
|
-
# Do not set this db to the same as development or production.
|
4
|
-
test: &test
|
5
|
-
adapter: sqlite3
|
6
|
-
database: db/test.sqlite3
|
7
|
-
pool: 5
|
8
|
-
timeout: 5000
|
9
|
-
|
10
|
-
cucumber:
|
11
|
-
<<: *test
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# This file is auto-generated from the current state of the database. Instead
|
3
|
-
# of editing this file, please use the migrations feature of Active Record to
|
4
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
-
#
|
6
|
-
# Note that this schema.rb definition is the authoritative source for your
|
7
|
-
# database schema. If you need to create the application database on another
|
8
|
-
# system, you should be using db:schema:load, not running all the migrations
|
9
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
-
#
|
12
|
-
# It's strongly recommended to check this file into your version control system.
|
13
|
-
|
14
|
-
ActiveRecord::Schema.define(:version => 20110110132720) do
|
15
|
-
|
16
|
-
create_table "netzke_component_states", :force => true do |t|
|
17
|
-
t.string "component"
|
18
|
-
t.integer "user_id"
|
19
|
-
t.integer "role_id"
|
20
|
-
t.text "value"
|
21
|
-
t.datetime "created_at", :null => false
|
22
|
-
t.datetime "updated_at", :null => false
|
23
|
-
end
|
24
|
-
|
25
|
-
add_index "netzke_component_states", ["component"], :name => "index_netzke_component_states_on_component"
|
26
|
-
add_index "netzke_component_states", ["role_id"], :name => "index_netzke_component_states_on_role_id"
|
27
|
-
add_index "netzke_component_states", ["user_id"], :name => "index_netzke_component_states_on_user_id"
|
28
|
-
|
29
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
Feature: Actions
|
2
|
-
In order to value
|
3
|
-
As a role
|
4
|
-
I want feature
|
5
|
-
|
6
|
-
@javascript
|
7
|
-
Scenario: Pressing button should result in corresponding actions
|
8
|
-
When I go to the ComponentWithActions test page
|
9
|
-
Then I should not see "Excluded action"
|
10
|
-
Then I should see "Disabled action"
|
11
|
-
And button "Disabled action" should be disabled
|
12
|
-
|
13
|
-
When I press "Some Cool Action"
|
14
|
-
Then I should see "Some action was triggered"
|
15
|
-
|
16
|
-
@javascript
|
17
|
-
Scenario: Pressing a tool should result in corresponding action
|
18
|
-
Given I am on the PanelWithTools test page
|
19
|
-
When I press tool "gear"
|
20
|
-
Then I should see "Gear clicked"
|
21
|
-
When I press tool "refresh"
|
22
|
-
Then I should see "Refresh clicked"
|
@@ -1,19 +0,0 @@
|
|
1
|
-
Feature: Client/server communication
|
2
|
-
In order to value
|
3
|
-
As a role
|
4
|
-
I want feature
|
5
|
-
|
6
|
-
@selenium
|
7
|
-
Scenario: Ask server to set our title
|
8
|
-
Given I am on the ServerCaller test page
|
9
|
-
Then I should see "Server Caller"
|
10
|
-
|
11
|
-
When I press "Call server"
|
12
|
-
And I wait for response from server
|
13
|
-
Then I should see "All quiet here on the server"
|
14
|
-
|
15
|
-
@selenium
|
16
|
-
Scenario: Calling an endpoint with callback and scope
|
17
|
-
Given I am on the ServerCaller test page
|
18
|
-
When I press "Call with generic callback and scope"
|
19
|
-
Then I should see "Fancy title set!"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
Feature: Complex component
|
2
|
-
In order to value
|
3
|
-
As a role
|
4
|
-
I want feature
|
5
|
-
|
6
|
-
@javascript
|
7
|
-
Scenario: Complex component must render properly
|
8
|
-
When I go to the KindaComplexComponent test page
|
9
|
-
Then I should see "Panel One"
|
10
|
-
And I should see "Panel Two"
|
11
|
-
And I should see "Server Caller"
|
12
|
-
|
13
|
-
@javascript
|
14
|
-
Scenario: The last tab of the complex component is a Netzke component that just works
|
15
|
-
Given I am on the KindaComplexComponent test page
|
16
|
-
When I press "Server Caller"
|
17
|
-
And I press "Call server"
|
18
|
-
Then I should see "All quiet here on the server"
|
@@ -1,52 +0,0 @@
|
|
1
|
-
Feature: Component loader
|
2
|
-
In order to value
|
3
|
-
As a role
|
4
|
-
I want feature
|
5
|
-
|
6
|
-
@selenium
|
7
|
-
Scenario: Component loader should be able to load an component
|
8
|
-
Given I am on the ComponentLoader test page
|
9
|
-
When I press "Load component"
|
10
|
-
Then I should see "Inner text"
|
11
|
-
And I should see "Simple Component"
|
12
|
-
|
13
|
-
When I press "Load in window"
|
14
|
-
Then I should see "Component loaded in window"
|
15
|
-
|
16
|
-
@selenium
|
17
|
-
Scenario: Component loader should invoke a callback in loadComponent
|
18
|
-
Given I am on the ComponentLoader test page
|
19
|
-
When I press "Load with feedback"
|
20
|
-
Then I should see "Callback invoked!"
|
21
|
-
|
22
|
-
@selenium
|
23
|
-
Scenario: Component loader should load a window component with another component in it
|
24
|
-
Given I am on the ComponentLoader test page
|
25
|
-
When I press "Load window with simple component"
|
26
|
-
Then I should see "Simple Component Inside Window"
|
27
|
-
And I should see "Inner text"
|
28
|
-
|
29
|
-
@selenium
|
30
|
-
Scenario: Component loader should load a component with params properly
|
31
|
-
Given I am on the ComponentLoader test page
|
32
|
-
When I press "Load with params"
|
33
|
-
Then I should see "Simple Component with changed HTML"
|
34
|
-
|
35
|
-
@javascript
|
36
|
-
Scenario: Component loader should report that it can't load a component and stay adequate
|
37
|
-
Given I am on the ComponentLoader test page
|
38
|
-
When I press "Non-existing component"
|
39
|
-
Then I should see "Couldn't load component 'non_existing_component'"
|
40
|
-
And I should not see "Loading"
|
41
|
-
|
42
|
-
@javascript
|
43
|
-
Scenario: Component loader not be able to load a component marked as excluded
|
44
|
-
Given I am on the ComponentLoader test page
|
45
|
-
When I press "Inaccessible"
|
46
|
-
Then I should see "Couldn't load component 'inaccessible'"
|
47
|
-
|
48
|
-
@javascript
|
49
|
-
Scenario: Loading component's config
|
50
|
-
Given I am on the ComponentLoader test page
|
51
|
-
When I press "Config only"
|
52
|
-
Then I should see "SimpleComponent (overridden)"
|
@@ -1,45 +0,0 @@
|
|
1
|
-
Feature: Composition
|
2
|
-
In order to value
|
3
|
-
As a role
|
4
|
-
I want feature
|
5
|
-
|
6
|
-
@javascript
|
7
|
-
Scenario: The SomeComposite component should have 2 components rendered properly
|
8
|
-
When I go to the SomeComposite test page
|
9
|
-
Then I should see "Server Caller"
|
10
|
-
And I should see "Extended Server Caller"
|
11
|
-
|
12
|
-
@javascript
|
13
|
-
Scenario: The components in the SomeComposite should both work properly
|
14
|
-
Given I am on the SomeComposite test page
|
15
|
-
When I press "Call server" within "#some_composite__center_panel"
|
16
|
-
Then I should see "All quiet here on the server"
|
17
|
-
And I should not see "All quiet here on the server, shiny weather"
|
18
|
-
|
19
|
-
When I press "Call server" within "#some_composite__west_panel"
|
20
|
-
Then I should see "All quiet here on the server, shiny weather"
|
21
|
-
|
22
|
-
@javascript
|
23
|
-
Scenario: Server should be able to address (deeply) nested components
|
24
|
-
Given I am on the SomeComposite test page
|
25
|
-
When I press "Update west from server"
|
26
|
-
And I wait for response from server
|
27
|
-
Then I should see "Here's an update for west panel"
|
28
|
-
|
29
|
-
When I press "Update east south from server"
|
30
|
-
And I wait for response from server
|
31
|
-
Then I should see "Here's an update for south panel in east panel"
|
32
|
-
|
33
|
-
@javascript
|
34
|
-
Scenario: Instantiation of pre-loaded Netzke components
|
35
|
-
Given I am on the SomeComposite test page
|
36
|
-
When I press "Show hidden window"
|
37
|
-
And I wait for response from server
|
38
|
-
Then I should see "Hidden window gone visible!"
|
39
|
-
|
40
|
-
@javascript
|
41
|
-
Scenario: Excluding components for the layout
|
42
|
-
When I go to the SimpleTabPanel test page
|
43
|
-
Then tab panel should have tab with title "Server Caller"
|
44
|
-
And tab panel should have tab with title "Extended Server Caller"
|
45
|
-
But tab panel should not have tab with title "Hello World component"
|
@@ -1,10 +0,0 @@
|
|
1
|
-
Feature: Config to dsl delegation
|
2
|
-
In order to value
|
3
|
-
As a role
|
4
|
-
I want feature
|
5
|
-
|
6
|
-
@javascript
|
7
|
-
Scenario: A base components delegates its configuration options to DSL
|
8
|
-
When I go to the DslDelegatedProperties test page
|
9
|
-
Then I should see "Title set via DSL"
|
10
|
-
And I should see "HTML set via DSL"
|
@@ -1,17 +0,0 @@
|
|
1
|
-
Feature: Custom css
|
2
|
-
In order to value
|
3
|
-
As a role
|
4
|
-
I want feature
|
5
|
-
|
6
|
-
@javascript
|
7
|
-
Scenario: A component with a hidden body should not show show its body
|
8
|
-
When I go to the ComponentWithCustomCss test page
|
9
|
-
Then I should see "ComponentWithCustomCss"
|
10
|
-
But the body of ComponentWithCustomCss component should not be invisible
|
11
|
-
|
12
|
-
@javascript
|
13
|
-
Scenario: A dynamically loaded component with a hidden body should not display its body
|
14
|
-
When I go to the LoaderOfComponentWithCustomCss test page
|
15
|
-
And I press "Load component with custom css"
|
16
|
-
Then I should see "ComponentWithCustomCss"
|
17
|
-
But the body of LoaderOfComponentWithCustomCss/ComponentWithCustomCss component should not be invisible
|
@@ -1,32 +0,0 @@
|
|
1
|
-
Feature: Actions
|
2
|
-
In order to value
|
3
|
-
As a role
|
4
|
-
I want feature
|
5
|
-
|
6
|
-
@javascript
|
7
|
-
Scenario: Making seven consecutive endpoint calls within 10ms batches to one XHR
|
8
|
-
When I go to the ServerCounter test page
|
9
|
-
And I press "Count seven times"
|
10
|
-
Then total requests made should be 1
|
11
|
-
|
12
|
-
@javascript
|
13
|
-
Scenario: Doing two calls to different endpoints preserves the order in request and response
|
14
|
-
When I go to the ServerCounter test page
|
15
|
-
And I press "Do ordered"
|
16
|
-
# "Second." is the indication that the result was applied to the client in the right order
|
17
|
-
# "2" is the indication that the request were processed in the right order on the server side
|
18
|
-
Then I should see "Second. 2"
|
19
|
-
|
20
|
-
@javascript
|
21
|
-
Scenario: 2 out of 5 requests fail, but the retry mechanism should recover, and process them in order
|
22
|
-
Given I go to the ServerCounter test page
|
23
|
-
When I press "Fail two out of five"
|
24
|
-
Then I should see "1,2,3,4,5"
|
25
|
-
|
26
|
-
@javascript
|
27
|
-
Scenario: Updating 3 components (in one request)
|
28
|
-
Given I go to the ExtDirect::Composite test page
|
29
|
-
When I fill in "User:" with "Power User"
|
30
|
-
And I press "Update"
|
31
|
-
Then I should see "Details for user Power User"
|
32
|
-
And I should see "Statistics for user Power User"
|
@@ -1,10 +0,0 @@
|
|
1
|
-
Feature: File inclusion
|
2
|
-
In order to value
|
3
|
-
As a role
|
4
|
-
I want feature
|
5
|
-
|
6
|
-
@javascript
|
7
|
-
Scenario: A component with external JS file included
|
8
|
-
Given I am on the ComponentWithRequiredJs test page
|
9
|
-
When I press "Print message"
|
10
|
-
Then I should see "Some message shown in the body"
|
@@ -1,35 +0,0 @@
|
|
1
|
-
Feature: I18n
|
2
|
-
In order to value
|
3
|
-
As a role
|
4
|
-
I want feature
|
5
|
-
|
6
|
-
@javascript
|
7
|
-
Scenario: LocalizedPanel should be available in 2 languages
|
8
|
-
When I go to the LocalizedPanel test page
|
9
|
-
Then I should see "Localized Panel"
|
10
|
-
And I should see "First property, Second property"
|
11
|
-
And I should see "First action"
|
12
|
-
And I should see "Second action"
|
13
|
-
|
14
|
-
When I go to the "es" version of the LocalizedPanel page
|
15
|
-
Then I should see "Panel Localizada"
|
16
|
-
And I should see "Primera propriedad, Segunda propriedad"
|
17
|
-
And I should see "Primera acción"
|
18
|
-
And I should see "Segunda acción"
|
19
|
-
|
20
|
-
# Ext.LoadMask.prototype.msg is not translated in Ext 4.1.1
|
21
|
-
# When I press "Tercera acción"
|
22
|
-
# Then I should see "Cargando..."
|
23
|
-
|
24
|
-
When I go to the "es" version of the ExtendedLocalizedPanel page
|
25
|
-
Then I should see "Panel Localizada"
|
26
|
-
And I should see "Primera propriedad, Segunda propriedad"
|
27
|
-
And I should see "Action one"
|
28
|
-
And I should see "Segunda acción"
|
29
|
-
|
30
|
-
# Making sure that the locale is restored to "en" in the end
|
31
|
-
When I go to the "en" version of the ExtendedLocalizedPanel page
|
32
|
-
Then I should see "Localized Panel"
|
33
|
-
And I should see "First property, Second property"
|
34
|
-
And I should see "Action one"
|
35
|
-
And I should see "Second action"
|