activeadmin 1.4.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activeadmin might be problematic. Click here for more details.

Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +92 -11
  3. data/CONTRIBUTING.md +12 -11
  4. data/README.md +34 -8
  5. data/app/assets/javascripts/active_admin/base.es6 +23 -0
  6. data/app/assets/javascripts/active_admin/ext/jquery-ui.es6 +7 -0
  7. data/app/assets/javascripts/active_admin/ext/jquery.es6 +9 -0
  8. data/app/assets/javascripts/active_admin/initializers/datepicker.es6 +16 -0
  9. data/app/assets/javascripts/active_admin/initializers/filters.es6 +45 -0
  10. data/app/assets/javascripts/active_admin/initializers/tabs.es6 +6 -0
  11. data/app/assets/javascripts/active_admin/lib/active_admin.es6 +41 -0
  12. data/app/assets/javascripts/active_admin/lib/batch_actions.es6 +55 -0
  13. data/app/assets/javascripts/active_admin/lib/checkbox-toggler.es6 +49 -0
  14. data/app/assets/javascripts/active_admin/lib/dropdown-menu.es6 +123 -0
  15. data/app/assets/javascripts/active_admin/lib/has_many.es6 +95 -0
  16. data/app/assets/javascripts/active_admin/lib/modal_dialog.es6 +61 -0
  17. data/app/assets/javascripts/active_admin/lib/per_page.es6 +47 -0
  18. data/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6 +36 -0
  19. data/app/assets/stylesheets/active_admin/_forms.scss +2 -14
  20. data/app/assets/stylesheets/active_admin/components/_status_tags.scss +0 -5
  21. data/app/assets/stylesheets/active_admin/components/_tabs.scss +1 -1
  22. data/app/assets/stylesheets/active_admin/mixins/_gradients.scss +1 -1
  23. data/app/views/active_admin/devise/confirmations/new.html.erb +1 -1
  24. data/app/views/active_admin/devise/passwords/edit.html.erb +1 -1
  25. data/app/views/active_admin/devise/passwords/new.html.erb +1 -1
  26. data/app/views/active_admin/devise/registrations/new.html.erb +1 -2
  27. data/app/views/active_admin/devise/shared/_error_messages.html.erb +15 -0
  28. data/app/views/active_admin/devise/unlocks/new.html.erb +1 -1
  29. data/app/views/layouts/active_admin_logged_out.html.erb +1 -1
  30. data/config/locales/bg.yml +0 -1
  31. data/config/locales/he.yml +0 -1
  32. data/config/locales/hu.yml +4 -0
  33. data/config/locales/lt.yml +2 -2
  34. data/config/locales/uk.yml +2 -0
  35. data/docs/0-installation.md +2 -2
  36. data/docs/13-authorization-adapter.md +4 -4
  37. data/docs/CNAME +1 -1
  38. data/docs/index.html +2 -2
  39. data/lib/active_admin/application.rb +8 -14
  40. data/lib/active_admin/application_settings.rb +3 -0
  41. data/lib/active_admin/asset_registration.rb +0 -8
  42. data/lib/active_admin/base_controller/authorization.rb +2 -4
  43. data/lib/active_admin/base_controller.rb +6 -6
  44. data/lib/active_admin/batch_actions/controller.rb +1 -1
  45. data/lib/active_admin/batch_actions/resource_extension.rb +4 -4
  46. data/lib/active_admin/callbacks.rb +1 -1
  47. data/lib/active_admin/csv_builder.rb +1 -1
  48. data/lib/active_admin/dependency.rb +7 -75
  49. data/lib/active_admin/dsl.rb +1 -8
  50. data/lib/active_admin/error.rb +1 -1
  51. data/lib/active_admin/filters/active_filter.rb +3 -1
  52. data/lib/active_admin/filters/active_sidebar.rb +5 -1
  53. data/lib/active_admin/filters/forms.rb +2 -2
  54. data/lib/active_admin/filters/formtastic_addons.rb +1 -1
  55. data/lib/active_admin/filters/resource_extension.rb +3 -3
  56. data/lib/active_admin/form_builder.rb +3 -3
  57. data/lib/active_admin/generators/boilerplate.rb +1 -1
  58. data/lib/active_admin/helpers/scope_chain.rb +1 -0
  59. data/lib/active_admin/inputs/datepicker_input.rb +1 -1
  60. data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
  61. data/lib/active_admin/menu_item.rb +1 -1
  62. data/lib/active_admin/namespace.rb +2 -2
  63. data/lib/active_admin/namespace_settings.rb +7 -4
  64. data/lib/active_admin/orm/active_record/comments/comment.rb +2 -2
  65. data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +10 -5
  66. data/lib/active_admin/orm/active_record/comments.rb +4 -4
  67. data/lib/active_admin/page_dsl.rb +1 -1
  68. data/lib/active_admin/pundit_adapter.rb +13 -4
  69. data/lib/active_admin/resource/action_items.rb +1 -1
  70. data/lib/active_admin/resource/attributes.rb +7 -4
  71. data/lib/active_admin/resource/menu.rb +3 -3
  72. data/lib/active_admin/resource/naming.rb +3 -3
  73. data/lib/active_admin/resource/routes.rb +9 -4
  74. data/lib/active_admin/resource/scopes.rb +3 -3
  75. data/lib/active_admin/resource/sidebars.rb +1 -1
  76. data/lib/active_admin/resource.rb +2 -2
  77. data/lib/active_admin/resource_collection.rb +2 -2
  78. data/lib/active_admin/resource_controller/action_builder.rb +10 -0
  79. data/lib/active_admin/resource_controller/resource_class_methods.rb +2 -0
  80. data/lib/active_admin/resource_dsl.rb +5 -3
  81. data/lib/active_admin/router.rb +1 -1
  82. data/lib/active_admin/scope.rb +4 -4
  83. data/lib/active_admin/settings_node.rb +1 -1
  84. data/lib/active_admin/version.rb +1 -1
  85. data/lib/active_admin/view_helpers/display_helper.rb +10 -2
  86. data/lib/active_admin/view_helpers/download_format_links_helper.rb +1 -0
  87. data/lib/active_admin/view_helpers/method_or_proc_helper.rb +2 -0
  88. data/lib/active_admin/view_helpers.rb +1 -1
  89. data/lib/active_admin/views/components/active_admin_form.rb +7 -1
  90. data/lib/active_admin/views/components/attributes_table.rb +3 -3
  91. data/lib/active_admin/views/components/paginated_collection.rb +1 -1
  92. data/lib/active_admin/views/components/sidebar_section.rb +0 -3
  93. data/lib/active_admin/views/components/status_tag.rb +1 -18
  94. data/lib/active_admin/views/components/table_for.rb +2 -2
  95. data/lib/active_admin/views/components/tabs.rb +11 -2
  96. data/lib/active_admin/views/footer.rb +1 -1
  97. data/lib/active_admin/views/index_as_table.rb +5 -4
  98. data/lib/active_admin/views/pages/base.rb +3 -0
  99. data/lib/active_admin/views.rb +1 -1
  100. data/lib/active_admin.rb +9 -4
  101. data/lib/generators/active_admin/assets/assets_generator.rb +2 -2
  102. data/lib/generators/active_admin/assets/templates/active_admin.js +1 -0
  103. data/lib/generators/active_admin/install/install_generator.rb +6 -2
  104. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +20 -1
  105. data/lib/generators/active_admin/install/templates/dashboard.rb +2 -3
  106. data/lib/generators/active_admin/install/templates/migrations/create_active_admin_comments.rb.erb +1 -15
  107. data/lib/generators/active_admin/page/page_generator.rb +1 -1
  108. data/lib/generators/active_admin/resource/resource_generator.rb +1 -1
  109. data/lib/ransack_ext.rb +3 -3
  110. data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +80 -0
  111. data/vendor/assets/javascripts/jquery-ui/form.js +22 -0
  112. data/vendor/assets/javascripts/jquery-ui/labels.js +65 -0
  113. data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +274 -283
  114. metadata +106 -95
  115. data/.circleci/config.yml +0 -572
  116. data/.github/ISSUE_TEMPLATE.md +0 -20
  117. data/.gitignore +0 -16
  118. data/.mdlrc +0 -1
  119. data/.rspec +0 -1
  120. data/.rspec_parallel +0 -2
  121. data/.rubocop.yml +0 -99
  122. data/.simplecov +0 -9
  123. data/.yardopts +0 -7
  124. data/Gemfile +0 -30
  125. data/Gemfile.common +0 -26
  126. data/Gemfile.lock +0 -433
  127. data/Rakefile +0 -24
  128. data/activeadmin.gemspec +0 -32
  129. data/app/assets/javascripts/active_admin/base.js.coffee +0 -13
  130. data/app/assets/javascripts/active_admin/ext/jquery-ui.js.coffee +0 -6
  131. data/app/assets/javascripts/active_admin/ext/jquery.js.coffee +0 -7
  132. data/app/assets/javascripts/active_admin/initializers/batch_actions.js.coffee +0 -11
  133. data/app/assets/javascripts/active_admin/initializers/datepicker.js.coffee +0 -14
  134. data/app/assets/javascripts/active_admin/initializers/filters.js.coffee +0 -26
  135. data/app/assets/javascripts/active_admin/initializers/tabs.js.coffee +0 -7
  136. data/app/assets/javascripts/active_admin/lib/batch_actions.js.coffee +0 -42
  137. data/app/assets/javascripts/active_admin/lib/checkbox-toggler.js.coffee +0 -46
  138. data/app/assets/javascripts/active_admin/lib/dropdown-menu.js.coffee +0 -104
  139. data/app/assets/javascripts/active_admin/lib/flash.js.coffee +0 -19
  140. data/app/assets/javascripts/active_admin/lib/has_many.js.coffee +0 -79
  141. data/app/assets/javascripts/active_admin/lib/modal_dialog.js.coffee +0 -45
  142. data/app/assets/javascripts/active_admin/lib/per_page.js.coffee +0 -46
  143. data/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.js.coffee +0 -22
  144. data/bin/install_chromedriver.sh +0 -17
  145. data/config/i18n-tasks.yml +0 -26
  146. data/config/mdl_style.rb +0 -11
  147. data/cucumber.yml +0 -7
  148. data/gemfiles/rails_42.gemfile +0 -10
  149. data/gemfiles/rails_42.gemfile.lock +0 -339
  150. data/gemfiles/rails_50.gemfile +0 -10
  151. data/gemfiles/rails_50.gemfile.lock +0 -353
  152. data/gemfiles/rails_51.gemfile +0 -10
  153. data/gemfiles/rails_51.gemfile.lock +0 -353
  154. data/lib/active_admin/event.rb +0 -24
  155. data/lib/active_admin/helpers/output_safety_helper.rb +0 -35
  156. data/lib/bug_report_templates/active_admin_master.rb +0 -111
  157. data/lib/generators/active_admin/assets/templates/active_admin.js.coffee +0 -1
  158. data/tasks/application_generator.rb +0 -50
  159. data/tasks/docs.rake +0 -64
  160. data/tasks/gemfiles.rake +0 -8
  161. data/tasks/lint.rake +0 -110
  162. data/tasks/local.rake +0 -27
  163. data/tasks/release.rake +0 -6
  164. data/tasks/test.rake +0 -42
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29d7c95a552afce6991952dc4d0e4006b2d354172ad46e897ccb4765e4d04f3f
4
- data.tar.gz: 319f648ea6256a882a18f683f6dcc770f7b2ab54fdfd98e2b0a35fd511a34dc2
3
+ metadata.gz: '034169cf2f9474ee4754639ae5734d3338159a7897ee28b552592eadc71d428c'
4
+ data.tar.gz: a321cbba45ec6ed69e1730f6b2a0c6c2f40dd05ad1e62aab03f99f1699f762cd
5
5
  SHA512:
