activeadmin 2.8.0 → 2.8.1

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 (99) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/app/assets/javascripts/active_admin/base.js +1 -1
  4. data/docs/Gemfile +2 -2
  5. data/lib/active_admin.rb +56 -56
  6. data/lib/active_admin/application.rb +8 -8
  7. data/lib/active_admin/application_settings.rb +3 -3
  8. data/lib/active_admin/base_controller.rb +4 -4
  9. data/lib/active_admin/base_controller/authorization.rb +4 -3
  10. data/lib/active_admin/batch_actions/controller.rb +1 -1
  11. data/lib/active_admin/batch_actions/resource_extension.rb +9 -8
  12. data/lib/active_admin/batch_actions/views/batch_action_form.rb +2 -2
  13. data/lib/active_admin/batch_actions/views/batch_action_selector.rb +1 -1
  14. data/lib/active_admin/batch_actions/views/selection_cells.rb +3 -3
  15. data/lib/active_admin/cancan_adapter.rb +1 -1
  16. data/lib/active_admin/dependency.rb +4 -4
  17. data/lib/active_admin/devise.rb +5 -5
  18. data/lib/active_admin/dsl.rb +1 -1
  19. data/lib/active_admin/dynamic_settings_node.rb +2 -2
  20. data/lib/active_admin/engine.rb +3 -3
  21. data/lib/active_admin/filters.rb +6 -6
  22. data/lib/active_admin/filters/active.rb +1 -1
  23. data/lib/active_admin/filters/active_filter.rb +5 -4
  24. data/lib/active_admin/filters/active_sidebar.rb +5 -5
  25. data/lib/active_admin/filters/forms.rb +3 -3
  26. data/lib/active_admin/filters/formtastic_addons.rb +1 -6
  27. data/lib/active_admin/form_builder.rb +18 -16
  28. data/lib/active_admin/generators/boilerplate.rb +1 -1
  29. data/lib/active_admin/inputs/datepicker_input.rb +1 -1
  30. data/lib/active_admin/inputs/filters/base.rb +1 -1
  31. data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
  32. data/lib/active_admin/inputs/filters/boolean_input.rb +1 -1
  33. data/lib/active_admin/inputs/filters/check_boxes_input.rb +1 -1
  34. data/lib/active_admin/inputs/filters/select_input.rb +2 -2
  35. data/lib/active_admin/localizers.rb +1 -1
  36. data/lib/active_admin/localizers/resource_localizer.rb +3 -3
  37. data/lib/active_admin/menu.rb +1 -1
  38. data/lib/active_admin/menu_item.rb +1 -1
  39. data/lib/active_admin/namespace.rb +7 -7
  40. data/lib/active_admin/namespace_settings.rb +5 -5
  41. data/lib/active_admin/order_clause.rb +1 -1
  42. data/lib/active_admin/orm/active_record.rb +1 -1
  43. data/lib/active_admin/orm/active_record/comments.rb +13 -13
  44. data/lib/active_admin/orm/active_record/comments/views.rb +2 -2
  45. data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +17 -17
  46. data/lib/active_admin/page.rb +1 -1
  47. data/lib/active_admin/pundit_adapter.rb +1 -1
  48. data/lib/active_admin/resource.rb +17 -17
  49. data/lib/active_admin/resource/action_items.rb +4 -4
  50. data/lib/active_admin/resource/attributes.rb +1 -1
  51. data/lib/active_admin/resource/belongs_to.rb +2 -2
  52. data/lib/active_admin/resource/controllers.rb +1 -1
  53. data/lib/active_admin/resource/naming.rb +2 -2
  54. data/lib/active_admin/resource/routes.rb +1 -1
  55. data/lib/active_admin/resource/sidebars.rb +1 -1
  56. data/lib/active_admin/resource_controller.rb +9 -9
  57. data/lib/active_admin/resource_controller/decorators.rb +1 -1
  58. data/lib/active_admin/resource_controller/streaming.rb +7 -6
  59. data/lib/active_admin/scope.rb +1 -1
  60. data/lib/active_admin/version.rb +1 -1
  61. data/lib/active_admin/view_factory.rb +1 -1
  62. data/lib/active_admin/view_helpers.rb +1 -1
  63. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +2 -2
  64. data/lib/active_admin/view_helpers/display_helper.rb +2 -2
  65. data/lib/active_admin/view_helpers/download_format_links_helper.rb +1 -1
  66. data/lib/active_admin/view_helpers/fields_for.rb +1 -1
  67. data/lib/active_admin/views.rb +1 -1
  68. data/lib/active_admin/views/components/active_admin_form.rb +5 -5
  69. data/lib/active_admin/views/components/attributes_table.rb +3 -3
  70. data/lib/active_admin/views/components/blank_slate.rb +1 -1
  71. data/lib/active_admin/views/components/dropdown_menu.rb +6 -6
  72. data/lib/active_admin/views/components/index_list.rb +2 -2
  73. data/lib/active_admin/views/components/menu.rb +1 -1
  74. data/lib/active_admin/views/components/menu_item.rb +3 -3
  75. data/lib/active_admin/views/components/paginated_collection.rb +6 -6
  76. data/lib/active_admin/views/components/panel.rb +1 -1
  77. data/lib/active_admin/views/components/scopes.rb +5 -5
  78. data/lib/active_admin/views/components/site_title.rb +1 -1
  79. data/lib/active_admin/views/components/status_tag.rb +11 -11
  80. data/lib/active_admin/views/components/table_for.rb +7 -7
  81. data/lib/active_admin/views/components/tabs.rb +2 -2
  82. data/lib/active_admin/views/footer.rb +2 -1
  83. data/lib/active_admin/views/header.rb +2 -2
  84. data/lib/active_admin/views/index_as_blog.rb +1 -1
  85. data/lib/active_admin/views/index_as_grid.rb +1 -1
  86. data/lib/active_admin/views/index_as_table.rb +11 -11
  87. data/lib/active_admin/views/pages/base.rb +6 -6
  88. data/lib/active_admin/views/pages/index.rb +10 -9
  89. data/lib/active_admin/views/tabbed_navigation.rb +2 -2
  90. data/lib/active_admin/views/title_bar.rb +1 -1
  91. data/lib/activeadmin.rb +1 -1
  92. data/lib/generators/active_admin/assets/assets_generator.rb +2 -2
  93. data/lib/generators/active_admin/devise/devise_generator.rb +1 -1
  94. data/lib/generators/active_admin/install/install_generator.rb +7 -7
  95. data/lib/generators/active_admin/page/page_generator.rb +1 -1
  96. data/lib/generators/active_admin/resource/resource_generator.rb +2 -2
  97. data/lib/generators/active_admin/webpacker/webpacker_generator.rb +7 -7
  98. data/lib/ransack_ext.rb +8 -8
  99. metadata +2 -2
