wice_grid 3.5.0 → 3.6.0.pre1

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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/.inch.yml +3 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +181 -0
  5. data/.travis.yml +22 -0
  6. data/{CHANGELOG → CHANGELOG.md} +95 -31
  7. data/Gemfile +4 -1
  8. data/README.md +1517 -0
  9. data/Rakefile +51 -7
  10. data/{SAVED_QUERIES_HOWTO.rdoc → SAVED_QUERIES_HOWTO.md} +34 -31
  11. data/TODO.md +16 -0
  12. data/lib/generators/wice_grid/add_migration_for_serialized_queries_generator.rb +4 -6
  13. data/lib/generators/wice_grid/install_generator.rb +2 -5
  14. data/lib/generators/wice_grid/templates/create_wice_grid_serialized_queries.rb +1 -0
  15. data/lib/generators/wice_grid/templates/wice_grid_config.rb +29 -34
  16. data/lib/wice/active_record_column_wrapper.rb +36 -17
  17. data/lib/wice/columns.rb +53 -52
  18. data/lib/wice/columns/column_action.rb +11 -13
  19. data/lib/wice/columns/column_boolean.rb +9 -11
  20. data/lib/wice/columns/column_bootstrap_datepicker.rb +48 -0
  21. data/lib/wice/columns/column_custom_dropdown.rb +22 -23
  22. data/lib/wice/columns/column_float.rb +2 -6
  23. data/lib/wice/columns/column_html5_datepicker.rb +31 -0
  24. data/lib/wice/columns/column_integer.rb +9 -13
  25. data/lib/wice/columns/column_jquery_datepicker.rb +49 -0
  26. data/lib/wice/columns/column_processor_index.rb +18 -13
  27. data/lib/wice/columns/column_rails_date_helper.rb +41 -0
  28. data/lib/wice/columns/column_rails_datetime_helper.rb +40 -0
  29. data/lib/wice/columns/column_range.rb +7 -11
  30. data/lib/wice/columns/column_string.rb +24 -20
  31. data/lib/wice/columns/common_date_datetime_mixin.rb +20 -0
  32. data/lib/wice/columns/common_js_date_datetime_conditions_generator_mixin.rb +39 -0
  33. data/lib/wice/columns/common_js_date_datetime_mixin.rb +15 -0
  34. data/lib/wice/columns/{column_date.rb → common_rails_date_datetime_conditions_generator_mixin.rb} +4 -22
  35. data/lib/wice/columns/common_standard_helper_date_datetime_mixin.rb +22 -0
  36. data/lib/wice/grid_output_buffer.rb +19 -10
  37. data/lib/wice/grid_renderer.rb +146 -85
  38. data/lib/wice/helpers/bs_calendar_helpers.rb +6 -7
  39. data/lib/wice/helpers/js_calendar_helpers.rb +19 -17
  40. data/lib/wice/helpers/wice_grid_misc_view_helpers.rb +18 -18
  41. data/lib/wice/helpers/wice_grid_serialized_queries_view_helpers.rb +44 -49
  42. data/lib/wice/helpers/wice_grid_view_helpers.rb +131 -134
  43. data/lib/wice/kaminari_monkey_patching.rb +3 -1
  44. data/lib/wice/table_column_matrix.rb +23 -8
  45. data/lib/wice/wice_grid_controller.rb +12 -16
  46. data/lib/wice/wice_grid_core_ext.rb +12 -20
  47. data/lib/wice/wice_grid_misc.rb +131 -53
  48. data/lib/wice/wice_grid_serialized_queries_controller.rb +10 -11
  49. data/lib/wice/wice_grid_serialized_query.rb +4 -3
  50. data/lib/wice/wice_grid_spreadsheet.rb +19 -18
  51. data/lib/wice_grid.rb +144 -135
  52. data/spec/schema.rb +9 -0
  53. data/spec/spec_helper.rb +75 -0
  54. data/spec/support/active_record.rb +11 -0
  55. data/spec/support/wice_grid_test_config.rb +172 -0
  56. data/spec/wice/grid_output_buffer_spec.rb +41 -0
  57. data/spec/wice/table_column_matrix_spec.rb +38 -0
  58. data/spec/wice/wice_grid_misc_spec.rb +159 -0
  59. data/spec/wice/wice_grid_spreadsheet_spec.rb +14 -0
  60. data/test/readme.txt +1 -1
  61. data/vendor/assets/javascripts/wice_grid_init.js.coffee +14 -8
  62. data/vendor/assets/stylesheets/wice_grid.scss +84 -0
  63. data/wice_grid.gemspec +32 -16
  64. metadata +217 -25
  65. data/README.rdoc +0 -1325
  66. data/lib/generators/wice_grid/templates/wice_grid.scss +0 -140
  67. data/lib/wice/columns/column_datetime.rb +0 -171
  68. data/vendor/assets/images/icons/grid/arrow_down.gif +0 -0
  69. data/vendor/assets/images/icons/grid/arrow_up.gif +0 -0
  70. data/vendor/assets/images/icons/grid/calendar_view_month.png +0 -0
  71. data/vendor/assets/images/icons/grid/collapse.gif +0 -0
  72. data/vendor/assets/images/icons/grid/delete.png +0 -0
  73. data/vendor/assets/images/icons/grid/expand.gif +0 -0
  74. data/vendor/assets/images/icons/grid/page_white_excel.png +0 -0
  75. data/vendor/assets/images/icons/grid/page_white_find.png +0 -0
  76. data/vendor/assets/images/icons/grid/table.png +0 -0
  77. data/vendor/assets/images/icons/grid/table_refresh.png +0 -0
  78. data/vendor/assets/images/icons/grid/tick_all.png +0 -0
  79. data/vendor/assets/images/icons/grid/untick_all.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: adffa454db1aaf48823d131bb5069b8ca23dcbad
