netzke-basepack 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. data/CHANGELOG.rdoc +10 -0
  2. data/README.rdoc +1 -1
  3. data/Rakefile +1 -1
  4. data/javascripts/basepack.js +4 -108
  5. data/javascripts/feedback_ghost.js +34 -0
  6. data/lib/netzke/basepack.rb +1 -0
  7. data/lib/netzke/basepack/form_panel.rb +7 -6
  8. data/lib/netzke/basepack/form_panel/fields.rb +6 -14
  9. data/lib/netzke/basepack/form_panel/javascripts/form_panel.js +53 -27
  10. data/lib/netzke/basepack/form_panel/javascripts/misc.js +4 -0
  11. data/lib/netzke/basepack/form_panel/javascripts/readonly_mode.js +4 -21
  12. data/lib/netzke/basepack/form_panel/services.rb +10 -3
  13. data/lib/netzke/basepack/grid_panel.rb +40 -26
  14. data/lib/netzke/basepack/grid_panel/columns.rb +25 -0
  15. data/lib/netzke/basepack/grid_panel/javascripts/grid_panel.js +4 -2
  16. data/lib/netzke/basepack/grid_panel/services.rb +10 -33
  17. data/lib/netzke/basepack/search_window.rb +2 -2
  18. data/lib/netzke/basepack/version.rb +1 -1
  19. data/netzke-basepack.gemspec +44 -145
  20. data/test/rails_app/Gemfile +3 -5
  21. data/test/rails_app/Gemfile.lock +78 -84
  22. data/test/rails_app/app/components/book_form.rb +12 -0
  23. data/test/rails_app/app/components/book_grid_with_scoped_authors.rb +8 -0
  24. data/test/rails_app/app/components/book_paging_form_panel.rb +3 -2
  25. data/test/rails_app/app/components/form_without_model.rb +2 -1
  26. data/test/rails_app/app/views/components/loadable_window.html.erb +9 -0
  27. data/test/rails_app/app/views/layouts/application.html.erb +1 -1
  28. data/test/rails_app/config/cucumber.yml +8 -0
  29. data/test/rails_app/config/{database.yml → database.yml.sample} +4 -1
  30. data/test/rails_app/config/locales/es.yml +4 -1
  31. data/{features → test/rails_app/features}/accordion_panel.feature +1 -4
  32. data/{features → test/rails_app/features}/components_in_view.feature +0 -0
  33. data/{features → test/rails_app/features}/form_panel.feature +18 -13
  34. data/{features → test/rails_app/features}/grid_panel.feature +0 -0
  35. data/test/rails_app/features/i18n.feature +18 -0
  36. data/{features → test/rails_app/features}/nested_attributes.feature +0 -0
  37. data/{features → test/rails_app/features}/paging_form_panel.feature +13 -1
  38. data/{features → test/rails_app/features}/search_in_grid.feature +0 -0
  39. data/{features → test/rails_app/features}/simple_app.feature +0 -0
  40. data/{features → test/rails_app/features}/simple_panel.feature +1 -5
  41. data/{features → test/rails_app/features}/step_definitions/accordion_steps.rb +0 -0
  42. data/{features → test/rails_app/features}/step_definitions/form_panel_steps.rb +1 -1
  43. data/{features → test/rails_app/features}/step_definitions/generic_steps.rb +0 -0
  44. data/{features → test/rails_app/features}/step_definitions/grid_panel_steps.rb +0 -0
  45. data/{features → test/rails_app/features}/step_definitions/pickle_steps.rb +0 -0
  46. data/{features → test/rails_app/features}/step_definitions/web_steps.rb +0 -0
  47. data/{features → test/rails_app/features}/support/env.rb +14 -13
  48. data/test/rails_app/features/support/paths.rb +24 -6
  49. data/{features → test/rails_app/features}/support/pickle.rb +0 -0
  50. data/test/rails_app/features/support/selectors.rb +39 -0
  51. data/{features → test/rails_app/features}/tab_panel.feature +1 -4
  52. data/{features → test/rails_app/features}/validations_in_grid.feature +0 -0
  53. data/{features → test/rails_app/features}/virtual_attributes.feature +0 -0
  54. data/{features → test/rails_app/features}/window.feature +0 -0
  55. data/test/rails_app/lib/tasks/cucumber.rake +71 -0
  56. data/test/rails_app/script/cucumber +10 -0
  57. data/{spec → test/rails_app/spec}/active_record/attributes_spec.rb +0 -0
  58. data/{spec → test/rails_app/spec}/active_record/relation_extensions_spec.rb +0 -0
  59. data/{spec → test/rails_app/spec}/components/form_panel_spec.rb +0 -0
  60. data/{spec → test/rails_app/spec}/components/grid_panel_spec.rb +0 -0
  61. data/{spec → test/rails_app/spec}/factories.rb +0 -0
  62. data/{spec → test/rails_app/spec}/spec_helper.rb +1 -6
  63. metadata +43 -141
  64. data/autotest/discover.rb +0 -3
  65. data/config/database.yml +0 -2
  66. data/features/i18n.feature +0 -18
  67. data/features/support/paths.rb +0 -65
  68. data/lib/netzke/basepack/form_panel/javascripts/display_mode.js +0 -68
  69. data/lib/netzke/basepack/form_panel/javascripts/netzkefileupload.js +0 -5
  70. data/test/rails_app/spec/controllers/embedded_components_controller_spec.rb +0 -12
  71. data/test/rails_app/spec/helpers/embedded_components_helper_spec.rb +0 -15
  72. data/test/rails_app/spec/models/address_spec.rb +0 -5
  73. data/test/rails_app/spec/models/author_spec.rb +0 -5
  74. data/test/rails_app/spec/models/book_spec.rb +0 -5
  75. data/test/rails_app/spec/models/role_spec.rb +0 -5
  76. data/test/rails_app/spec/models/user_spec.rb +0 -5
  77. data/test/rails_app/spec/views/embedded_components/index.html.erb_spec.rb +0 -5
