wice_grid 3.6.2 → 4.1.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 (332) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +41 -0
  3. data/.circleci/run-build-locally.sh +7 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  5. data/.gitignore +5 -2
  6. data/Appraisals +11 -0
  7. data/CHANGELOG.md +38 -1
  8. data/Gemfile.lock +299 -0
  9. data/README.md +77 -34
  10. data/config/locales/ja.yml +3 -3
  11. data/gemfiles/rails_5.0.gemfile +7 -0
  12. data/gemfiles/rails_5.0.gemfile.lock +291 -0
  13. data/gemfiles/rails_5.1.gemfile +7 -0
  14. data/gemfiles/rails_5.1.gemfile.lock +291 -0
  15. data/gemfiles/rails_5.2.gemfile +7 -0
  16. data/gemfiles/rails_5.2.gemfile.lock +299 -0
  17. data/lib/wice/columns.rb +13 -6
  18. data/lib/wice/columns/column_integer.rb +11 -1
  19. data/lib/wice/columns/column_rails_datetime_helper.rb +3 -2
  20. data/lib/wice/columns/column_range.rb +6 -4
  21. data/lib/wice/grid_renderer.rb +23 -7
  22. data/lib/wice/helpers/bs_calendar_helpers.rb +9 -1
  23. data/lib/wice/helpers/wice_grid_view_helpers.rb +6 -6
  24. data/lib/wice/wice_grid_controller.rb +7 -5
  25. data/lib/wice/wice_grid_core_ext.rb +5 -1
  26. data/lib/wice/wice_grid_misc.rb +1 -1
  27. data/lib/wice_grid.rb +86 -59
  28. data/spec/acceptance_helper.rb +58 -0
  29. data/spec/features/action_column_request_spec.rb +280 -0
  30. data/spec/features/adding_rows_request_spec.rb +21 -0
  31. data/spec/features/all_records_request_spec.rb +18 -0
  32. data/spec/features/auto_reloads2_request_spec.rb +349 -0
  33. data/spec/features/auto_reloads3_request_spec.rb +130 -0
  34. data/spec/features/auto_reloads_request_spec.rb +348 -0
  35. data/spec/features/basics1_request_spec.rb +11 -0
  36. data/spec/features/basics2_request_spec.rb +10 -0
  37. data/spec/features/basics3_request_spec.rb +29 -0
  38. data/spec/features/basics4_request_spec.rb +19 -0
  39. data/spec/features/basics5_request_spec.rb +13 -0
  40. data/spec/features/basics6_request_spec.rb +22 -0
  41. data/spec/features/blockless_column_definition_spec.rb +27 -0
  42. data/spec/features/buttons_request_spec.rb +172 -0
  43. data/spec/features/csv_and_detached_filters_spec.rb +10 -0
  44. data/spec/features/csv_export_request_spec.rb +13 -0
  45. data/spec/features/custom_filter_params_request_spec.rb +29 -0
  46. data/spec/features/custom_filters1_request_spec.rb +155 -0
  47. data/spec/features/custom_filters2_request_spec.rb +53 -0
  48. data/spec/features/custom_filters3_request_spec.rb +50 -0
  49. data/spec/features/custom_filters4_request_spec.rb +13 -0
  50. data/spec/features/custom_ordering_on_calculated_request_spec.rb +30 -0
  51. data/spec/features/custom_ordering_request_spec.rb +36 -0
  52. data/spec/features/custom_ordering_with_arel_request_spec.rb +36 -0
  53. data/spec/features/custom_ordering_with_proc_request_spec.rb +44 -0
  54. data/spec/features/custom_ordering_with_ruby_request_spec.rb +30 -0
  55. data/spec/features/dates_request_spec.rb +56 -0
  56. data/spec/features/detached_filters_spec.rb +10 -0
  57. data/spec/features/detached_filters_two_grids_spec.rb +127 -0
  58. data/spec/features/disable_all_filters_spec.rb +22 -0
  59. data/spec/features/hiding_checkboxes_in_action_column_request_spec.rb +294 -0
  60. data/spec/features/integration_with_application_view_request_spec.rb +43 -0
  61. data/spec/features/integration_with_forms_request_spec.rb +141 -0
  62. data/spec/features/joining_tables_spec.rb +40 -0
  63. data/spec/features/localization_request_spec.rb +24 -0
  64. data/spec/features/many_grids_on_page_request_spec.rb +104 -0
  65. data/spec/features/negation_request_spec.rb +25 -0
  66. data/spec/features/no_records_request_spec.rb +26 -0
  67. data/spec/features/numeric_filters_request_spec.rb +10 -0
  68. data/spec/features/resultset_processings2_request_spec.rb +27 -0
  69. data/spec/features/resultset_processings_request_spec.rb +30 -0
  70. data/spec/features/saved_queries_request_spec.rb +120 -0
  71. data/spec/features/shared.rb +1005 -0
  72. data/spec/features/shared_detached_filters.rb +158 -0
  73. data/spec/features/styling_spec.rb +15 -0
  74. data/spec/features/two_associations_spec.rb +48 -0
  75. data/spec/features/upper_pagination_panel_request_spec.rb +23 -0
  76. data/spec/features/when_filtered_spec.rb +209 -0
  77. data/spec/fixtures/.gitkeep +0 -0
  78. data/spec/fixtures/companies.yml +21 -0
  79. data/spec/fixtures/priorities.yml +31 -0
  80. data/spec/fixtures/project_roles.yml +25 -0
  81. data/spec/fixtures/projects.yml +22 -0
  82. data/spec/fixtures/statuses.yml +55 -0
  83. data/spec/fixtures/tasks.yml +751 -0
  84. data/spec/fixtures/tasks_users.yml +2089 -0
  85. data/spec/fixtures/users.yml +61 -0
  86. data/spec/fixtures/versions.yml +78 -0
  87. data/spec/models/company_spec.rb +6 -0
  88. data/spec/models/priority_spec.rb +6 -0
  89. data/spec/models/project_spec.rb +11 -0
  90. data/spec/models/status_spec.rb +6 -0
  91. data/spec/models/task_spec.rb +12 -0
  92. data/spec/models/user_project_participation_spec.rb +7 -0
  93. data/spec/models/user_spec.rb +12 -0
  94. data/spec/models/version_spec.rb +5 -0
  95. data/spec/rails_helper.rb +15 -0
  96. data/spec/spec_helper.rb +10 -9
  97. data/spec/support/test_app/Rakefile +3 -0
  98. data/spec/support/test_app/app/assets/javascripts/application.js +20 -0
  99. data/spec/support/test_app/app/assets/javascripts/common.js.coffee +6 -0
  100. data/spec/support/test_app/app/assets/javascripts/jquery.ui.datepicker.locales.js +56 -0
  101. data/spec/support/test_app/app/assets/stylesheets/adding_rows.scss +3 -0
  102. data/spec/support/test_app/app/assets/stylesheets/application.scss +46 -0
  103. data/spec/support/test_app/app/assets/stylesheets/csv_and_detached_filters.scss +3 -0
  104. data/spec/support/test_app/app/assets/stylesheets/many_grids_on_page.scss +3 -0
  105. data/spec/support/test_app/app/controllers/action_column_controller.rb +15 -0
  106. data/spec/support/test_app/app/controllers/adding_rows_controller.rb +14 -0
  107. data/spec/support/test_app/app/controllers/all_records_controller.rb +14 -0
  108. data/spec/support/test_app/app/controllers/application_controller.rb +99 -0
  109. data/spec/support/test_app/app/controllers/auto_reloads2_controller.rb +14 -0
  110. data/spec/support/test_app/app/controllers/auto_reloads3_controller.rb +20 -0
  111. data/spec/support/test_app/app/controllers/auto_reloads_controller.rb +14 -0
  112. data/spec/support/test_app/app/controllers/basics1_controller.rb +6 -0
  113. data/spec/support/test_app/app/controllers/basics2_controller.rb +6 -0
  114. data/spec/support/test_app/app/controllers/basics3_controller.rb +6 -0
  115. data/spec/support/test_app/app/controllers/basics4_controller.rb +6 -0
  116. data/spec/support/test_app/app/controllers/basics5_controller.rb +6 -0
  117. data/spec/support/test_app/app/controllers/basics6_controller.rb +11 -0
  118. data/spec/support/test_app/app/controllers/blockless_column_definition_controller.rb +6 -0
  119. data/spec/support/test_app/app/controllers/buttons_controller.rb +6 -0
  120. data/spec/support/test_app/app/controllers/csv_and_detached_filters_controller.rb +13 -0
  121. data/spec/support/test_app/app/controllers/csv_export_controller.rb +28 -0
  122. data/spec/support/test_app/app/controllers/custom_filter_params_controller.rb +6 -0
  123. data/spec/support/test_app/app/controllers/custom_filters1_controller.rb +9 -0
  124. data/spec/support/test_app/app/controllers/custom_filters2_controller.rb +14 -0
  125. data/spec/support/test_app/app/controllers/custom_filters3_controller.rb +12 -0
  126. data/spec/support/test_app/app/controllers/custom_filters4_controller.rb +12 -0
  127. data/spec/support/test_app/app/controllers/custom_ordering_controller.rb +18 -0
  128. data/spec/support/test_app/app/controllers/custom_ordering_on_calculated_controller.rb +6 -0
  129. data/spec/support/test_app/app/controllers/custom_ordering_with_arel_controller.rb +18 -0
  130. data/spec/support/test_app/app/controllers/custom_ordering_with_proc_controller.rb +11 -0
  131. data/spec/support/test_app/app/controllers/custom_ordering_with_ruby_controller.rb +6 -0
  132. data/spec/support/test_app/app/controllers/dates_controller.rb +8 -0
  133. data/spec/support/test_app/app/controllers/detached_filters_controller.rb +6 -0
  134. data/spec/support/test_app/app/controllers/detached_filters_two_grids_controller.rb +7 -0
  135. data/spec/support/test_app/app/controllers/disable_all_filters_controller.rb +6 -0
  136. data/spec/support/test_app/app/controllers/hiding_checkboxes_in_action_column_controller.rb +13 -0
  137. data/spec/support/test_app/app/controllers/home_controller.rb +3 -0
  138. data/spec/support/test_app/app/controllers/integration_with_application_view_controller.rb +16 -0
  139. data/spec/support/test_app/app/controllers/integration_with_forms_controller.rb +11 -0
  140. data/spec/support/test_app/app/controllers/joining_tables_controller.rb +11 -0
  141. data/spec/support/test_app/app/controllers/localization_controller.rb +26 -0
  142. data/spec/support/test_app/app/controllers/many_grids_on_page_controller.rb +7 -0
  143. data/spec/support/test_app/app/controllers/negation_controller.rb +14 -0
  144. data/spec/support/test_app/app/controllers/no_records_controller.rb +8 -0
  145. data/spec/support/test_app/app/controllers/null_values_controller.rb +10 -0
  146. data/spec/support/test_app/app/controllers/numeric_filters_controller.rb +6 -0
  147. data/spec/support/test_app/app/controllers/queries_controller.rb +4 -0
  148. data/spec/support/test_app/app/controllers/resultset_processings2_controller.rb +29 -0
  149. data/spec/support/test_app/app/controllers/resultset_processings_controller.rb +30 -0
  150. data/spec/support/test_app/app/controllers/saved_queries_controller.rb +14 -0
  151. data/spec/support/test_app/app/controllers/styling_controller.rb +7 -0
  152. data/spec/support/test_app/app/controllers/tasks_controller.rb +14 -0
  153. data/spec/support/test_app/app/controllers/two_associations_controller.rb +6 -0
  154. data/spec/support/test_app/app/controllers/upper_pagination_panel_controller.rb +6 -0
  155. data/spec/support/test_app/app/controllers/when_filtered_controller.rb +6 -0
  156. data/spec/support/test_app/app/helpers/application_helper.rb +82 -0
  157. data/spec/support/test_app/app/mailers/.gitkeep +0 -0
  158. data/spec/support/test_app/app/models/.gitkeep +0 -0
  159. data/spec/support/test_app/app/models/company.rb +5 -0
  160. data/spec/support/test_app/app/models/populate.rb +84 -0
  161. data/spec/support/test_app/app/models/priority.rb +10 -0
  162. data/spec/support/test_app/app/models/project.rb +14 -0
  163. data/spec/support/test_app/app/models/project_role.rb +3 -0
  164. data/spec/support/test_app/app/models/status.rb +10 -0
  165. data/spec/support/test_app/app/models/task.rb +11 -0
  166. data/spec/support/test_app/app/models/to_dropdown_mixin.rb +16 -0
  167. data/spec/support/test_app/app/models/user.rb +8 -0
  168. data/spec/support/test_app/app/models/user_project_participation.rb +6 -0
  169. data/spec/support/test_app/app/models/version.rb +6 -0
  170. data/spec/support/test_app/app/views/action_column/_grid.html.erb +35 -0
  171. data/spec/support/test_app/app/views/action_column/index.html.haml +45 -0
  172. data/spec/support/test_app/app/views/adding_rows/_grid.html.erb +58 -0
  173. data/spec/support/test_app/app/views/adding_rows/index.html.haml +37 -0
  174. data/spec/support/test_app/app/views/all_records/_grid.html.erb +30 -0
  175. data/spec/support/test_app/app/views/all_records/index.html.haml +12 -0
  176. data/spec/support/test_app/app/views/auto_reloads/_grid.html.erb +32 -0
  177. data/spec/support/test_app/app/views/auto_reloads/index.html.haml +15 -0
  178. data/spec/support/test_app/app/views/auto_reloads2/_grid.html.erb +32 -0
  179. data/spec/support/test_app/app/views/auto_reloads2/index.html.haml +65 -0
  180. data/spec/support/test_app/app/views/auto_reloads3/_grid.html.erb +25 -0
  181. data/spec/support/test_app/app/views/auto_reloads3/index.html.haml +78 -0
  182. data/spec/support/test_app/app/views/basics1/_grid.html.erb +26 -0
  183. data/spec/support/test_app/app/views/basics1/index.html.haml +13 -0
  184. data/spec/support/test_app/app/views/basics2/_grid.html.erb +27 -0
  185. data/spec/support/test_app/app/views/basics2/index.html.haml +12 -0
  186. data/spec/support/test_app/app/views/basics3/_grid.html.erb +28 -0
  187. data/spec/support/test_app/app/views/basics3/index.html.haml +13 -0
  188. data/spec/support/test_app/app/views/basics4/_grid.html.erb +21 -0
  189. data/spec/support/test_app/app/views/basics4/index.html.haml +12 -0
  190. data/spec/support/test_app/app/views/basics5/_grid.html.erb +19 -0
  191. data/spec/support/test_app/app/views/basics5/index.html.haml +12 -0
  192. data/spec/support/test_app/app/views/basics6/_grid.html.erb +19 -0
  193. data/spec/support/test_app/app/views/basics6/index.html.haml +23 -0
  194. data/spec/support/test_app/app/views/blockless_column_definition/_grid.html.erb +19 -0
  195. data/spec/support/test_app/app/views/blockless_column_definition/index.html.haml +15 -0
  196. data/spec/support/test_app/app/views/buttons/_grid.html.erb +20 -0
  197. data/spec/support/test_app/app/views/buttons/index.html.haml +30 -0
  198. data/spec/support/test_app/app/views/csv_and_detached_filters/_grid.html.erb +23 -0
  199. data/spec/support/test_app/app/views/csv_and_detached_filters/index.html.haml +58 -0
  200. data/spec/support/test_app/app/views/csv_export/_projects_grid.html.erb +17 -0
  201. data/spec/support/test_app/app/views/csv_export/_tasks_grid.html.erb +43 -0
  202. data/spec/support/test_app/app/views/csv_export/index.html.haml +90 -0
  203. data/spec/support/test_app/app/views/custom_filter_params/_grid.html.erb +12 -0
  204. data/spec/support/test_app/app/views/custom_filter_params/index.html.haml +12 -0
  205. data/spec/support/test_app/app/views/custom_filters1/_g1.html.erb +8 -0
  206. data/spec/support/test_app/app/views/custom_filters1/_g2.html.erb +9 -0
  207. data/spec/support/test_app/app/views/custom_filters1/_g3.html.erb +9 -0
  208. data/spec/support/test_app/app/views/custom_filters1/_g4.html.erb +8 -0
  209. data/spec/support/test_app/app/views/custom_filters1/index.html.haml +30 -0
  210. data/spec/support/test_app/app/views/custom_filters2/_grid.html.erb +30 -0
  211. data/spec/support/test_app/app/views/custom_filters2/index.html.haml +41 -0
  212. data/spec/support/test_app/app/views/custom_filters3/_grid.html.erb +18 -0
  213. data/spec/support/test_app/app/views/custom_filters3/index.html.haml +16 -0
  214. data/spec/support/test_app/app/views/custom_filters4/_grid.html.erb +20 -0
  215. data/spec/support/test_app/app/views/custom_filters4/index.html.haml +12 -0
  216. data/spec/support/test_app/app/views/custom_ordering/_grid.html.erb +10 -0
  217. data/spec/support/test_app/app/views/custom_ordering/index.html.haml +24 -0
  218. data/spec/support/test_app/app/views/custom_ordering_on_calculated/_grid.html.erb +14 -0
  219. data/spec/support/test_app/app/views/custom_ordering_on_calculated/index.html.haml +23 -0
  220. data/spec/support/test_app/app/views/custom_ordering_with_arel/_grid.html.erb +10 -0
  221. data/spec/support/test_app/app/views/custom_ordering_with_arel/index.html.haml +24 -0
  222. data/spec/support/test_app/app/views/custom_ordering_with_proc/_grid.html.erb +10 -0
  223. data/spec/support/test_app/app/views/custom_ordering_with_proc/index.html.haml +21 -0
  224. data/spec/support/test_app/app/views/custom_ordering_with_ruby/_grid.html.erb +10 -0
  225. data/spec/support/test_app/app/views/custom_ordering_with_ruby/index.html.haml +23 -0
  226. data/spec/support/test_app/app/views/dates/_grid.html.erb +25 -0
  227. data/spec/support/test_app/app/views/dates/index.html.haml +52 -0
  228. data/spec/support/test_app/app/views/detached_filters/_grid.html.erb +23 -0
  229. data/spec/support/test_app/app/views/detached_filters/index.html.haml +79 -0
  230. data/spec/support/test_app/app/views/detached_filters_two_grids/_grid.html.erb +23 -0
  231. data/spec/support/test_app/app/views/detached_filters_two_grids/index.html.haml +85 -0
  232. data/spec/support/test_app/app/views/disable_all_filters/_grid.html.erb +21 -0
  233. data/spec/support/test_app/app/views/disable_all_filters/index.html.haml +14 -0
  234. data/spec/support/test_app/app/views/hiding_checkboxes_in_action_column/_grid.html.erb +34 -0
  235. data/spec/support/test_app/app/views/hiding_checkboxes_in_action_column/index.html.haml +32 -0
  236. data/spec/support/test_app/app/views/integration_with_application_view/_grid.html.erb +27 -0
  237. data/spec/support/test_app/app/views/integration_with_application_view/index.html.haml +33 -0
  238. data/spec/support/test_app/app/views/integration_with_forms/_grid.html.erb +23 -0
  239. data/spec/support/test_app/app/views/integration_with_forms/index.html.haml +18 -0
  240. data/spec/support/test_app/app/views/joining_tables/_grid.html.erb +23 -0
  241. data/spec/support/test_app/app/views/joining_tables/index.html.haml +26 -0
  242. data/spec/support/test_app/app/views/layouts/application.html.haml +61 -0
  243. data/spec/support/test_app/app/views/localization/_grid.html.erb +36 -0
  244. data/spec/support/test_app/app/views/localization/index.html.haml +20 -0
  245. data/spec/support/test_app/app/views/many_grids_on_page/_tasks_grid1.html.erb +12 -0
  246. data/spec/support/test_app/app/views/many_grids_on_page/_tasks_grid2.html.erb +12 -0
  247. data/spec/support/test_app/app/views/many_grids_on_page/index.html.haml +26 -0
  248. data/spec/support/test_app/app/views/negation/_grid.html.erb +30 -0
  249. data/spec/support/test_app/app/views/negation/index.html.haml +15 -0
  250. data/spec/support/test_app/app/views/no_records/_empty_grid.html.haml +1 -0
  251. data/spec/support/test_app/app/views/no_records/_grid1.html.erb +11 -0
  252. data/spec/support/test_app/app/views/no_records/_grid2.html.erb +9 -0
  253. data/spec/support/test_app/app/views/no_records/_grid3.html.erb +9 -0
  254. data/spec/support/test_app/app/views/no_records/index.html.haml +24 -0
  255. data/spec/support/test_app/app/views/null_values/_grid.html.erb +17 -0
  256. data/spec/support/test_app/app/views/null_values/index.html.haml +21 -0
  257. data/spec/support/test_app/app/views/numeric_filters/_grid.html.erb +19 -0
  258. data/spec/support/test_app/app/views/numeric_filters/index.html.haml +12 -0
  259. data/spec/support/test_app/app/views/resultset_processings/_grid.html.erb +27 -0
  260. data/spec/support/test_app/app/views/resultset_processings/index.html.haml +50 -0
  261. data/spec/support/test_app/app/views/resultset_processings2/_grid.html.erb +27 -0
  262. data/spec/support/test_app/app/views/resultset_processings2/index.html.haml +48 -0
  263. data/spec/support/test_app/app/views/saved_queries/_grid.html.erb +30 -0
  264. data/spec/support/test_app/app/views/saved_queries/index.html.haml +15 -0
  265. data/spec/support/test_app/app/views/styling/_grid1.html.erb +12 -0
  266. data/spec/support/test_app/app/views/styling/_grid2.html.erb +31 -0
  267. data/spec/support/test_app/app/views/styling/index.html.haml +65 -0
  268. data/spec/support/test_app/app/views/tasks/_grid.html.erb +19 -0
  269. data/spec/support/test_app/app/views/tasks/index.html.haml +1 -0
  270. data/spec/support/test_app/app/views/two_associations/_grid.html.erb +13 -0
  271. data/spec/support/test_app/app/views/two_associations/index.html.haml +13 -0
  272. data/spec/support/test_app/app/views/upper_pagination_panel/_grid.html.erb +27 -0
  273. data/spec/support/test_app/app/views/upper_pagination_panel/index.html.haml +14 -0
  274. data/spec/support/test_app/app/views/when_filtered/_grid.html.erb +19 -0
  275. data/spec/support/test_app/app/views/when_filtered/index.html.haml +15 -0
  276. data/spec/support/test_app/bin/rails +4 -0
  277. data/spec/support/test_app/bin/rake +4 -0
  278. data/spec/support/test_app/config.ru +5 -0
  279. data/spec/support/test_app/config/application.rb +70 -0
  280. data/spec/support/test_app/config/boot.rb +7 -0
  281. data/spec/support/test_app/config/database.travis.yml +27 -0
  282. data/spec/support/test_app/config/database.yml +16 -0
  283. data/spec/support/test_app/config/database.yml.mysql +19 -0
  284. data/spec/support/test_app/config/database.yml.postgresql +18 -0
  285. data/spec/support/test_app/config/environment.rb +6 -0
  286. data/spec/support/test_app/config/environments/development.rb +34 -0
  287. data/spec/support/test_app/config/environments/production.rb +66 -0
  288. data/spec/support/test_app/config/environments/test.rb +34 -0
  289. data/spec/support/test_app/config/initializers/backtrace_silencers.rb +8 -0
  290. data/spec/support/test_app/config/initializers/inflections.rb +16 -0
  291. data/spec/support/test_app/config/initializers/mime_types.rb +6 -0
  292. data/spec/support/test_app/config/initializers/secret_token.rb +12 -0
  293. data/spec/support/test_app/config/initializers/session_store.rb +9 -0
  294. data/spec/support/test_app/config/initializers/wice_grid_config.rb +163 -0
  295. data/spec/support/test_app/config/initializers/wrap_parameters.rb +15 -0
  296. data/spec/support/test_app/config/locales/en.yml +5 -0
  297. data/spec/support/test_app/config/locales/wice_grid.yml +550 -0
  298. data/spec/support/test_app/config/puma.rb +15 -0
  299. data/spec/support/test_app/config/routes.rb +125 -0
  300. data/spec/support/test_app/db/migrate/20120224193505_create_tasks.rb +27 -0
  301. data/spec/support/test_app/db/migrate/20120224193517_create_users.rb +12 -0
  302. data/spec/support/test_app/db/migrate/20120224193522_create_projects.rb +14 -0
  303. data/spec/support/test_app/db/migrate/20120224193529_create_priorities.rb +13 -0
  304. data/spec/support/test_app/db/migrate/20120224193537_create_statuses.rb +13 -0
  305. data/spec/support/test_app/db/migrate/20120224193543_create_versions.rb +15 -0
  306. data/spec/support/test_app/db/migrate/20120224193550_create_project_roles.rb +12 -0
  307. data/spec/support/test_app/db/migrate/20120224193610_create_companies.rb +12 -0
  308. data/spec/support/test_app/db/migrate/20120224195351_create_user_project_participations.rb +16 -0
  309. data/spec/support/test_app/db/migrate/20120224195521_add_tasks_users.rb +11 -0
  310. data/spec/support/test_app/db/migrate/20120610091944_create_wice_grid_serialized_queries.rb +14 -0
  311. data/spec/support/test_app/db/schema.rb +139 -0
  312. data/spec/support/test_app/db/seeds.rb +10 -0
  313. data/spec/support/test_app/lib/ar_fixtures.rb +100 -0
  314. data/spec/support/test_app/lib/assets/.gitkeep +0 -0
  315. data/spec/support/test_app/lib/tasks/.gitkeep +0 -0
  316. data/spec/support/test_app/lib/tasks/ar_fixtures.rake +45 -0
  317. data/spec/support/test_app/public/404.html +26 -0
  318. data/spec/support/test_app/public/422.html +26 -0
  319. data/spec/support/test_app/public/500.html +25 -0
  320. data/spec/support/test_app/public/favicon.ico +0 -0
  321. data/spec/support/test_app/public/robots.txt +5 -0
  322. data/spec/wice/grid_output_buffer_spec.rb +2 -2
  323. data/spec/wice/table_column_matrix_spec.rb +1 -1
  324. data/vendor/assets/javascripts/wice_grid_init.js.coffee +16 -4
  325. data/vendor/assets/javascripts/wice_grid_saved_queries_init.js.coffee +1 -0
  326. data/wice_grid.gemspec +29 -9
  327. metadata +606 -62
  328. data/release_notes/RELEASE_NOTES_3.2.pre1.rdoc +0 -81
  329. data/release_notes/RELEASE_NOTES_3.2.pre2.rdoc +0 -6
  330. data/release_notes/RELEASE_NOTES_3.3.0.rdoc +0 -21
  331. data/spec/support/wice_grid_test_config.rb +0 -173
  332. data/test/readme.txt +0 -1
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+ require 'acceptance_helper'
3
+
4
+ describe 'disable_all_filters WiceGrid', type: :request, js: true do
5
+ before :each do
6
+ visit '/disable_all_filters'
7
+ end
8
+
9
+ it 'should not have disabled filters' do
10
+ expect(page).to have_no_selector('#grid_f_id_fr')
11
+ expect(page).to have_no_selector('#grid_f_id_to')
12
+ expect(page).to have_no_selector('#grid_f_description')
13
+ expect(page).to have_no_selector('#grid_f_created_at_fr_year')
14
+ expect(page).to have_no_selector('#grid_f_created_at_fr_month')
15
+
16
+ expect(page).to have_no_selector('#grid_f_created_at_to_year')
17
+ expect(page).to have_no_selector('#grid_f_created_at_to_month')
18
+
19
+ expect(page).to have_no_selector('#grid_f_title')
20
+ expect(page).to have_no_selector('#grid_f_archived')
21
+ end
22
+ end
@@ -0,0 +1,294 @@
1
+ # encoding: utf-8
2
+ require 'acceptance_helper'
3
+
4
+ describe 'action_column WiceGrid', type: :request, js: true do
5
+ before :each do
6
+ visit '/hiding_checkboxes_in_action_column'
7
+ end
8
+
9
+ it 'there must be no checkboxes for tasks with the Assigned status' do
10
+ select 'Assigned', from: 'g_f_status_id'
11
+ find(:css, '#g_submit_grid_icon').click
12
+
13
+ expect(page).to have_content('1-4 / 4')
14
+ expect(page).to have_no_selector('tbody input[type=checkbox]')
15
+ end
16
+
17
+ it 'should select rows' do
18
+ 510.upto(520).each do |i|
19
+ find(:css, %(input[type="checkbox"][value="#{i}"])).click unless i == 519
20
+ end
21
+
22
+ first(:css, 'button.btn', text: 'Process tasks').click
23
+
24
+ expect(page).to have_content('Selected tasks: 510, 511, 512, 513, 514, 515, 516, 517, 518, and 520')
25
+ end
26
+
27
+ it 'should select rows with the select all button and deselect them with the deselect button' do
28
+ find(:css, %(.clickable.select-all)).click
29
+
30
+ first(:css, 'button.btn', text: 'Process tasks').click
31
+
32
+ expect(page).to have_content('Selected tasks: 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, and 526')
33
+
34
+ find(:css, %(.clickable.deselect-all)).click
35
+
36
+ first(:css, 'button.btn', text: 'Process tasks').click
37
+
38
+ expect(page).to have_no_content('Selected tasks: 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 520, 521, 522, 523, 524, 525, and 526')
39
+ end
40
+
41
+ it 'should keep the state of filter inside a form' do
42
+ end
43
+
44
+ it 'should filter by ID inside a form, two limits' do
45
+ fill_in('g_f_id_fr', with: 507)
46
+ fill_in('g_f_id_to', with: 509)
47
+
48
+ first(:css, 'button.btn', text: 'Process tasks').click
49
+
50
+ within '.pagination_status' do
51
+ expect(page).to have_content('1-3 / 3')
52
+ end
53
+
54
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
55
+ expect(page).to have_content('507')
56
+ end
57
+
58
+ expect(page).to have_content('508')
59
+ expect(page).to have_content('509')
60
+
61
+ within 'div.wice-grid-container table.wice-grid thead' do
62
+ click_on 'ID'
63
+ end
64
+
65
+ within '.pagination_status' do
66
+ expect(page).to have_content('1-3 / 3')
67
+ end
68
+
69
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.sorted.active-filter' do
70
+ expect(page).to have_content('509')
71
+ end
72
+
73
+ expect(page).to have_content('508')
74
+ expect(page).to have_content('509')
75
+
76
+ within 'div.wice-grid-container table.wice-grid thead' do
77
+ click_on 'ID'
78
+ end
79
+
80
+ within '.pagination_status' do
81
+ expect(page).to have_content('1-3 / 3')
82
+ end
83
+
84
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.sorted' do
85
+ expect(page).to have_content('507')
86
+ end
87
+
88
+ within 'div.wice-grid-container table.wice-grid thead' do
89
+ click_on 'Title'
90
+ end
91
+
92
+ within '.pagination_status' do
93
+ expect(page).to have_content('1-3 / 3')
94
+ end
95
+ end
96
+
97
+ it 'should filter by Archived inside a form' do
98
+ select 'yes', from: 'g_f_archived'
99
+ first(:css, 'button.btn', text: 'Process tasks').click
100
+
101
+ within '.pagination_status' do
102
+ expect(page).to have_content('1-4 / 4')
103
+ end
104
+
105
+ within first(:css, 'td.active-filter') do
106
+ expect(page).to have_content('Yes')
107
+ end
108
+
109
+ select 'no', from: 'g_f_archived'
110
+ first(:css, 'button.btn', text: 'Process tasks').click
111
+
112
+ within '.pagination_status' do
113
+ expect(page).to have_content('1-20 / 46')
114
+ end
115
+
116
+ within first(:css, 'td.active-filter') do
117
+ expect(page).to have_content('No')
118
+ end
119
+
120
+ within 'ul.pagination' do
121
+ click_link '2'
122
+ end
123
+
124
+ within '.pagination_status' do
125
+ expect(page).to have_content('21-40 / 46')
126
+ end
127
+
128
+ within first(:css, 'td.active-filter') do
129
+ expect(page).to have_content('No')
130
+ end
131
+ end
132
+
133
+ it 'should filter by Added inside a form' do
134
+ set_datepicker(self, 'g_f_created_at_fr_date_placeholder', 2011, 5, 1)
135
+
136
+ set_datepicker(self, 'g_f_created_at_to_date_placeholder', 2011, 9, 1)
137
+
138
+ first(:css, 'button.btn', text: 'Process tasks').click
139
+
140
+ within '.pagination_status' do
141
+ expect(page).to have_content('1-20 / 29')
142
+ end
143
+
144
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
145
+ expect(page).to have_content('2011-09-13 22:11:12')
146
+ end
147
+
148
+ within 'div.wice-grid-container table.wice-grid thead' do
149
+ click_on 'ID'
150
+ end
151
+
152
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
153
+ expect(page).to have_content('2011-09-29 22:11:12')
154
+ end
155
+
156
+ within '.pagination_status' do
157
+ expect(page).to have_content('1-20 / 29')
158
+ end
159
+
160
+ within 'ul.pagination' do
161
+ click_link '2'
162
+ end
163
+
164
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
165
+ expect(page).to have_content('2011-09-22 22:11:12')
166
+ end
167
+ end
168
+
169
+ it 'should filter by Due Date' do
170
+ set_datepicker(self, 'g_f_due_date_fr_date_placeholder', 2012, 0, 1)
171
+
172
+ set_datepicker(self, 'g_f_due_date_to_date_placeholder', 2013, 0, 1)
173
+
174
+ first(:css, 'button.btn', text: 'Process tasks').click
175
+
176
+ within '.pagination_status' do
177
+ expect(page).to have_content('1-20 / 35')
178
+ end
179
+
180
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
181
+ expect(page).to have_content('2012-07-29')
182
+ end
183
+
184
+ within 'div.wice-grid-container table.wice-grid thead' do
185
+ click_on 'ID'
186
+ end
187
+
188
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
189
+ expect(page).to have_content('2012-10-02')
190
+ end
191
+
192
+ within '.pagination_status' do
193
+ expect(page).to have_content('1-20 / 35')
194
+ end
195
+
196
+ within 'ul.pagination' do
197
+ click_link '2'
198
+ end
199
+
200
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
201
+ expect(page).to have_content('2012-07-02')
202
+ end
203
+
204
+ set_datepicker(self, 'g_f_due_date_fr_date_placeholder', 2012, 6, 28)
205
+
206
+ set_datepicker(self, 'g_f_due_date_to_date_placeholder', 2012, 6, 31)
207
+
208
+ first(:css, 'button.btn', text: 'Process tasks').click
209
+
210
+ within '.pagination_status' do
211
+ expect(page).to have_content('1-1 / 1')
212
+ end
213
+
214
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
215
+ expect(page).to have_content('2012-07-29')
216
+ end
217
+
218
+ find(:css, '#g_f_due_date_fr_date_view').click
219
+
220
+ first(:css, 'button.btn', text: 'Process tasks').click
221
+
222
+ within '.pagination_status' do
223
+ expect(page).to have_content('1-10 / 10')
224
+ end
225
+
226
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
227
+ expect(page).to have_content('2012-07-29')
228
+ end
229
+
230
+ find(:css, '#g_f_due_date_to_date_view').click
231
+
232
+ first(:css, 'button.btn', text: 'Process tasks').click
233
+
234
+ within '.pagination_status' do
235
+ expect(page).to have_content('1-20 / 50')
236
+ end
237
+ end
238
+
239
+ it 'should negate the semantics of the text filter inside a form' do
240
+ fill_in('g_f_title_v', with: 'sed')
241
+ select 'no', from: 'g_f_archived'
242
+
243
+ first(:css, 'button.btn', text: 'Process tasks').click
244
+
245
+ expect(page).to have_content('sed impedit iste')
246
+
247
+ find(:css, '#g_f_title_n').click
248
+
249
+ first(:css, 'button.btn', text: 'Process tasks').click
250
+
251
+ expect(page).to have_no_content('sed impedit iste')
252
+ end
253
+
254
+ it 'should reload the title filter' do
255
+ fill_in('g_f_title_v', with: 'ed')
256
+
257
+ first(:css, 'button.btn', text: 'Process tasks').click
258
+
259
+ within '.pagination_status' do
260
+ expect(page).to have_content('1-2 / 2')
261
+ end
262
+
263
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
264
+ expect(page).to have_content('sed impedit iste')
265
+ end
266
+
267
+ expect(page).to have_content('corporis expedita vel')
268
+
269
+ within 'div.wice-grid-container table.wice-grid thead' do
270
+ click_on 'Title'
271
+ end
272
+
273
+ within '.pagination_status' do
274
+ expect(page).to have_content('1-2 / 2')
275
+ end
276
+
277
+ within 'div.wice-grid-container table.wice-grid tbody tr:first-child td.active-filter' do
278
+ expect(page).to have_content('corporis expedita vel')
279
+ end
280
+
281
+ expect(page).to have_content('sed impedit iste')
282
+
283
+ within 'div.wice-grid-container table.wice-grid thead' do
284
+ click_on 'ID'
285
+ end
286
+
287
+ within '.pagination_status' do
288
+ expect(page).to have_content('1-2 / 2')
289
+ end
290
+
291
+ expect(page).to have_content('corporis expedita vel')
292
+ expect(page).to have_content('sed impedit iste')
293
+ end
294
+ end
@@ -0,0 +1,43 @@
1
+ # encoding: utf-8
2
+ require 'acceptance_helper'
3
+
4
+ describe 'current_page_records & all_pages_records WiceGrid', type: :request, js: true do
5
+ before :each do
6
+ visit '/integration_with_application_view'
7
+ end
8
+
9
+ it 'should return records displayed on the page and throughout all pages' do
10
+ all_records_current_page_text = '10 records on the current page: 507, 519, 537, 540, 511, 515, 523, 524, 527, and 531'
11
+ all_records_all_pages_text = '50 records throughout all pages: 507, 519, 537, 540, 511, 515, 523, 524, 527, 531, 542, 551, 518, 520, 532, 535, 539, 512, 514, 516, 521, 522, 543, 544, 546, 550, 552, 510, 541, 553, 508, 513, 528, 529, 548, 556, 525, 534, 547, 555, 509, 517, 526, 536, 538, 545, 549, 530, 533, and 554'
12
+
13
+ expect(page).to have_content(all_records_current_page_text)
14
+ expect(page).to have_content(all_records_all_pages_text)
15
+
16
+ fill_in('g_f_title', with: 'ed')
17
+
18
+ expect(page).to have_content('2 records throughout all pages: 507 and 534')
19
+ expect(page).to have_content('2 records on the current page: 507 and 534')
20
+
21
+ find(:css, '#g_reset_grid_icon').click
22
+
23
+ expect(page).to have_field('g_f_title', with: '')
24
+ expect(page).to have_content(all_records_current_page_text)
25
+ expect(page).to have_content(all_records_all_pages_text)
26
+
27
+ select 'Cancelled', from: 'g_f_status_id'
28
+
29
+ expect(page).to have_content('8 records on the current page: 511, 515, 523, 524, 527, 531, 542, and 551')
30
+ expect(page).to have_content('8 records throughout all pages: 511, 515, 523, 524, 527, 531, 542, and 551')
31
+
32
+ find(:css, '#g_reset_grid_icon').click
33
+
34
+ expect(page).to have_select('g_f_status_id', selected: '--')
35
+ expect(page).to have_content(all_records_current_page_text)
36
+ expect(page).to have_content(all_records_all_pages_text)
37
+
38
+ select 'no', from: 'g_f_archived'
39
+
40
+ expect(page).to have_content('10 records on the current page: 507, 519, 537, 540, 511, 515, 523, 527, 531, and 542')
41
+ expect(page).to have_content('46 records throughout all pages: 507, 519, 537, 540, 511, 515, 523, 527, 531, 542, 551, 518, 520, 532, 535, 539, 512, 514, 516, 521, 522, 543, 544, 546, 552, 510, 541, 553, 508, 528, 529, 548, 556, 525, 534, 547, 555, 509, 517, 526, 536, 538, 545, 549, 530, and 554')
42
+ end
43
+ end
@@ -0,0 +1,141 @@
1
+ # encoding: utf-8
2
+ require 'acceptance_helper'
3
+
4
+ describe 'dump_filter_parameters_as_hidden_fields WiceGrid', type: :request, js: true do
5
+ before :each do
6
+ visit '/integration_with_forms'
7
+ end
8
+
9
+ it 'should reload the page' do
10
+ within '.pagination_status' do
11
+ expect(page).to have_content('1-20 / 46')
12
+ end
13
+
14
+ select 'View archived tasks', from: 'archived'
15
+
16
+ within '.pagination_status' do
17
+ expect(page).to have_content('1-4 / 4')
18
+ end
19
+
20
+ select 'View active tasks', from: 'archived'
21
+
22
+ within '.pagination_status' do
23
+ expect(page).to have_content('1-20 / 46')
24
+ end
25
+ end
26
+
27
+ it 'should keep the state of an integer filter while reloading another form' do
28
+ fill_in('g_f_id_fr', with: 507)
29
+ fill_in('g_f_id_to', with: 509)
30
+
31
+ find(:css, '#g_submit_grid_icon').click
32
+
33
+ within '.pagination_status' do
34
+ expect(page).to have_content('1-3 / 3')
35
+ end
36
+
37
+ select 'View archived tasks', from: 'archived'
38
+
39
+ within '.pagination_status' do
40
+ expect(page).to have_content('0')
41
+ end
42
+
43
+ select 'View active tasks', from: 'archived'
44
+
45
+ within '.pagination_status' do
46
+ expect(page).to have_content('1-3 / 3')
47
+ end
48
+ end
49
+
50
+ it 'should keep the state of a string filter while reloading another form' do
51
+ fill_in('g_f_title_v', with: 'ed')
52
+
53
+ find(:css, '#g_submit_grid_icon').click
54
+
55
+ within '.pagination_status' do
56
+ expect(page).to have_content('1-2 / 2')
57
+ end
58
+
59
+ select 'View archived tasks', from: 'archived'
60
+
61
+ within '.pagination_status' do
62
+ expect(page).to have_content('0')
63
+ end
64
+
65
+ select 'View active tasks', from: 'archived'
66
+
67
+ within '.pagination_status' do
68
+ expect(page).to have_content('1-2 / 2')
69
+ end
70
+ end
71
+
72
+ it 'should keep the state of a string filter with negation while reloading another form' do
73
+ fill_in('g_f_title_v', with: 'ed')
74
+ find(:css, '#g_f_title_n').click
75
+
76
+ find(:css, '#g_submit_grid_icon').click
77
+
78
+ within '.pagination_status' do
79
+ expect(page).to have_content('1-20 / 44')
80
+ end
81
+
82
+ select 'View archived tasks', from: 'archived'
83
+
84
+ within '.pagination_status' do
85
+ expect(page).to have_content('1-4 / 4')
86
+ end
87
+
88
+ select 'View active tasks', from: 'archived'
89
+
90
+ within '.pagination_status' do
91
+ expect(page).to have_content('1-20 / 44')
92
+ end
93
+ end
94
+
95
+ it 'should keep the state of a custom filter with negation while reloading another form' do
96
+ select 'Cancelled', from: 'g_f_status_id'
97
+ select 'Super Game', from: 'g_f_project_id'
98
+
99
+ find(:css, '#g_submit_grid_icon').click
100
+
101
+ within '.pagination_status' do
102
+ expect(page).to have_content('1-4 / 4')
103
+ end
104
+
105
+ select 'View archived tasks', from: 'archived'
106
+
107
+ within '.pagination_status' do
108
+ expect(page).to have_content('0')
109
+ end
110
+
111
+ select 'View active tasks', from: 'archived'
112
+
113
+ within '.pagination_status' do
114
+ expect(page).to have_content('1-4 / 4')
115
+ end
116
+ end
117
+
118
+ it 'should keep the state of a date filter while reloading another form' do
119
+ set_datepicker(self, 'g_f_due_date_fr_date_placeholder', 2013, 0, 1)
120
+
121
+ set_datepicker(self, 'g_f_due_date_to_date_placeholder', 2015, 0, 1)
122
+
123
+ find(:css, '#g_submit_grid_icon').click
124
+
125
+ within '.pagination_status' do
126
+ expect(page).to have_content('1-15 / 15')
127
+ end
128
+
129
+ select 'View archived tasks', from: 'archived'
130
+
131
+ within '.pagination_status' do
132
+ expect(page).to have_content('0')
133
+ end
134
+
135
+ select 'View active tasks', from: 'archived'
136
+
137
+ within '.pagination_status' do
138
+ expect(page).to have_content('1-15 / 15')
139
+ end
140
+ end
141
+ end