4
- data.tar.gz: 75d831e4513a585cfcf1900bf3b84fb68d445c9e
3
+ metadata.gz: e2d67863c4c04cf42e55ef57f832f4de049094a9
4
+ data.tar.gz: 3f68e7390b56385d51a397b4f8c262ad6d8ca2f9
5
5
  SHA512:
6
- metadata.gz: 22ba98f7d7dc809b16ecb599b14ba96a09a3e6d55eb4d70ef6b14a68a1cc86f0e0cb11712facf429c6a5b562536ead818c5fd06fb38566ffdaf33a091ed24fe9
7
- data.tar.gz: bcb4e05fa26aa09d0f4576ca4240b9646cdf354b702267645d815cf02eb634fb127c7bbd417872c2aea8742a2f5a060ecef6b6625d58ef05d036f25d84853531
6
+ metadata.gz: 5d6154aeede19e92e6ca4847984fbe44932652887fd8fa9dfc7566d9d6b693aa26b3012d30f077b7b1817ba6f05f6006b7ac0288890986422dc84cebfe1223cf
7
+ data.tar.gz: d008ad82a090b98a7dd5c8e75f70ee57bedb16d18005f401eb4e56de57e02f01672a27d0470cd4636f22c1c1d259f8c2fa4fc56f041336f65569bc5a6f860db1
data/.inch.yml ADDED
@@ -0,0 +1,3 @@
1
+ files:
2
+ excluded:
3
+ - lib/generators/wice_grid/add_migration_for_serialized_queries_generator.rb
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --require spec_helper
3
+ --format d
data/.rubocop.yml ADDED
@@ -0,0 +1,181 @@
1
+ AllCops:
2
+ DisabledByDefault: true
3
+
4
+ Style/MultilineTernaryOperator:
5
+ Enabled: true
6
+
7
+ # Cop supports --auto-correct.
8
+ Style/DefWithParentheses:
9
+ Enabled: true
10
+
11
+ # Cop supports --auto-correct.
12
+ Style/MethodCallParentheses:
13
+ Enabled: true
14
+
15
+ # Cop supports --auto-correct.
16
+ # Configuration parameters: EnforcedStyleInsidePipes, SupportedStyles.
17
+ Style/SpaceAroundBlockParameters:
18
+ Enabled: true
19
+
20
+ # Cop supports --auto-correct.
21
+ # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
22
+ Style/TrailingComma:
23
+ Enabled: true
24
+
25
+ # Cop supports --auto-correct.
26
+ Style/SingleSpaceBeforeFirstArg:
27
+ Enabled: true
28
+
29
+ # Cop supports --auto-correct.
30
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
31
+ Style/FirstParameterIndentation:
32
+ Enabled: true
33
+
34
+ # Cop supports --auto-correct.
35
+ # Configuration parameters: AllowSafeAssignment.
36
+ Style/ParenthesesAroundCondition:
37
+ Enabled: true
38
+
39
+ # Cop supports --auto-correct.
40
+ Style/SpecialGlobalVars:
41
+ Enabled: true
42
+
43
+ # Cop supports --auto-correct.
44
+ # Configuration parameters: IgnoredMethods.
45
+ Style/SymbolProc:
46
+ Enabled: true
47
+
48
+ # Cop supports --auto-correct.
49
+ Style/Lambda:
50
+ Enabled: true
51
+
52
+ # Cop supports --auto-correct.
53
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
54
+ Style/MethodDefParentheses:
55
+ Enabled: true
56
+
57
+ # Cop supports --auto-correct.
58
+ Style/EmptyLiteral:
59
+ Enabled: true
60
+
61
+ # Cop supports --auto-correct.
62
+ # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
63
+ Style/HashSyntax:
64
+ Enabled: true
65
+
66
+ # Cop supports --auto-correct.
67
+ Style/Not:
68
+ Enabled: true
69
+
70
+ # Cop supports --auto-correct.
71
+ # Configuration parameters: AllowMultipleReturnValues.
72
+ Style/RedundantReturn:
73
+ Enabled: true
74
+
75
+ # Cop supports --auto-correct.
76
+ Style/SpaceAfterComma:
77
+ Enabled: true
78
+
79
+ # Cop supports --auto-correct.
80
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
81
+ Style/SignalException:
82
+ Enabled: true
83
+
84
+ # Cop supports --auto-correct.
85
+ Style/LineEndConcatenation:
86
+ Enabled: true
87
+
88
+ # Cop supports --auto-correct.
89
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
90
+ Style/AndOr:
91
+ Enabled: true
92
+
93
+ # Cop supports --auto-correct.
94
+ # Configuration parameters: PreferredDelimiters.
95
+ Style/PercentLiteralDelimiters:
96
+ Enabled: true
97
+
98
+ # Cop supports --auto-correct.
99
+ # Configuration parameters: EnforcedStyle, SupportedStyles, AutoCorrectEncodingComment.
100
+ Style/Encoding:
101
+ Enabled: true
102
+
103
+ # Cop supports --auto-correct.
104
+ Lint/UnusedMethodArgument:
105
+ Enabled: true
106
+
107
+ # Cop supports --auto-correct.
108
+ Style/AlignArray:
109
+ Enabled: true
110
+
111
+ # Cop supports --auto-correct.
112
+ Style/ColonMethodCall:
113
+ Enabled: true
114
+
115
+ # Cop supports --auto-correct.
116
+ Lint/UnusedBlockArgument:
117
+ Enabled: true
118
+
119
+ # Cop supports --auto-correct.
120
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
121
+ Style/DotPosition:
122
+ Enabled: true
123
+
124
+ # Cop supports --auto-correct.
125
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
126
+ Style/EmptyElse:
127
+ Enabled: true
128
+
129
+ # Cop supports --auto-correct.
130
+ # Configuration parameters: MultiSpaceAllowedForOperators.
131
+ Style/SpaceAroundOperators:
132
+ Enabled: true
133
+
134
+ # Cop supports --auto-correct.
135
+ Style/SpaceBeforeComma:
136
+ Enabled: true
137
+
138
+ # Cop supports --auto-correct.
139
+ Style/SpaceInsideParens:
140
+ Enabled: true
141
+
142
+ # Cop supports --auto-correct.
143
+ Style/DeprecatedHashMethods:
144
+ Enabled: true
145
+
146
+ # Cop supports --auto-correct.
147
+ # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.
148
+ Style/BlockDelimiters:
149
+ Enabled: true
150
+
151
+ # Cop supports --auto-correct.
152
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
153
+ Style/BracesAroundHashParameters:
154
+ Enabled: true
155
+
156
+ Lint/AmbiguousRegexpLiteral:
157
+ Enabled: true
158
+
159
+ # Cop supports --auto-correct.
160
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
161
+ Style/StringLiterals:
162
+ Enabled: true
163
+
164
+ Lint/AmbiguousOperator:
165
+ Enabled: true
166
+
167
+ Lint/UselessAssignment:
168
+ Enabled: true
169
+
170
+ # Cop supports --auto-correct.
171
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
172
+ Style/ClassCheck:
173
+ Enabled: true
174
+
175
+ # Cop supports --auto-correct.
176
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
177
+ Style/AlignParameters:
178
+ Enabled: true
179
+
180
+ Lint/ConditionPosition:
181
+ Enabled: true
data/.travis.yml ADDED
@@ -0,0 +1,22 @@
1
+ sudo: false
2
+ cache: bundler
3
+ language: ruby
4
+ rvm:
5
+ - 2.0.0
6
+ - 2.1.6
7
+ - 2.2.2
8
+ - ruby-head
9
+ - jruby-19mode
10
+ - rbx-2
11
+ matrix:
12
+ allow_failures:
13
+ - rvm: ruby-head
14
+ - rvm: jruby-19mode
15
+ - rvm: rbx-2
16
+ - rvm: 1.9.3
17
+ fast_finish: true
18
+ before_install: gem update --remote bundler
19
+ install:
20
+ - bundle install --retry=3
21
+ script:
22
+ - bundle exec rake
@@ -1,13 +1,77 @@
1
- 3.5.0
1
+ 3.6.0
2
2
 