@@ -15,7 +15,7 @@ module ActiveAdmin
15
15
  end
16
16
 
17
17
  def main_content
18
- I18n.t('active_admin.main_content', model: title).html_safe
18
+ I18n.t("active_admin.main_content", model: title).html_safe
19
19
  end
20
20
 
21
21
  private
@@ -65,9 +65,9 @@ module ActiveAdmin
65
65
  def body_classes
66
66
  Arbre::HTML::ClassList.new [
67
67
  params[:action],
68
- params[:controller].tr('/', '_'),
69
- 'active_admin', 'logged_in',
70
- active_admin_namespace.name.to_s + '_namespace'
68
+ params[:controller].tr("/", "_"),
69
+ "active_admin", "logged_in",
70
+ active_admin_namespace.name.to_s + "_namespace"
71
71
  ]
72
72
  end
73
73
 
@@ -81,12 +81,12 @@ module ActiveAdmin
81
81
  build_flash_messages
82
82
  div id: "active_admin_content", class: (skip_sidebar? ? "without_sidebar" : "with_sidebar") do
83
83
  build_main_content_wrapper
84
- sidebar sidebar_sections_for_action, id: 'sidebar' unless skip_sidebar?
84
+ sidebar sidebar_sections_for_action, id: "sidebar" unless skip_sidebar?
85
85
  end
86
86
  end
87
87
 
88
88
  def build_flash_messages
89
- div class: 'flashes' do
89
+ div class: "flashes" do
90
90
  flash_messages.each do |type, messages|
91
91
  [*messages].each do |message|
92
92
  div message, class: "flash flash_#{type}"
@@ -1,4 +1,4 @@
1
- require 'active_admin/helpers/collection'
1
+ require "active_admin/helpers/collection"
2
2
 
3
3
  module ActiveAdmin
4
4
  module Views
@@ -111,7 +111,7 @@ module ActiveAdmin
111
111
 
112
112
  def render_blank_slate
113
113
  blank_slate_content = I18n.t("active_admin.blank_slate.content", resource_name: active_admin_config.plural_resource_label)
114
- if controller.action_methods.include?('new') && authorized?(ActiveAdmin::Auth::CREATE, active_admin_config.resource_class)
114
+ if controller.action_methods.include?("new") && authorized?(ActiveAdmin::Auth::CREATE, active_admin_config.resource_class)
115
115
  blank_slate_content = [blank_slate_content, blank_slate_link].compact.join(" ")
116
116
  end