@@ -1,3 +0,0 @@
1
- Autotest.add_discovery do
2
- "rails"
3
- end
@@ -1,2 +0,0 @@
1
- # This dummy file is only here to please cucumber environment
2
- test:
@@ -1,18 +0,0 @@
1
- Feature: I18n
2
- In order to value
3
- As a role
4
- I want feature
5
-
6
- Scenario: A grid with localized column headers
7
- When I go to the "es" version of the BookGrid page
8
- Then I should see "Autor"
9
- And I should see "Creado en"
10
- But I should not see "Author"
11
- And I should not see "Created at"
12
-
13
- Scenario: A form with localized field labels
14
- When I go to the "es" version of the BookForm page
15
- Then I should see "Autor"
16
- And I should see "En abundancia"
17
- But I should not see "Author"
18
- And I should not see "In abundance"
@@ -1,65 +0,0 @@
1
- module NavigationHelpers
2
- # Maps a name to a path. Used by the
3
- #
4
- # When /^I go to (.+)$/ do |page_name|
5
- #
6
- # step definition in web_steps.rb
7
- #
8
- def path_to(page_name)
9
- case page_name
10
-
11
- when /the home\s?page/
12
- '/'
13
-
14
- # Add more mappings here.
15
- # Here is an example that pulls values out of the Regexp:
16
- #
17
- # when /^(.*)'s profile page$/i
18
- # user_profile_path(User.find_by_login($1))
19
-
20
- # the following are examples using path_to_pickle
21
-
22
- when /^#{capture_model}(?:'s)? page$/ # eg. the forum's page
23
- path_to_pickle $1
24
-
25
- when /^#{capture_model}(?:'s)? #{capture_model}(?:'s)? page$/ # eg. the forum's post's page
26
- path_to_pickle $1, $2
27
-
28
- when /^#{capture_model}(?:'s)? #{capture_model}'s (.+?) page$/ # eg. the forum's post's comments page
29
- path_to_pickle $1, $2, :extra => $3 # or the forum's post's edit page
30
-
31
- when /^#{capture_model}(?:'s)? (.+?) page$/ # eg. the forum's posts page
32
- path_to_pickle $1, :extra => $2 # or the forum's edit page
33
-
34
- when /the simple panel page/
35
- '/panel/simple'
36
-
37
- when /the server caller page/
38
- '/panel/server_caller'
39
-
40
- when /the component loader page/
41
- '/panel/component_loader'
42
-
43
- when /the "(.*)" view/
44
- embedded_components_path(:action => $1.gsub(" ", "_"))
45
-
46
- when /the (.*) test page/
47
- components_path(:component => $1)
48
-
49
- when /the "(.+)" version of the (.*) page/
50
- components_path(:component => $2, :locale => $1)
51
-
52
- else
53
- begin
54
- page_name =~ /the (.*) page/
55
- path_components = $1.split(/\s+/)
56
- self.send(path_components.push('path').join('_').to_sym)
57
- rescue Object => e
58
- raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
59
- "Now, go and add a mapping in #{__FILE__}"
60
- end
61
- end
62
- end
63
- end
64
-
65
- World(NavigationHelpers)
@@ -1,68 +0,0 @@
1
- Ext.override(Ext.form.Field, {
2
-
3
- // By calling this, the field is instructed to replace itself with another instance, configured with displayModeConfig
4
- setDisplayMode: function(onOff){
5
- if (this.hidden) return;
6
-
7
- var owner = this.ownerCt;
8
- var newConfig = this.displayModeConfig(onOff);
9
-
10
- var idx = this.removeSelf();
11
- owner.insert(idx, newConfig);
12
-
13
- this.destroy();
14
- },
15
-
16
- // Remove self from the container
17
- removeSelf: function(){
18
- var idx = this.ownerCt.items.indexOf(this);
19
- this.ownerCt.remove(this);
20
- return idx;
21
- },
22
-
23
- // Config for creating an instance in "displayMode" (if onOff is true), or normal mode (if onOff is false)
24
- displayModeConfig: function(onOff){
25
- return Ext.apply(this.initialConfig, onOff ? {xtype: 'displayfield', origXtype: this.xtype, value: this.getValue()} : {xtype: this.origXtype, value: this.getValue()});
26
- }
27
-
28
- });
29
-
30
- Ext.override(Ext.netzke.ComboBox, {
31
- displayModeConfig: function(onOff){
32
- return Ext.apply(this.initialConfig, onOff ? {xtype: 'displayfield', origXtype: this.xtype, value: this.getRawValue(), origValue: this.getValue()} : {xtype: this.origXtype, value: this.origValue});
33
- }
34
- });
35
-
36
- Ext.override(Ext.netzke.form.NRadioGroup, {
37
- setDisplayMode: function(onOff){
38
- this.items.each(function(i){
39
- i.setDisabled(onOff);
40
- });
41
- }
42
- });
43
-
44
- Ext.override(Ext.netzke.form.CommaListCbg, {
45
- setDisplayMode: function(onOff){
46
- this.items.each(function(i){
47
- i.setDisabled(onOff);
48
- });
49
- }
50
- });
51
-
52
- Ext.override(Ext.form.Checkbox, {
53
- setDisplayMode: function(onOff){
54
- this.setDisabled(onOff);
55
- }
56
- });
57
-
58
- // Composite field has to take care of its children, by setting them into the "display mode"
59
- Ext.override(Ext.form.CompositeField, {
60
- displayModeConfig: function(onOff){
61
- var newItems = [];
62
- this.items.each(function(i){
63
- newItems.push(Ext.apply(i.displayModeConfig(onOff)));
64
- i.destroy();
65
- });
66
- return Ext.apply(this.initialConfig, {items: newItems, name: this.name});
67
- }
68
- });
@@ -1,5 +0,0 @@
1
- Ext.netzke.FileUploadField = Ext.extend(Ext.ux.form.FileUploadField, {
2
- buttonText: "..."
3
- });
4
-
5
- Ext.reg('netzkefileuploadfield', Ext.netzke.FileUploadField);
@@ -1,12 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe EmbeddedComponentsController do
4
-
5
- describe "GET 'index'" do
6
- it "should be successful" do
7
- get 'index'
8
- response.should be_success
9
- end
10
- end
11
-
12
- end
@@ -1,15 +0,0 @@
1
- require 'spec_helper'
2
-
3
- # Specs in this file have access to a helper object that includes
4
- # the EmbeddedComponentsHelper. For example:
5
- #
6
- # describe EmbeddedComponentsHelper do
7
- # describe "string concat" do
8
- # it "concats two strings with spaces" do
9
- # helper.concat_strings("this","that").should == "this that"
10
- # end
11
- # end
12
- # end
13
- describe EmbeddedComponentsHelper do
14
- pending "add some examples to (or delete) #{__FILE__}"
15
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Address do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Author do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Book do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Role do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe User do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end
@@ -1,5 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "embedded_components/index.html.erb" do
4
- pending "add some examples to (or delete) #{__FILE__}"
5
- end