3
- New features:
3
+
4
+ * There is no more :helper_style in column definitions and no more Wice::Defaults:HELPER_STYLE.
5
+ Instead there is a number of filter types:
6
+
7
+ * rails_datetime_helper
8
+ * rails_date_helper
9
+ * jquery_datepicker
10
+ * bootstrap_datepicker
11
+
12
+ and new configuration values Wice::Defaults:DEFAULT_FILTER_FOR_DATE and Wice::Defaults:DEFAULT_FILTER_FOR_DATETIME
13
+
14
+
15
+ * No more
16
+
17
+ column model: 'ModelClass' do
18
+
19
+ Instead:
20
+
21
+ column assoc: :association_name do
22
+
23
+ or
24
+
25
+ column assoc: [:association_x, association_in_association_x_model, ...] do
26
+
27
+ If associations have been mentioned in :assoc, it is not necessary to list them in :include!
28
+
29
+ Blockless column definitions now work for columns from joined tables!
30
+
31
+ * No jpg/png icons, the plugin uses Font Awesome
32
+ * CSS is not copied to the app. It is included by @import "wice_grid" in your application.scss.
33
+
34
+ * Blockless columns now work for joined tables, too:
35
+
36
+ Instead of
37
+
38
+ g.column name: 'Priority', attribute: 'name', assoc: :priority do |task|
39
+ task.priority.name if task.priority
40
+ end
41
+
42
+ you can write
43
+
44
+ g.column name: 'Priority', attribute: 'name', assoc: :priority
45
+
46
+ Instead of
47
+
48
+ g.column name: 'Customer', attribute: 'name', assoc: [:project, :customer] do |task|
49
+ task.project.customer.name if task.project && task.project.customer
50
+ end
51
+
52
+ you can write
53
+
54
+ g.column name: 'Customer', attribute: 'name', assoc: [:project, :customer]
55
+
56
+ * CI_LIKE feature from @nathanvda for string filters:
57
+
58
+ Setting a configuration value in Wice::Defaults::STRING_MATCHING_OPERATORS to CI_LIKE will result in
59
+ the following SQL:
60
+
61
+ UPPER(table.field) LIKE UPPER(?)"
62
+
63
+ * New USE_DEFAULT_SCOPE configuration value from @nathanvda.
64
+ By default ActiveRecord calls are always executed inside Model.unscoped{}.
65
+ Setting USE_DEFAULT_SCOPE to true will use the default scope for all queries.
66
+
67
+
68
+ # 3.5.0
4
69
 