6
- metadata.gz: f73c6de3272fc66e167e93f99392ad2bd1d78629635c3d7f58adc1171e2d7df9bf2cee8de5f2e701d8d49eaa29f945f46285c5493de73a377982801014447378
7
- data.tar.gz: 4dd517e49cd37d1469e6d530d7677d1a8a1b6ee8069dea3f1c27e1c764c39b2fe67790ecc3f1e37e974cfb51967dcaf61e8a8fe811bf8ac79a0002703f6cc0ed
6
+ metadata.gz: bf8442376b7c017615702ad0cd1a03c553d8b78e9ee1e6c131f5975d8555fc14b17861f75df300c5907b6bd73fa7e583d6791c621a46fe05ed163aba3ad20aef
7
+ data.tar.gz: 14222c5fb8fbad8af29f901aaaf3c4d97fa441454928256f1e84a84f5068ef608f1343c58cd3635eb8927989ef442c690e4f6b50f5ea4bb1809d328c71cc757b
data/CHANGELOG.md CHANGED
@@ -2,26 +2,81 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
- ## 1.4.3 [☰](https://github.com/activeadmin/activeadmin/compare/v1.4.2...v1.4.3)
5
+ ## 2.0.0 [☰](https://github.com/activeadmin/activeadmin/compare/v2.0.0.rc2..v2.0.0)
6
+
7
+ _No changes_.
8
+
9
+ ## 2.0.0.rc2 [☰](https://github.com/activeadmin/activeadmin/compare/v2.0.0.rc1..v2.0.0.rc2)
10
+
11
+ ### Enhancements
12
+
13
+ #### Minor
14
+
15
+ * Require arbre `~> 1.2, >= 1.2.1` [#5726] by [@ionut998], and [#5738] by [@deivid-rodriguez]
16
+
17
+ ## 2.0.0.rc1 [☰](https://github.com/activeadmin/activeadmin/compare/v1.4.3..v2.0.0.rc1)
18
+
19
+ ### Enhancements
20
+
21
+ * Add your own content to the site `<head>`, like analytics [#5590] by [@buren]
22
+
23
+ ```ruby
24
+ ActiveAdmin.setup do |config|
25
+ config.head = ''.html_safe
26
+ end
27
+ ```
28
+
29
+ #### Minor
30
+
31
+ * Add better support for rendering lists. [#5370] by [@dkniffin]
32
+ * Undeprecate `config.register_stylesheet` and `config.register_javascript` for lack of better solution for including external assets. It might be reevaluated in the future. [#5662] by [@deivid-rodriguez]
33
+
34
+ ### Security Fixes
35
+
36
+ * Prevent leaking hashed passwords via user CSV export and adds a config option for sensitive attributes. [#5486] by [@chrp]
37
+
38
+ ### Bug Fixes
39
+
40
+ * Fix for paginated collections with `per_page: Array, pagination_total: false`. [#5627] by [@bartoszkopinski]
41
+ * Restrict ransack requirement to >= 2.1.1 to play nice with Rails 5.2.2. [#5632] by [@deivid-rodriguez]
42
+ * Bad interpolation variables on pagination keys in Lithuanian translation. [#5631] by [@deivid-rodriguez]
43
+ * Tabs are not correctly created when using non-transliteratable characters as title. [#5650] by [@panasyuk]
44
+ * Sidebar title internationalization. [#5417] by [@WaKeMaTTa]
45
+ * `filter` labels not allowing a `Proc` to be passed. [#5418] by [@WaKeMaTTa]
46
+
47
+ ### Removals
48
+
49
+ * Rails 4.2 support has been dropped. [#5104] by [@javierjulio] and [@deivid-rodriguez]
50
+ * Dependency on coffee-rails has been removed. [#5081] by [@javierjulio]
51
+ If your application uses coffescript but was relying on ActiveAdmin to provide
52
+ the dependency, you need to add the `coffee-script` gem to your `Gemfile` to
53
+ restore it. If your only usage of coffescript was the
54
+ `active_admin.js.coffee` generated by ActiveAdmin's generator, you can also
55
+ convert that file to plain JS (`//= require active_admin/base` if you
56
+ didn't add any stuff to it).
57
+ * Devise 3 support has been dropped. [#5608] by [@deivid-rodriguez] and [@javierjulio]
58
+ * `action_item` without a name has been removed. [#5099] by [@javierjulio]
59
+
60
+ ## 1.4.3 [☰](https://github.com/activeadmin/activeadmin/compare/v1.4.2..v1.4.3)
6
61
 
7
62
  ### Bug Fixes
8
63
 
9
64
  * Fix `form` parameter to `batch_action` no longer accepting procs. [#5611] by [@buren] and [@deivid-rodriguez]
10
65
  * Fix passing a proc to `scope_to`. [#5611] by [@deivid-rodriguez]
11
66
 
12
- ## 1.4.2 [☰](https://github.com/activeadmin/activeadmin/compare/v1.4.1...v1.4.2)
67
+ ## 1.4.2 [☰](https://github.com/activeadmin/activeadmin/compare/v1.4.1..v1.4.2)
13
68
 
14
69
  ### Bug Fixes
15
70
 
16
71
  * Fix `input_html` filter option evaluated only once. [#5376] by [@kjeldahl]
17
72
 
18
- ## 1.4.1 [☰](https://github.com/activeadmin/activeadmin/compare/v1.4.0...v1.4.1)
73
+ ## 1.4.1 [☰](https://github.com/activeadmin/activeadmin/compare/v1.4.0..v1.4.1)
19
74
 
20
75
  ### Bug Fixes
21
76
 
22
77
  * Fix menu item link with method delete. [#5583] by [@tiagotex]
23
78
 
24
- ## 1.4.0 [☰](https://github.com/activeadmin/activeadmin/compare/v1.3.1...v1.4.0)
79
+ ## 1.4.0 [☰](https://github.com/activeadmin/activeadmin/compare/v1.3.1..v1.4.0)
25
80
 
26
81
  ### Enhancements
27
82
 
@@ -54,13 +109,13 @@
54
109
  * Fixed resource filtering by association when the resource has custom primary key. [#5446] by [@wasifhossain]
55
110
  * Fixed "create anoter" checkbox styling. [#5324] by [@faucct]
56
111
 
57
- ## 1.3.1 [☰](https://github.com/activeadmin/activeadmin/compare/v1.3.0...v1.3.1)
112
+ ## 1.3.1 [☰](https://github.com/activeadmin/activeadmin/compare/v1.3.0..v1.3.1)
58
113
 
59
114
  ### Bug Fixes
60
115
 
61
116
  * gemspec should have more permissive ransack dependency. [#5448] by [@varyonic]
62
117
 
63
- ## 1.3.0 [☰](https://github.com/activeadmin/activeadmin/compare/v1.2.1...v1.3.0)
118
+ ## 1.3.0 [☰](https://github.com/activeadmin/activeadmin/compare/v1.2.1..v1.3.0)
64
119
 
65
120
  ### Enhancements
66
121
 
@@ -68,13 +123,13 @@
68
123
 
69
124
  * Rails 5.2 support [#5343] by [@varyonic], [#5399], [#5401] by [@zorab47]
70
125
 
71
- ## 1.2.1 [☰](https://github.com/activeadmin/activeadmin/compare/v1.2.0...v1.2.1)
126
+ ## 1.2.1 [☰](https://github.com/activeadmin/activeadmin/compare/v1.2.0..v1.2.1)
72
127
 
73
128
  ### Bug Fixes
74
129
 
75
130
  * Resolve issue with [#5275] preventing XSS in filters sidebar. [#5299] by [@faucct]
76
131
 
77
- ## 1.2.0 [☰](https://github.com/activeadmin/activeadmin/compare/v1.1.0...v1.2.0)
132
+ ## 1.2.0 [☰](https://github.com/activeadmin/activeadmin/compare/v1.1.0..v1.2.0)
78
133
 
79
134
  ### Enhancements
80
135
 
@@ -101,7 +156,7 @@
101
156
  * Fixed [#5198] Prevent XSS on sidebar's current filter rendering. [#5275] by [@deivid-rodriguez]
102
157
  * Sanitize display_name. [#5284] by [@markstory]
103
158
 
104
- ## 1.1.0 [☰](https://github.com/activeadmin/activeadmin/compare/v1.0.0...v1.1.0)
159
+ ## 1.1.0 [☰](https://github.com/activeadmin/activeadmin/compare/v1.0.0..v1.1.0)
105
160
 
106
161
  ### Bug Fixes
107
162
 
@@ -158,7 +213,7 @@
158
213
  * Allow passing a class to `action_item` block. [#4997] by [@Fivell]
159
214
  * Add pagination to the comments section. [#5088] by [@alex-bogomolov]
160
215
 
161
- ## 1.0.0 [☰](https://github.com/activeadmin/activeadmin/compare/v0.6.3...v1.0.0)
216
+ ## 1.0.0 [☰](https://github.com/activeadmin/activeadmin/compare/v0.6.3..v1.0.0)
162
217
 
163
218
  ### Breaking Changes
164
219
 
@@ -187,7 +242,7 @@
187
242
  * Page supports belongs_to. [#4759] by [@Fivell] and [@zorab47]
188
243
  * Support for custom sorting strategies. [#4768] by [@Fivell]
189
244
  * Stream CSV downloads as they're generated. [#3038] by [@craigmcnamara]
190
- * Disable streaming in development for easier debugging. [#3535] by [@seanlinsley]
245
+ * Disable streaming in development for easier debugging. [#3535] by [@seanlinsley]
191
246
  * Improved code reloading. [#3783] by [@chancancode]
192
247
  * Do not auto link to inaccessible actions. [#3686] by [@pranas]
193
248
  * Allow to enable comments on per-resource basis. [#3695] by [@pranas]
@@ -247,6 +302,8 @@
247
302
  ActiveSupport::Notifications.publish ActiveAdmin::Application::BeforeLoadEvent, "some data"
248
303
  ```
249
304
 
305
+ * `action_item` without a name, to introduce a solution for removing action items (`remove_action_item(name)`). [#3091] by [@amiel]
306
+
250
307
  ## Previous Changes
251
308
 
252
309
  Please check [0-6-stable] for previous changes.
@@ -284,6 +341,7 @@ Please check [0-6-stable] for previous changes.
284
341
  [#5043]: https://github.com/activeadmin/activeadmin/issues/5043
285
342
  [#5198]: https://github.com/activeadmin/activeadmin/issues/5198
286
343
 
344
+ [#3091]: https://github.com/activeadmin/activeadmin/pull/3091
287
345
  [#3435]: https://github.com/activeadmin/activeadmin/pull/3435
288
346
  [#4477]: https://github.com/activeadmin/activeadmin/pull/4477
289
347
  [#4731]: https://github.com/activeadmin/activeadmin/pull/4731
@@ -308,8 +366,11 @@ Please check [0-6-stable] for previous changes.
308
366
  [#5052]: https://github.com/activeadmin/activeadmin/pull/5052
309
367
  [#5060]: https://github.com/activeadmin/activeadmin/pull/5060
310
368
  [#5069]: https://github.com/activeadmin/activeadmin/pull/5069
369
+ [#5081]: https://github.com/activeadmin/activeadmin/pull/5081
311
370
  [#5088]: https://github.com/activeadmin/activeadmin/pull/5088
312
371
  [#5093]: https://github.com/activeadmin/activeadmin/pull/5093
372
+ [#5099]: https://github.com/activeadmin/activeadmin/pull/5099
373
+ [#5104]: https://github.com/activeadmin/activeadmin/pull/5104
313
374
  [#5119]: https://github.com/activeadmin/activeadmin/pull/5119
314
375
  [#5120]: https://github.com/activeadmin/activeadmin/pull/5120
315
376
  [#5125]: https://github.com/activeadmin/activeadmin/pull/5125
@@ -343,12 +404,15 @@ Please check [0-6-stable] for previous changes.
343
404
  [#5357]: https://github.com/activeadmin/activeadmin/pull/5357
344
405
  [#5359]: https://github.com/activeadmin/activeadmin/pull/5359
345
406
  [#5368]: https://github.com/activeadmin/activeadmin/pull/5368
407
+ [#5370]: https://github.com/activeadmin/activeadmin/pull/5370
346
408
  [#5375]: https://github.com/activeadmin/activeadmin/pull/5375
347
409
  [#5376]: https://github.com/activeadmin/activeadmin/pull/5376
348
410
  [#5399]: https://github.com/activeadmin/activeadmin/pull/5399
349
411
  [#5401]: https://github.com/activeadmin/activeadmin/pull/5401
350
412
  [#5408]: https://github.com/activeadmin/activeadmin/pull/5408
351
413
  [#5413]: https://github.com/activeadmin/activeadmin/pull/5413
414
+ [#5417]: https://github.com/activeadmin/activeadmin/pull/5417
415
+ [#5418]: https://github.com/activeadmin/activeadmin/pull/5418
352
416
  [#5433]: https://github.com/activeadmin/activeadmin/pull/5433
353
417
  [#5446]: https://github.com/activeadmin/activeadmin/pull/5446
354
418
  [#5448]: https://github.com/activeadmin/activeadmin/pull/5448
@@ -356,16 +420,27 @@ Please check [0-6-stable] for previous changes.
356
420
  [#5458]: https://github.com/activeadmin/activeadmin/pull/5458
357
421
  [#5461]: https://github.com/activeadmin/activeadmin/pull/5461
358
422
  [#5464]: https://github.com/activeadmin/activeadmin/pull/5464
423
+ [#5486]: https://github.com/activeadmin/activeadmin/pull/5486
359
424
  [#5501]: https://github.com/activeadmin/activeadmin/pull/5501
360
425
  [#5517]: https://github.com/activeadmin/activeadmin/pull/5517
361
426
  [#5537]: https://github.com/activeadmin/activeadmin/pull/5537
362
427
  [#5583]: https://github.com/activeadmin/activeadmin/pull/5583
428
+ [#5608]: https://github.com/activeadmin/activeadmin/pull/5608
363
429
  [#5611]: https://github.com/activeadmin/activeadmin/pull/5611
430
+ [#5627]: https://github.com/activeadmin/activeadmin/pull/5627
431
+ [#5631]: https://github.com/activeadmin/activeadmin/pull/5631
432
+ [#5632]: https://github.com/activeadmin/activeadmin/pull/5632
433
+ [#5650]: https://github.com/activeadmin/activeadmin/pull/5650
434
+ [#5590]: https://github.com/activeadmin/activeadmin/pull/5590
435
+ [#5662]: https://github.com/activeadmin/activeadmin/pull/5662
436
+ [#5726]: https://github.com/activeadmin/activeadmin/pull/5726
437
+ [#5738]: https://github.com/activeadmin/activeadmin/pull/5738
364
438
 
365
439
  [@5t111111]: https://github.com/5t111111
366
440
  [@aarek]: https://github.com/aarek
367
441
  [@ajw725]: https://github.com/ajw725
368
442
  [@alex-bogomolov]: https://github.com/alex-bogomolov
443
+ [@amiel]: https://github.com/amiel
369
444
  [@andreslemik]: https://github.com/andreslemik
370
445
  [@blocknotes]: https://github.com/blocknotes
371
446
  [@bolshakov]: https://github.com/bolshakov
@@ -377,6 +452,7 @@ Please check [0-6-stable] for previous changes.
377
452
  [@deivid-rodriguez]: https://github.com/deivid-rodriguez
378
453
  [@dennisvdvliet]: https://github.com/dennisvdvliet
379
454
  [@dhyegofernando]: https://github.com/dhyegofernando
455
+ [@dkniffin]: https://github.com/dkniffin
380
456
  [@dmitry]: https://github.com/dmitry
381
457
  [@drn]: https://github.com/drn
382
458
  [@eikes]: https://github.com/eikes
@@ -386,6 +462,7 @@ Please check [0-6-stable] for previous changes.
386
462
  [@glebtv]: https://github.com/glebtv
387
463
  [@gonzedge]: https://github.com/gonzedge
388
464
  [@innparusu95]: https://github.com/innparusu95
465
+ [@ionut998]: https://github.com/ionut998
389
466
  [@jasl]: https://github.com/jasl
390
467
  [@javierjulio]: https://github.com/javierjulio
391
468
  [@jawa]: https://github.com/jawa
@@ -415,6 +492,10 @@ Please check [0-6-stable] for previous changes.
415
492
  [@TimPetricola]: https://github.com/TimPetricola
416
493
  [@varyonic]: https://github.com/varyonic
417
494
  [@wasifhossain]: https://github.com/wasifhossain
495
+ [@WaKeMaTTa]: https://github.com/WaKeMaTTa
418
496
  [@Wowu]: https://github.com/Wowu
419
497
  [@wspurgin]: https://github.com/wspurgin
420
498
  [@zorab47]: https://github.com/zorab47
499
+ [@chrp]: https://github.com/chrp
500
+ [@bartoszkopinski]: https://github.com/bartoszkopinski
501
+ [@panasyuk]: https://github.com/panasyuk
data/CONTRIBUTING.md CHANGED
@@ -38,10 +38,10 @@ bundle install
38
38
  Now you should be able to run the entire suite using:
39
39
 
40
40
  ```sh
41
- bundle exec rake
41
+ bin/rake
42
42
  ```
43
43
 
44
- The test run will generate a sample Rails application in `spec/rails` to run the
44
+ The test run will generate a sample Rails application in `tmp/rails` to run the
45
45
  tests against.
46
46
 
47
47
  If your tests are passing locally but they're failing on CircleCI, it's probably
@@ -91,7 +91,7 @@ a look at your changes in a browser.
91
91
  To boot up a test Rails app:
92
92
 
93
93
  ```sh
94
- bundle exec rake local server
94
+ bin/rake local server
95
95
  ```
96
96
 
97
97
  This will automatically create a Rails app if none already exists, and store it
@@ -107,21 +107,22 @@ If you need to perform any other commands on the test application, just pass
107
107
  them to the `local` rake task. For example, to boot the rails console:
108
108
 
109
109
  ```sh
110
- bundle exec rake local console
110
+ bin/rake local console
111
111
  ```
112
112
 
113
- Or to migrate the database:
113
+ Or to migrate the database, if you create a new migration or just play around
114
+ with the db:
114
115
 
115
116
  ```sh
116
- bundle exec rake local db:migrate
117
+ bin/rake local db:migrate
117
118
  ```
118
119
 
119
120
  ### Get the style right
120
121
 
121
122
  Your patch should follow the same conventions & pass the same code quality
122
- checks as the rest of the project. `bundle exec rake lint` will give you
123
- feedback in this regard. You can check & fix style issues by running each linter
124
- individually. Run `bundle exec rake -T lint` to see the available linters.
123
+ checks as the rest of the project. `bin/rake lint` will give you feedback in
124
+ this regard. You can check & fix style issues by running each linter
125
+ individually. Run `bin/rake -T lint` to see the available linters.
125
126
 
126
127
  ### Make a Pull Request
127
128
 
@@ -200,7 +201,7 @@ Maintainers need to do the following to push out a release:
200
201
  * Make sure you have [chandler] properly configured. Chandler is used to
201
202
  automatically submit github release notes from the changelog right after
202
203
  pushing the gem to rubygems.
203
- * `bundle exec rake release`
204
+ * `bin/rake release`
204
205
 
205
206
  [chandler]: https://github.com/mattbrictson/chandler#2-configure-credentials
206
207
  [chromedriver]: https://sites.google.com/a/chromium.org/chromedriver/getting-started
@@ -210,7 +211,7 @@ Maintainers need to do the following to push out a release:
210
211
  [new issue]: https://github.com/activeadmin/activeadmin/issues/new
211
212
  [fork Active Admin]: https://help.github.com/articles/fork-a-repo
212
213
  [searching all issues]: https://github.com/activeadmin/activeadmin/issues?q=
213
- [master template]: https://github.com/activeadmin/activeadmin/blob/master/lib/bug_report_templates/active_admin_master.rb
214
+ [master template]: https://github.com/activeadmin/activeadmin/blob/master/tasks/bug_report_template.rb
214
215
  [make a pull request]: https://help.github.com/articles/creating-a-pull-request
215
216
  [git rebasing]: http://git-scm.com/book/en/Git-Branching-Rebasing
216
217
  [interactive rebase]: https://help.github.com/articles/interactive-rebase
data/README.md CHANGED
@@ -32,16 +32,22 @@ Google Groups, IRC #activeadmin and Gitter are not actively monitored.
32
32
 
33
33
  ## Want to contribute?
34
34
 
35
- The [contributing guide][contributing]
36
- is a good place to start. If you have questions, feel free to ask.
35
+ If you want to contribute through code or documentation, the [Contributing
36
+ guide is the best place to start][contributing]. If you have questions, feel free
37
+ to ask.
37
38
 
38
39
  ## Want to support us?
39
40
 
40
- Subscribe to [Tidelift][tidelift] to support Active Admin and get licensing assurances and timely security notifications.
41
+ If you want to support us financially, you can [help fund the project
42
+ through a Tidelift subscription][tidelift]. By buying a Tidelift subscription
43
+ you make sure your whole dependency stack is properly maintained, while also
44
+ getting a comprehensive view of outdated dependencies, new releases, security
45
+ alerts, and licensing compatibility issues.
41
46
 
42
- You can support us with a weekly tip via [Liberapay][liberapay.com].
47
+ You can also support us with a weekly tip via [Liberapay].
43
48
 
44
- [![Support via Liberapay][liberapay_button]][liberapay_donate]
49
+ Finally, we have an [Open Collective][opencollective page] where you can become a backer or
50
+ sponsor for the project, and also submit expenses to it.
45
51
 
46
52
  ## Dependencies
47
53
 
@@ -56,6 +62,23 @@ Tool | Description
56
62
  [Kaminari] | Elegant pagination for any sort of collection
57
63
  [Ransack] | Provides a simple search API to query your data
58
64
 
65
+ ## Security contact information
66
+
67
+ Please use the Tidelift security contact to [report a security vulnerability][Tidelift security contact].
68
+ Tidelift will coordinate the fix and disclosure.
69
+
70
+ ## Acknowledgements
71
+
72
+ Thanks to [Greg Bell][Greg] for creating and sharing this project with the open source community.
73
+
74
+ Thanks to [all the people that ever contributed through code][contributors] or
75
+ other means such as bug reports, issue triaging, feature suggestions, code
76
+ snippet tips, Slack discussions and so on.
77
+
78
+ Thanks to [Tidelift][tidelift] and all our Tidelift subscribers.
79
+
80
+ Thanks to [Open Collective][opencollective contributors] and all our Open Collective contributors.
81
+
59
82
  [Arbre]: https://github.com/activeadmin/arbre
60
83
  [Devise]: https://github.com/plataformatec/devise
61
84
  [Formtastic]: https://github.com/justinfrench/formtastic
@@ -79,6 +102,9 @@ Tool | Description
79
102
  [wiki]: https://github.com/activeadmin/activeadmin/wiki
80
103
  [stackoverflow]: http://stackoverflow.com/questions/tagged/activeadmin
81
104
  [contributing]: https://github.com/activeadmin/activeadmin/blob/master/CONTRIBUTING.md
82
- [liberapay.com]: https://liberapay.com
83
- [liberapay_button]: https://liberapay.com/assets/widgets/donate.svg
84
- [liberapay_donate]: https://liberapay.com/Active-Admin/donate
105
+ [Liberapay]: https://liberapay.com/Active-Admin/donate
106
+ [Tidelift security contact]: https://tidelift.com/security
107
+ [Greg]: https://github.com/gregbell
108
+ [contributors]: https://github.com/activeadmin/activeadmin/graphs/contributors
109
+ [opencollective page]: https://opencollective.com/activeadmin
110
+ [opencollective contributors]: https://opencollective.com/activeadmin#contributors
@@ -0,0 +1,23 @@
1
+ //= require jquery3
2
+ //= require jquery-ui/widgets/datepicker
3
+ //= require jquery-ui/widgets/dialog
4
+ //= require jquery-ui/widgets/sortable
5
+ //= require jquery-ui/widgets/tabs
6
+ //= require jquery-ui/widget
7
+ //= require jquery_ujs
8
+ //= require_self
9
+ //= require ./ext/jquery
10
+ //= require ./ext/jquery-ui
11
+ //= require ./lib/active_admin
12
+ //= require ./lib/batch_actions
13
+ //= require ./lib/dropdown-menu
14
+ //= require ./lib/has_many
15
+ //= require ./lib/modal_dialog
16
+ //= require ./lib/per_page
17
+ //= require ./lib/checkbox-toggler
18
+ //= require ./lib/table-checkbox-toggler
19
+ //= require ./initializers/datepicker
20
+ //= require ./initializers/filters
21
+ //= require ./initializers/tabs
22
+
23
+ window.ActiveAdmin = {}
@@ -0,0 +1,7 @@
1
+ // Short-circuits `_focusTabbable` to focus on the modal itself instead of
2
+ // elements inside the modal. Without this, if a datepicker is the first input,
3
+ // it'll immediately pop up when the modal opens.
4
+ // See this ticket for more info: http://bugs.jqueryui.com/ticket/4731
5
+ $.ui.dialog.prototype._focusTabbable = function() {
6
+ this.uiDialog.focus();
7
+ };
@@ -0,0 +1,9 @@
1
+ // `serializeArray` generates => [{ name: 'foo', value: 'bar' }]
2
+ // This function remaps it to => { foo: 'bar' }
3
+ $.fn.serializeObject = function() {
4
+ return this.serializeArray()
5
+ .reduce((obj, item) => {
6
+ obj[item.name] = item.value
7
+ return obj
8
+ }, {});
9
+ };
@@ -0,0 +1,16 @@
1
+ (($) => {
2
+
3
+ $(document)
4
+ .on('focus', 'input.datepicker:not(.hasDatepicker)', function() {
5
+ const input = $(this);
6
+
7
+ // Only create datepickers in compatible browsers
8
+ if (input[0].type === 'date') { return; }
9
+
10
+ const defaults = { dateFormat: 'yy-mm-dd' };
11
+ const options = input.data('datepicker-options');
12
+
13
+ input.datepicker($.extend(defaults, options));
14
+ });
15
+
16
+ })(jQuery);
@@ -0,0 +1,45 @@
1
+ (($, ActiveAdmin) => {
2
+
3
+ class Filters {
4
+
5
+ static _clearForm(event) {
6
+ const regex = /^(q\[|q%5B|q%5b|page|utf8|commit)/;
7
+ const params = ActiveAdmin
8
+ .queryStringToParams()
9
+ .filter(({name}) => !name.match(regex));
10
+
11
+ event.preventDefault();
12
+
13
+ if (ActiveAdmin.turbolinks) {
14
+ ActiveAdmin.turbolinksVisit(params);
15
+ } else {
16
+ window.location.search = ActiveAdmin.toQueryString(params);
17
+ }
18
+ }
19
+
20
+ static _disableEmptyInputFields(event) {
21
+ const params = $(this)
22
+ .find(':input')
23
+ .filter((i, input) => input.value === '')
24
+ .prop({ disabled: true })
25
+ .end()
26
+ .serializeArray();
27
+
28
+ if (ActiveAdmin.turbolinks) {
29
+ event.preventDefault();
30
+ ActiveAdmin.turbolinksVisit(params);
31
+ }
32
+ }
33
+
34
+ static _setSearchType() {
35
+ $(this).siblings('input').prop({name: `q[${this.value}]`});
36
+ }
37
+
38
+ }
39
+
40
+ $(document).
41
+ on('click', '.clear_filters_btn', Filters._clearForm).
42
+ on('submit', '.filter_form', Filters._disableEmptyInputFields).
43
+ on('change', '.filter_form_field.select_and_search select', Filters._setSearchType);
44
+
45
+ })(jQuery, window.activeadmin);
@@ -0,0 +1,6 @@
1
+ let onDOMReady = () =>
2
+ $('#active_admin_content .tabs').tabs()
3
+
4
+ $(document).
5
+ ready(onDOMReady).
6
+ on('page:load turbolinks:load', onDOMReady)
@@ -0,0 +1,41 @@
1
+ ((window, $) => {
2
+
3
+ class ActiveAdmin {
4
+
5
+ static get turbolinks() {
6
+ return (typeof Turbolinks !== 'undefined' && Turbolinks.supported);
7
+ }
8
+
9
+ static turbolinksVisit(params) {
10
+ const path = [window.location.pathname, '?', this.toQueryString(params)].join('')
11
+ Turbolinks.visit(path);
12
+ }
13
+
14
+ static queryString() {
15
+ return (window.location.search || '').replace(/^\?/, '');
16
+ }
17
+
18
+ static queryStringToParams() {
19
+ const decode = (value) => decodeURIComponent((value || '').replace(/\+/g, '%20'));
20
+
21
+ return this.queryString()
22
+ .split("&")
23
+ .map(pair => pair.split("="))
24
+ .map(([key, value]) => {
25
+ return { name: decode(key), value: decode(value) }
26
+ });
27
+ }
28
+
29
+ static toQueryString(params) {
30
+ const encode = (value) => encodeURIComponent(value || '');
31
+
32
+ return params
33
+ .map(({name, value}) => [ encode(name), encode(value) ])
34
+ .map(pair => pair.join('='))
35
+ .join('&')
36
+ }
37
+ }
38
+
39
+ window.activeadmin = ActiveAdmin
40
+
41
+ })(window, jQuery);
@@ -0,0 +1,55 @@
1
+ const onDOMReady = function() {
2
+ //
3
+ // Use ActiveAdmin.modal_dialog to prompt user if
4
+ // confirmation is required for current Batch Action
5
+ //
6
+ $('.batch_actions_selector li a').click(function(event){
7
+ let message;
8
+ event.stopPropagation(); // prevent Rails UJS click event
9
+ event.preventDefault();
10
+ if ((message = $(this).data('confirm'))) {
11
+ ActiveAdmin.modal_dialog(message, $(this).data('inputs'), inputs => {
12
+ $(this).trigger('confirm:complete', inputs);
13
+ });
14
+ } else {
15
+ $(this).trigger('confirm:complete');
16
+ }
17
+ });
18
+
19
+ $('.batch_actions_selector li a').on('confirm:complete', function(event, inputs){
20
+ let val;
21
+ if ((val = JSON.stringify(inputs))) {
22
+ $('#batch_action_inputs').removeAttr('disabled').val(val);
23
+ } else {
24
+ $('#batch_action_inputs').attr('disabled', 'disabled');
25
+ }
26
+
27
+ $('#batch_action').val($(this).data('action'));
28
+ $('#collection_selection').submit();
29
+ });
30
+
31
+ //
32
+ // Add checkbox selection to resource tables and lists if batch actions are enabled
33
+ //
34
+
35
+ if ($(".batch_actions_selector").length && $(":checkbox.toggle_all").length) {
36
+
37
+ if ($(".paginated_collection table.index_table").length) {
38
+ $(".paginated_collection table.index_table").tableCheckboxToggler();
39
+ } else {
40
+ $(".paginated_collection").checkboxToggler();
41
+ }
42
+
43
+ $(document).on('change', '.paginated_collection :checkbox', function() {
44
+ if ($(".paginated_collection :checkbox:checked").length && $(".dropdown_menu_list").children().length) {
45
+ $(".batch_actions_selector").each(function() { $(this).aaDropdownMenu("enable"); });
46
+ } else {
47
+ $(".batch_actions_selector").each(function() { $(this).aaDropdownMenu("disable"); });
48
+ }
49
+ });
50
+ }
51
+ };
52
+
53
+ $(document).
54
+ ready(onDOMReady).
55
+ on('page:load turbolinks:load', onDOMReady);
@@ -0,0 +1,49 @@
1
+ ActiveAdmin.CheckboxToggler = class CheckboxToggler {
2
+ constructor(options, container){
3
+ this.options = options;
4
+ this.container = container;
5
+ this._init();
6
+ this._bind();
7
+ }
8
+
9
+ option(key, value) {
10
+ }
11
+
12
+ _init() {
13
+ if (!this.container) {
14
+ throw new Error('Container element not found');
15
+ } else {
16
+ this.$container = $(this.container);
17
+ }
18
+
19
+ if (!this.$container.find('.toggle_all').length) {
20
+ throw new Error('"toggle all" checkbox not found');
21
+ } else {
22
+ this.toggle_all_checkbox = this.$container.find('.toggle_all');
23
+ }
24
+
25
+ this.checkboxes = this.$container.find(':checkbox').not(this.toggle_all_checkbox);
26
+ }
27
+
28
+ _bind() {
29
+ this.checkboxes.change(event => this._didChangeCheckbox(event.target));
30
+ this.toggle_all_checkbox.change(() => this._didChangeToggleAllCheckbox());
31
+ }
32
+
33
+ _didChangeCheckbox(checkbox){
34
+ const numChecked = this.checkboxes.filter(':checked').length;
35
+
36
+ const allChecked = numChecked === this.checkboxes.length;
37
+ const someChecked = (numChecked > 0) && (numChecked < this.checkboxes.length);
38
+
39
+ this.toggle_all_checkbox.prop({ checked: allChecked, indeterminate: someChecked });
40
+ }
41
+
42
+ _didChangeToggleAllCheckbox() {
43
+ const setting = this.toggle_all_checkbox.prop('checked');
44
+ this.checkboxes.prop({ checked: setting });
45
+ return setting;
46
+ }
47
+ };
48
+
49
+ $.widget.bridge('checkboxToggler', ActiveAdmin.CheckboxToggler);