activeadmin 4.0.0.beta10 → 4.0.0.beta12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17abe55cddeec6028454b71ee930e2a99e83c0660303a6b901488aba36a90cda
4
- data.tar.gz: 4ba193f3c02f03b20609553eed9e1c3788390110e02cbae5fcbc924087d71785
3
+ metadata.gz: f813aff0e1f46af219b2a140e89d47c49d0a1789469a7de1696fb51a9a3f9bfa
4
+ data.tar.gz: 4a89afdb369f20b03fb313db3171ad186b2aed66968271e840bd8da9fdf4f127
5
5
  SHA512:
6
- metadata.gz: 13f5d85ad6fb9add3eb08569f09605fbc2e8b695b5598d7d41cfe6eb62536c29f6b405a87bcf724c957d7c95e893d599a6a5dc47a8318a7f58f8d0ba8a50a677
7
- data.tar.gz: 0e82b2549cac3763a82e7910107e82fb05f600312395c1bfa2c1519969419082c19dfb2ec8329adcda7fefa0734a21c17296540604f86c0e7ee0abc9774ccf20
6
+ metadata.gz: 9d81333a08a10871b0f1fca78836bccca4011de36153e8da14935a23dece664a3fee5f3ebba0e6f8070c0a014948ff41a8bfe5c162a40296e40013d95322f5ed
7
+ data.tar.gz: 4d98685077e1ac9fb02aff03e13f987595bf2b5d8a950a8b21e615f6057000e8a812f050849397f2edad46b1602dd0ff658f54fe1013b5740e94c63a09a78c20
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.beta12"` 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-beta12
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.beta12"
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': {
@@ -0,0 +1 @@
1
+ puts "Ciao"
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.beta12
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-09-15 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: arbre
@@ -79,14 +79,14 @@ dependencies:
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.7'
82
+ version: '2.0'
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.7'
89
+ version: '2.0'
90
90
  - !ruby/object:Gem::Dependency
91
91
  name: kaminari
92
92
  requirement: !ruby/object:Gem::Requirement
@@ -377,6 +377,7 @@ files:
377
377
  - lib/generators/active_admin/resource/templates/resource.rb.erb
378
378
  - lib/generators/active_admin/views_generator.rb
379
379
  - plugin.js
380
+ - vendor/bundle/offense.rb
380
381
  - vendor/javascript/flowbite.js
381
382
  - vendor/javascript/rails_ujs_esm.js
382
383
  homepage: https://activeadmin.info
@@ -406,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
406
407
  - !ruby/object:Gem::Version
407
408
  version: '0'
408
409
  requirements: []
409
- rubygems_version: 3.5.15
410
+ rubygems_version: 3.5.18
410
411
  signing_key:
411
412
  specification_version: 4
412
413
  summary: Active Admin is a Ruby on Rails plugin for generating administration style