5
70
  * In addition to two icons "SET ALL" and "UNSET ALL" in the action column, there is now
6
71
  an option to use a standard HTML checkbox. This is now the default.
7
72
  * Support for Bootstrap Datepicker. A suggested way to use Bootstrap Datepicker in a Rails app
8
73
  is https://github.com/Nerian/bootstrap-datepicker-rails. Configuration variable HELPER_STYLE
9
- sets the default flavor of date pickers.
10
-
74
+ sets the default flavor of date pickers. Can also be set per grid with helper_style: :bootstrap
11
75
  * :calendar jQuery UI datepicker
12
76
  * :bootstrap Bootstrap datepicker
13
77
  * :standard
@@ -16,32 +80,32 @@ New features:
16
80
  * various fixes
17
81
  * Configuration variable ALLOW_SHOWING_ALL_QUERIES renamed to ALLOW_SHOWING_ALL_RECORDS
18
82
 
19
- Can also be set per grid with helper_style: :bootstrap
20
83
 
21
- 3.4.14
84
+
85
+ # 3.4.14
22
86
 
23
87
  Wice::Defaults::HIDE_ALL_LINK_FROM is nil by default
24
88
 
25
- 3.4.13
89
+ # 3.4.13
26
90
 
27
91
  New configuration variable Wice::Defaults::HIDE_ALL_LINK_FROM! When set and the total