117
117
  insert_tag(view_factory.blank_slate, blank_slate_content)
@@ -130,13 +130,14 @@ module ActiveAdmin
130
130
  pagination_total = config.fetch(:pagination_total, true)
131
131
  per_page = config.fetch(:per_page, active_admin_config.per_page)
132
132
 
133
- paginated_collection(collection, entry_name: active_admin_config.resource_label,
134
- entries_name: active_admin_config.plural_resource_label(count: collection_size),
135
- download_links: download_links,
136
- paginator: paginator,
137
- per_page: per_page,
138
- pagination_total: pagination_total) do
139
- div class: 'index_content' do
133
+ paginated_collection(
134
+ collection, entry_name: active_admin_config.resource_label,
135
+ entries_name: active_admin_config.plural_resource_label(count: collection_size),
136
+ download_links: download_links,
137
+ paginator: paginator,
138
+ per_page: per_page,
139
+ pagination_total: pagination_total) do
140
+ div class: "index_content" do
140
141
  insert_tag(renderer_class, config, collection)
141
142
  end
142
143
  end
@@ -1,10 +1,10 @@
1
- require_relative 'components/menu'
1
+ require_relative "components/menu"
2
2
 
3
3
  module ActiveAdmin
4
4
  module Views
5
5
  class TabbedNavigation < Menu
6
6
  def build(menu, options = {})
7
- super(menu, options.reverse_merge(id: 'tabs'))
7
+ super(menu, options.reverse_merge(id: "tabs"))
8
8
  end
9
9
  end
10
10
  end
@@ -43,7 +43,7 @@ module ActiveAdmin
43
43
  end
44
44
 
45
45
  def build_title_tag
46
- h2(@title, id: 'page_title')
46
+ h2(@title, id: "page_title")
47
47
  end
48
48
 
49
49
  def build_action_items
@@ -1 +1 @@
1
- require 'active_admin'
1
+ require "active_admin"
@@ -2,10 +2,10 @@ module ActiveAdmin
2
2
  module Generators
3
3
  class AssetsGenerator < Rails::Generators::Base
4
4
 
5
- source_root File.expand_path('templates', __dir__)
5
+ source_root File.expand_path("templates", __dir__)
6
6
 
7
7
  def install_assets
8
- template 'active_admin.js', 'app/assets/javascripts/active_admin.js'
8
+ template "active_admin.js", "app/assets/javascripts/active_admin.js"
9
9
  template "active_admin.scss", "app/assets/stylesheets/active_admin.scss"
10
10
  end
11
11
 
@@ -22,7 +22,7 @@ module ActiveAdmin
22
22
  raise ActiveAdmin::GeneratorError, "#{e.message} If you don't want to use devise, run the generator with --skip-users."
23
23
  end
24
24
 
25
- require 'devise'
25
+ require "devise"
26
26
 
27
27
  initializer_file =
28
28
  File.join(destination_root, "config", "initializers", "devise.rb")
@@ -1,4 +1,4 @@
1
- require 'rails/generators/active_record'
1
+ require "rails/generators/active_record"
2
2
 
3
3
  module ActiveAdmin
4
4
  module Generators
@@ -10,22 +10,22 @@ module ActiveAdmin
10
10
  class_option :skip_comments, type: :boolean, default: false, desc: "Skip installation of comments"
11
11
  class_option :use_webpacker, type: :boolean, default: false, desc: "Use Webpacker assets instead of Sprockets"
12
12
 
13
- source_root File.expand_path('templates', __dir__)
13
+ source_root File.expand_path("templates", __dir__)
14
14
 
15
15
  def copy_initializer
16
- @underscored_user_name = name.underscore.gsub('/', '_')
16
+ @underscored_user_name = name.underscore.gsub("/", "_")
17
17
  @use_authentication_method = options[:users].present?
18
18
  @skip_comments = options[:skip_comments]
19
19
  @use_webpacker = options[:use_webpacker]
20
- template 'active_admin.rb.erb', 'config/initializers/active_admin.rb'
20
+ template "active_admin.rb.erb", "config/initializers/active_admin.rb"
21
21
  end
22
22
 
23
23
  def setup_directory
24
24
  empty_directory "app/admin"
25
- template 'dashboard.rb', 'app/admin/dashboard.rb'
25
+ template "dashboard.rb", "app/admin/dashboard.rb"
26
26
  if options[:users].present?
27
27
  @user_class = name
28
- template 'admin_users.rb.erb', "app/admin/#{name.underscore.pluralize}.rb"
28
+ template "admin_users.rb.erb", "app/admin/#{name.underscore.pluralize}.rb"
29
29
  end
30
30
  end
31
31
 
@@ -47,7 +47,7 @@ module ActiveAdmin
47
47
 
