activeadmin 4.0.0.beta10 → 4.0.0.beta11

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17abe55cddeec6028454b71ee930e2a99e83c0660303a6b901488aba36a90cda
4
- data.tar.gz: 4ba193f3c02f03b20609553eed9e1c3788390110e02cbae5fcbc924087d71785
3
+ metadata.gz: df061ca5e8da419454b4e71fac6d1f1a5c0d10ac2bb134a9ed42d1e939605189
4
+ data.tar.gz: 6bf6a2af2771226c400200da710d1b21d91e22415ca724df6f2417c30edd85dc
5
5
  SHA512:
6
- metadata.gz: 13f5d85ad6fb9add3eb08569f09605fbc2e8b695b5598d7d41cfe6eb62536c29f6b405a87bcf724c957d7c95e893d599a6a5dc47a8318a7f58f8d0ba8a50a677
7
- data.tar.gz: 0e82b2549cac3763a82e7910107e82fb05f600312395c1bfa2c1519969419082c19dfb2ec8329adcda7fefa0734a21c17296540604f86c0e7ee0abc9774ccf20
6
+ metadata.gz: d75f067eb76806efc510ea3050a6c3b4394e2e731a01b6e6ba07169c3bdabd4620f338e6646e3558c99f830db2767cf4023492fb02294e9c78853dd4d114f7d0
7
+ data.tar.gz: 194fd87159da440d9d45b81a54edbd52051322f8dab8f09b95762c9883907c48da255a5b67f2af452e2ad8265a859f135f917385ca7431a888aaaf306747fffb
data/UPGRADING.md CHANGED
@@ -8,14 +8,14 @@ ActiveAdmin v4 uses TailwindCSS. It has **mobile web, dark mode and RTL support*
8
8
 
9
9
  These instructions assume the `cssbundling-rails` and `importmap-rails` gems are already installed and you have run their install commands in your app. If you haven't done so, please do before continuing.
10
10
 
11
- Update your `Gemfile` with `gem "activeadmin", "4.0.0.beta10"` and then run `gem install activeadmin --pre`.
11
+ Update your `Gemfile` with `gem "activeadmin", "4.0.0.beta11"` and then run `gem install activeadmin --pre`.
12
12
 
13
13
  Now, run `rails generate active_admin:assets` to replace the old assets with the new files.
14
14
 
15
15
  Then add the npm package and update the `build:css` script.
16
16
 
17
17
  ```
18
- yarn add @activeadmin/activeadmin@4.0.0-beta10
18
+ yarn add @activeadmin/activeadmin@4.0.0-beta11
19
19
  npm pkg set scripts.build:css="tailwindcss -i ./app/assets/stylesheets/active_admin.css -o ./app/assets/builds/active_admin.css --minify -c tailwind-active_admin.config.js"
20
20
  ```
21
21
 
@@ -61,7 +61,7 @@ module ActiveAdmin
61
61
  def self.wrap!(parent, name)
62
62
  ::Class.new parent do
63
63
  delegate :reorder, :page, :current_page, :total_pages, :limit_value,
64
- :total_count, :total_pages, :offset, :to_key, :group_values,
64
+ :total_count, :offset, :to_key, :group_values,
65
65
  :except, :find_each, :ransack, to: :object
66
66
 
67
67
  define_singleton_method(:name) { name }
@@ -108,8 +108,8 @@ module ActiveAdmin
108
108
  when TrueClass, FalseClass
109
109
  true
110
110
  else
111
- if resource.class.respond_to? :columns_hash
112
- column = resource.class.columns_hash[attr.to_s] and column.type == :boolean
111
+ if resource.class.respond_to? :attribute_types
112
+ resource.class.attribute_types[attr.to_s].is_a?(ActiveModel::Type::Boolean)
113
113
  end
114
114
  end
115
115
  end
data/config/importmap.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  pin "flowbite", preload: true # downloaded from https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.2.1/flowbite.min.js
3
- pin "@rails/ujs", to: "rails_ujs_esm.js", preload: true # downloaded from https://cdn.jsdelivr.net/npm/@rails/ujs@7.1.2/+esm
3
+ pin "@rails/ujs", to: "rails_ujs_esm.js", preload: true # downloaded from https://cdn.jsdelivr.net/npm/@rails/ujs@7.1.400/+esm
4
4
  pin "active_admin", to: "active_admin.js", preload: true
5
5
  pin_all_from File.expand_path("../app/javascript/active_admin", __dir__), under: "active_admin", preload: true
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveAdmin
3
- VERSION = "4.0.0.beta10"
3
+ VERSION = "4.0.0.beta11"
4
4
  end
@@ -23,6 +23,7 @@ module ActiveAdmin
23
23
 
24
24
  def row(*args, &block)
25
25
  title = args[0]
26
+ data = args[1] || args[0]
26
27
  options = args.extract_options!
27
28
  options["data-row"] = title.to_s.parameterize(separator: "_") if title.present?
28
29
 
@@ -32,7 +33,7 @@ module ActiveAdmin
32
33
  end
33
34
  @collection.each do |record|
34
35
  td do
35
- content_for(record, block || title)
36
+ content_for(record, block || data)
36
37
  end
37
38
  end
38
39
  end
@@ -102,7 +102,10 @@ module ActiveAdmin
102
102
  # you pass in the :total_pages option. We issue a query to determine
103
103
  # if there is another page or not, but the limit/offset make this
104
104
  # query fast.
105
- offset = @collection.offset(@collection.current_page * @collection.limit_value).limit(1).count
105
+ offset_scope = @collection.offset(@collection.current_page * @collection.limit_value)
106
+ # Support array collections. Kaminari::PaginatableArray does not respond to except
107
+ offset_scope = offset_scope.except(:select, :order) if offset_scope.respond_to?(:except)
108
+ offset = offset_scope.limit(1).count
106
109
  options[:total_pages] = @collection.current_page + offset
107
110
  options[:right] = 0
108
111
  end
data/plugin.js CHANGED
@@ -312,7 +312,7 @@ module.exports = plugin(
312
312
  '[type=radio]': {
313
313
  '@apply w-4 h-4 border-gray-300 focus:ring-2 focus:ring-blue-300 dark:focus:ring-blue-600 dark:focus:bg-blue-600 dark:bg-gray-700 dark:border-gray-600': {}
314
314
  },
315
- [['[type=date]', '[type=email]', '[type=number]', '[type=password]', '[type=tel]', '[type=text]', '[type=time]', '[type=url]', 'select', 'textarea']]: {
315
+ [['[type=datetime-local]', '[type=month]', '[type=week]', '[type=search]', '[type=date]', '[type=email]', '[type=number]', '[type=password]', '[type=tel]', '[type=text]', '[type=time]', '[type=url]', 'select', 'textarea']]: {
316
316
  '@apply bg-gray-50 border border-gray-300 text-gray-900 rounded-md focus:ring-blue-500 focus:border-blue-500 w-full dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500': {}
317
317
  },
318
318
  'a': {
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: 4.0.0.beta10
4
+ version: 4.0.0.beta11
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: 2024-08-24 00:00:00.000000000 Z
18
+ date: 2024-08-31 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: arbre