28
92
  number of row exceeds its value, the "SHOW ALL" link disappears.
29
93
 
30
- 3.4.12
94
+ 3.4.12
31
95
 
32
96
  fixes
33
97
 
34
- 3.4.11
98
+ # 3.4.11
35
99
 
36
100
  started adding HTML5 datepicker
37
101
  changed how relations are detected so that it can work with relation proxies (aka octopus)
38
102
 
39
- 3.4.10
103
+ 3.4.10
40
104
 
41
105
  bug fixes
42
106
  better support for :group
43
107
 
44
- 3.4.9
108
+ # 3.4.9
45
109
 
46
110
  better support for Asset Pipeline
47
111
 
@@ -49,13 +113,13 @@ bugfixes
49
113
 
50
114
  dropped support for Ruby 1.8
51
115
 
52
- 3.4.8
116
+ # 3.4.8
53
117
 
54
118
  a friendlier exception message when a constant is missing in wice_grid_config.rb
55
119
 
56
120
  bugfixes
57
121
 
58
- 3.4.6
122
+ # 3.4.6
59
123
 
60
124
  Better support for Turbolinks
61
125
 
@@ -63,21 +127,21 @@ Better support for ActiveRelation #references
63
127
 
64
128
  variable Wice::Defaults::PAGE_METHOD_NAME
65
129
 
66
- 3.4.5
130
+ # 3.4.5
67
131
 
68
132
  Support for ActiveRelation #references
69
133
 
70
134
  bugfixes
71
135
 
72
- 3.4.4
136
+ # 3.4.4
73
137
 
74
138
  bugfixes
75
139
 
76
- 3.4.3
140
+ # 3.4.3
77
141
 
78
142
  bugfixes
79
143
 