48
48
  def create_migrations
49
49
  unless options[:skip_comments]
50
- migration_template 'migrations/create_active_admin_comments.rb.erb', 'db/migrate/create_active_admin_comments.rb'
50
+ migration_template "migrations/create_active_admin_comments.rb.erb", "db/migrate/create_active_admin_comments.rb"
51
51
  end
52
52
  end
53
53
  end
@@ -1,7 +1,7 @@
1
1
  module ActiveAdmin
2
2
  module Generators
3
3
  class PageGenerator < Rails::Generators::NamedBase
4
- source_root File.expand_path('templates', __dir__)
4
+ source_root File.expand_path("templates", __dir__)
5
5
 
6
6
  def generate_config_file
7
7
  template "page.rb", "app/admin/#{file_path.tr('/', '_')}.rb"
@@ -1,4 +1,4 @@
1
- require 'active_admin/generators/boilerplate'
1
+ require "active_admin/generators/boilerplate"
2
2
 
3
3
  module ActiveAdmin
4
4
  module Generators
@@ -8,7 +8,7 @@ module ActiveAdmin
8
8
  class_option :include_boilerplate, type: :boolean, default: false,
9
9
  desc: "Generate boilerplate code for your resource."
10
10
 
11
- source_root File.expand_path('templates', __dir__)
11
+ source_root File.expand_path("templates", __dir__)
12
12
 
13
13
  def generate_config_file
14
14
  @boilerplate = ActiveAdmin::Generators::Boilerplate.new(class_name)
@@ -2,22 +2,22 @@ module ActiveAdmin
2
2
  module Generators
3
3
  class WebpackerGenerator < Rails::Generators::Base
4
4
 
5
- source_root File.expand_path('templates', __dir__)
5
+ source_root File.expand_path("templates", __dir__)
6
6
 
7
7
  def install_assets
8
- template 'active_admin.js', 'app/javascript/packs/active_admin.js'
8
+ template "active_admin.js", "app/javascript/packs/active_admin.js"
9
9
  template "active_admin.scss", "app/javascript/stylesheets/active_admin.scss"
10
- template 'print.scss', 'app/javascript/packs/active_admin/print.scss'
10
+ template "print.scss", "app/javascript/packs/active_admin/print.scss"
11
11
 
12
12
  copy_file "#{__dir__}/plugins/jquery.js", Rails.root.join("config/webpack/plugins/jquery.js").to_s
13
13
 
14
14
  insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
15
- "const jquery = require('./plugins/jquery')\n",
16
- after: /require\(('|")@rails\/webpacker\1\);?\n/
15
+ "const jquery = require('./plugins/jquery')\n",
16
+ after: /require\(('|")@rails\/webpacker\1\);?\n/
17
17
 
18
18
  insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
19
- "environment.plugins.prepend('jquery', jquery)\n",
20
- before: "module.exports"
19
+ "environment.plugins.prepend('jquery', jquery)\n",
20
+ before: "module.exports"
21
21
 
22
22
  run "yarn add @activeadmin/activeadmin"
23
23
  end
@@ -2,19 +2,19 @@
2
2
  # identically to the versions given in Ransack.
3
3
  #
4
4
  Ransack.configure do |config|
5
- { 'contains' => 'cont', 'starts_with' => 'start', 'ends_with' => 'end' }.each do |old, current|
5
+ { "contains" => "cont", "starts_with" => "start", "ends_with" => "end" }.each do |old, current|
6
6
  config.add_predicate old, Ransack::Constants::DERIVED_PREDICATES.detect { |q, _| q == current }[1]
7
7
  end
8
8
 
9
- { 'equals' => 'eq', 'greater_than' => 'gt', 'less_than' => 'lt' }.each do |old, current|
9
+ { "equals" => "eq", "greater_than" => "gt", "less_than" => "lt" }.each do |old, current|
10
10
  config.add_predicate old, arel_predicate: current
11
11
  end
12
12
 
13
- config.add_predicate 'gteq_datetime',
14
- arel_predicate: 'gteq',
15
- formatter: ->(v) { v.beginning_of_day }
13
+ config.add_predicate "gteq_datetime",
14
+ arel_predicate: "gteq",
15
+ formatter: ->(v) { v.beginning_of_day }
16
16
 
17
- config.add_predicate 'lteq_datetime',
18
- arel_predicate: 'lt',
19
- formatter: ->(v) { v + 1.day }
17
+ config.add_predicate "lteq_datetime",
18
+ arel_predicate: "lt",
19
+ formatter: ->(v) { v + 1.day }
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Maresh
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2020-09-04 00:00:00.000000000 Z
18
+ date: 2020-09-28 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: arbre