80
- 3.4.2
144
+ # 3.4.2
81
145
 
82
146
  External columns processors
83
147
 
@@ -85,15 +149,15 @@ Operators '<','>','<=','>=','=' in the integer column
85
149
 
86
150
  Bugfixes
87
151
 
88
- 3.4.1
152
+ # 3.4.1
89
153
 
90
154
  Support for Bootstrap 3
91
155
 
92
- 3.4.0
156
+ # 3.4.0
93
157
 
94
158
  Support for Rails 4
95
159
 
96
- 3.3.0
160
+ # 3.3.0
97
161
 
98
162
  The with_paginated_resultset callback receives an ActiveRelation object, not a lambda
99
163
 
@@ -114,7 +178,7 @@ Bug fixed: extra_request_parameters not propagating to the pagination panel
114
178
 
115
179
  Documentation improvements
116
180
 
117
- 3.2.2
181
+ # 3.2.2
118
182
 
119
183
  improvement of the javascript calendar control: if the FROM field is set to a value after TO, TO is set to the value of FROM.
120
184
  Vice versa: if the TO field is set to a value before FROM, FROM is set to the value of TO
@@ -131,7 +195,7 @@ helpers filter_and_order_state_as_hash(grid) and filter_state_as_hash(grid)
131
195
 
132
196
  the with_paginated_resultset callback receives an ActiveRelation object, not a lambda
133
197
 
134
- 3.2.1
198
+ # 3.2.1
135
199
 
136
200
  action_column can now also take a block. If the block returns a falsy value, no checkbox will be rendered.
137
201
 
@@ -143,7 +207,7 @@ The default filter for numeric columns has been replaced by a simple one field f
143
207
  New column parameter :filter_type allows to load custom alternative filters.
144
208
  The old numeric range filter can still be used by specifying filter_type: :range. See lib/columns/column_processor_index.rb for the list of available filters.
145
209
 
146
- 3.2.0
210
+ # 3.2.0
147
211
 
148
212
  Fixes:
149
213
  https://github.com/leikind/wice_grid/issues/83
@@ -160,24 +224,24 @@ New column parameter :filter_type allows to load custom alternative filters. The
160
224
  See lib/columns/column_processor_index.rb</tt> for the list of available filters.
161
225
 
162
226
 
163
- 3.0.4
227
+ # 3.0.4
164
228
 
165
229
  bugfixes
166
230
 
167
- 3.0.3
231
+ # 3.0.3
168
232
 
169
233
  bugxixes
170
234
 
171
- 3.0.2
235
+ # 3.0.2
172
236
 
173
237
  bugxixes
174
238
 
175
- 3.0.1
239
+ # 3.0.1
176
240
 
177
- Fixed the "Cannot modify SafeBuffer in place" problem and thus Rails 3.0.8 and 3.0.9
241
+ Fixed the "Cannot modify SafeBuffer in place" problem and thus Rails # 3.0.8 and # 3.0.9
178
242
  Support for ActiveRecord::Relation
179
243
 
180
- 3.0.0
244
+ # 3.0.0
181
245
 
182
246
  Rails 3 support
183
247
 
@@ -213,7 +277,7 @@ the selected records.
213
277
  using merge_conditions to merge conditions :)
214
278
 
215
279
  WiceGrid is now compatible with the new Rails XSS behavior which
216
- will be the default in Rails 3.0 and can be used in Rails 2.3.5
280
+ will be the default in Rails # 3.0 and can be used in Rails 2.3.5
217
281
  using the rails_xss plugin.
218
282
  Read http://github.com/nzkoz/rails_xss for more
219
283
 
@@ -589,4 +653,4 @@ In this case +attribute_name+ will be used as the method name to send to the Act
589
653
  * New parameter +grid+ parameter: <tt>:extra_request_parameters</tt>.
590
654
  (Read http://redmine.wice.eu/api/wice_grid/classes/Wice/GridViewHelper.html#M000002)
591
655
 
592
- === 0
656
+ === 0