activeadmin 4.0.0.beta12 → 4.0.0.beta14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/UPGRADING.md +2 -2
- data/app/controllers/active_admin/resource_controller/data_access.rb +8 -3
- data/app/helpers/active_admin/display_helper.rb +1 -1
- data/app/helpers/active_admin/layout_helper.rb +2 -2
- data/config/locales/es.yml +6 -0
- data/config/locales/ja.yml +4 -0
- data/config/locales/pl.yml +6 -0
- data/config/locales/zh-CN.yml +4 -0
- data/config/locales/zh-TW.yml +4 -0
- data/lib/active_admin/application.rb +3 -3
- data/lib/active_admin/application_settings.rb +1 -1
- data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -1
- data/lib/active_admin/batch_actions/views/selection_cells.rb +1 -1
- data/lib/active_admin/batch_actions.rb +4 -4
- data/lib/active_admin/dynamic_settings_node.rb +2 -2
- data/lib/active_admin/engine.rb +1 -1
- data/lib/active_admin/filters/active.rb +1 -1
- data/lib/active_admin/filters/resource_extension.rb +1 -1
- data/lib/active_admin/filters.rb +5 -5
- data/lib/active_admin/form_builder.rb +4 -5
- data/lib/active_admin/localizers.rb +1 -1
- data/lib/active_admin/menu_item.rb +1 -1
- data/lib/active_admin/namespace.rb +1 -1
- data/lib/active_admin/namespace_settings.rb +1 -1
- data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +1 -1
- data/lib/active_admin/orm/active_record/comments/views.rb +2 -2
- data/lib/active_admin/orm/active_record/comments.rb +3 -3
- data/lib/active_admin/orm/active_record.rb +1 -1
- data/lib/active_admin/pundit_adapter.rb +2 -2
- data/lib/active_admin/resource/action_items.rb +1 -1
- data/lib/active_admin/resource/belongs_to.rb +1 -1
- data/lib/active_admin/resource/sidebars.rb +1 -1
- data/lib/active_admin/resource.rb +16 -16
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/views/components/active_admin_form.rb +1 -13
- data/lib/active_admin/views/components/scopes.rb +2 -2
- data/lib/active_admin.rb +5 -5
- data/lib/activeadmin.rb +1 -1
- data/lib/generators/active_admin/devise/devise_generator.rb +2 -2
- data/plugin.js +4 -4
- metadata +6 -7
- data/vendor/bundle/offense.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd8e96446cfbff31209b99d16e1c73068cce5f8be2d617d8f78e6086b3cc84aa
|
4
|
+
data.tar.gz: 3e6a6f7eba472c1cc31b2b00c3ec966a0b6f3ac680db8ec43948254ac132f641
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c834a24095dfeb67cd11fe683af72215109fa8ed2c41135ffb69e3759fcca7adca5982a8e7f987d216797d478055730af4f4d290ce07a43440a83f4ddbc53664
|
7
|
+
data.tar.gz: 5f8658312c48a29fba3c90ecad7f6a5dd8ccb9318e73500524fa1b98d8d3862130d710d950d8af96fc70bfa4020ed87e1b45403f537461f70177eed256a08640
|
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.
|
11
|
+
Update your `Gemfile` with `gem "activeadmin", "4.0.0.beta14"` 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-
|
18
|
+
yarn add @activeadmin/activeadmin@4.0.0-beta14
|
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
|
|
@@ -168,11 +168,16 @@ module ActiveAdmin
|
|
168
168
|
#
|
169
169
|
# @return [void]
|
170
170
|
def update_resource(object, attributes)
|
171
|
-
|
171
|
+
status = nil
|
172
|
+
ActiveRecord::Base.transaction do
|
173
|
+
object = assign_attributes(object, attributes)
|
172
174
|
|
173
|
-
|
174
|
-
|
175
|
+
run_update_callbacks object do
|
176
|
+
status = save_resource(object)
|
177
|
+
raise ActiveRecord::Rollback unless status
|
178
|
+
end
|
175
179
|
end
|
180
|
+
status
|
176
181
|
end
|
177
182
|
|
178
183
|
# Destroys an object from the database and calls appropriate callbacks.
|
@@ -24,7 +24,7 @@ module ActiveAdmin
|
|
24
24
|
def display_name(resource)
|
25
25
|
unless resource.nil?
|
26
26
|
result = render_in_context(resource, display_name_method_for(resource))
|
27
|
-
if result.to_s
|
27
|
+
if result.to_s.strip.present?
|
28
28
|
ERB::Util.html_escape(result)
|
29
29
|
else
|
30
30
|
ERB::Util.html_escape(render_in_context(resource, DISPLAY_NAME_FALLBACK))
|
@@ -22,7 +22,7 @@ module ActiveAdmin
|
|
22
22
|
|
23
23
|
def action_items_for_action
|
24
24
|
@action_items_for_action ||= begin
|
25
|
-
if active_admin_config
|
25
|
+
if active_admin_config&.action_items?
|
26
26
|
active_admin_config.action_items_for(params[:action], self)
|
27
27
|
else
|
28
28
|
[]
|
@@ -32,7 +32,7 @@ module ActiveAdmin
|
|
32
32
|
|
33
33
|
def sidebar_sections_for_action
|
34
34
|
@sidebar_sections_for_action ||= begin
|
35
|
-
if active_admin_config
|
35
|
+
if active_admin_config&.sidebar_sections?
|
36
36
|
active_admin_config.sidebar_sections_for(params[:action], self)
|
37
37
|
else
|
38
38
|
[]
|
data/config/locales/es.yml
CHANGED
@@ -35,6 +35,10 @@ es:
|
|
35
35
|
has_many_delete: "Eliminar"
|
36
36
|
has_many_remove: "Quitar"
|
37
37
|
move: "Mover"
|
38
|
+
toggle_dark_mode: "Alternar modo oscuro"
|
39
|
+
toggle_main_navigation_menu: "Alternar el menú de navegación principal"
|
40
|
+
toggle_user_menu: "Alternar menú de usuario"
|
41
|
+
toggle_section: "Alternar sección"
|
38
42
|
filters:
|
39
43
|
buttons:
|
40
44
|
filter: "Filtrar"
|
@@ -62,6 +66,8 @@ es:
|
|
62
66
|
multiple: "Mostrando %{model} <b>%{from} - %{to}</b> de un total de <b>%{total}</b>"
|
63
67
|
multiple_without_total: "Mostrando %{model} <b>%{from} - %{to}</b>"
|
64
68
|
per_page: "Por página: "
|
69
|
+
previous: "Anterior"
|
70
|
+
next: "Siguiente"
|
65
71
|
entry:
|
66
72
|
one: "registro"
|
67
73
|
other: "registros"
|
data/config/locales/ja.yml
CHANGED
@@ -31,6 +31,10 @@ ja:
|
|
31
31
|
"yes": "はい"
|
32
32
|
"no": "いいえ"
|
33
33
|
"unset": "いいえ"
|
34
|
+
toggle_dark_mode: "ダークモードを切り替える"
|
35
|
+
toggle_main_navigation_menu: "メインナビゲーションメニューを切り替える"
|
36
|
+
toggle_section: "セクションを切り替える"
|
37
|
+
toggle_user_menu: "ユーザーメニューを切り替える"
|
34
38
|
logout: "ログアウト"
|
35
39
|
powered_by: "Powered by %{active_admin} %{version}"
|
36
40
|
sidebars:
|
data/config/locales/pl.yml
CHANGED
@@ -49,11 +49,17 @@ pl:
|
|
49
49
|
scopes:
|
50
50
|
all: "Wszystko"
|
51
51
|
search_status:
|
52
|
+
title: "Wyszukiwanie"
|
53
|
+
title_with_scope: "Wyszukiwanie %{name}"
|
52
54
|
no_current_filters: "Brak"
|
53
55
|
status_tag:
|
54
56
|
"yes": "Tak"
|
55
57
|
"no": "Nie"
|
56
58
|
"unset": "Nie"
|
59
|
+
toggle_dark_mode: Przełącz tryb ciemny
|
60
|
+
toggle_main_navigation_menu: Przełącz główną nawigację
|
61
|
+
toggle_section: Przełącz sekcję
|
62
|
+
toggle_user_menu: Przełącz menu użytkownika
|
57
63
|
logout: "Wyloguj"
|
58
64
|
powered_by: "Powered by %{active_admin} %{version}"
|
59
65
|
sidebars:
|
data/config/locales/zh-CN.yml
CHANGED
data/config/locales/zh-TW.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
require_relative "router"
|
3
|
+
require_relative "application_settings"
|
4
|
+
require_relative "namespace_settings"
|
5
5
|
|
6
6
|
module ActiveAdmin
|
7
7
|
class Application
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
ActiveAdmin.before_load do |app|
|
3
|
-
|
4
|
-
|
3
|
+
require_relative "batch_actions/resource_extension"
|
4
|
+
require_relative "batch_actions/controller"
|
5
5
|
|
6
6
|
# Add our Extensions
|
7
7
|
ActiveAdmin::Resource.send :include, ActiveAdmin::BatchActions::ResourceExtension
|
8
8
|
ActiveAdmin::ResourceController.send :include, ActiveAdmin::BatchActions::Controller
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
require_relative "batch_actions/views/batch_action_form"
|
11
|
+
require_relative "batch_actions/views/selection_cells"
|
12
12
|
end
|
data/lib/active_admin/engine.rb
CHANGED
data/lib/active_admin/filters.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
require_relative "filters/dsl"
|
3
|
+
require_relative "filters/resource_extension"
|
4
|
+
require_relative "filters/formtastic_addons"
|
5
|
+
require_relative "filters/forms"
|
6
|
+
require_relative "helpers/optional_display"
|
7
7
|
|
8
8
|
# Add our Extensions
|
9
9
|
ActiveAdmin::ResourceDSL.send :include, ActiveAdmin::Filters::DSL
|
@@ -95,7 +95,7 @@ module ActiveAdmin
|
|
95
95
|
contents = without_wrapper { inputs(options, &form_block) }
|
96
96
|
contents ||= "".html_safe
|
97
97
|
|
98
|
-
js = new_record ? js_for_has_many(
|
98
|
+
js = new_record ? js_for_has_many(&form_block) : ""
|
99
99
|
contents << js
|
100
100
|
end
|
101
101
|
|
@@ -159,14 +159,13 @@ module ActiveAdmin
|
|
159
159
|
end
|
160
160
|
|
161
161
|
# Capture the ADD JS
|
162
|
-
def js_for_has_many(
|
162
|
+
def js_for_has_many(&form_block)
|
163
163
|
assoc_name = assoc_klass.model_name
|
164
164
|
placeholder = "NEW_#{assoc_name.to_s.underscore.upcase.tr('/', '_')}_RECORD"
|
165
|
-
opts =
|
165
|
+
opts = options.merge(
|
166
166
|
for: [assoc, assoc_klass.new],
|
167
|
-
class: class_string,
|
168
167
|
for_options: { child_index: placeholder }
|
169
|
-
|
168
|
+
)
|
170
169
|
html = template.capture { __getobj__.send(:inputs_for_nested_attributes, opts, &form_block) }
|
171
170
|
text = new_record.is_a?(String) ? new_record : I18n.t("active_admin.has_many_new", model: assoc_name.human)
|
172
171
|
|
@@ -1,3 +1,3 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
2
|
+
require_relative "../../../views"
|
3
|
+
require_relative "views/active_admin_comments"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
require_relative "comments/views"
|
3
|
+
require_relative "comments/namespace_helper"
|
4
|
+
require_relative "comments/resource_helper"
|
5
5
|
|
6
6
|
# Add the comments configuration
|
7
7
|
ActiveAdmin::Application.inheritable_setting :comments, true
|
@@ -23,7 +23,7 @@ module ActiveAdmin
|
|
23
23
|
# which means there is no way how to scope other actions
|
24
24
|
Pundit.policy_scope!(user, namespace(collection))
|
25
25
|
rescue Pundit::NotDefinedError => e
|
26
|
-
if default_policy_class
|
26
|
+
if default_policy_class&.const_defined?(:Scope)
|
27
27
|
default_policy_class::Scope.new(user, collection).resolve
|
28
28
|
else
|
29
29
|
raise e
|
@@ -95,7 +95,7 @@ module ActiveAdmin
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def default_policy_class
|
98
|
-
ActiveAdmin.application.pundit_default_policy
|
98
|
+
ActiveAdmin.application.pundit_default_policy&.constantize
|
99
99
|
end
|
100
100
|
|
101
101
|
def default_policy(subject)
|
@@ -1,20 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
2
|
+
require_relative "view_helpers/method_or_proc_helper"
|
3
|
+
require_relative "resource/action_items"
|
4
|
+
require_relative "resource/attributes"
|
5
|
+
require_relative "resource/controllers"
|
6
|
+
require_relative "resource/menu"
|
7
|
+
require_relative "resource/page_presenters"
|
8
|
+
require_relative "resource/pagination"
|
9
|
+
require_relative "resource/routes"
|
10
|
+
require_relative "resource/naming"
|
11
|
+
require_relative "resource/scopes"
|
12
|
+
require_relative "resource/includes"
|
13
|
+
require_relative "resource/scope_to"
|
14
|
+
require_relative "resource/sidebars"
|
15
|
+
require_relative "resource/belongs_to"
|
16
|
+
require_relative "resource/ordering"
|
17
|
+
require_relative "resource/model"
|
18
18
|
|
19
19
|
module ActiveAdmin
|
20
20
|
|
data/lib/active_admin/version.rb
CHANGED
@@ -132,23 +132,11 @@ module ActiveAdmin
|
|
132
132
|
legend = args.shift if args.first.is_a?(::String)
|
133
133
|
legend = html_options.delete(:name) if html_options.key?(:name)
|
134
134
|
legend_tag = legend ? helpers.tag.legend(legend, class: "fieldset-title") : ""
|
135
|
-
fieldset_attrs =
|
135
|
+
fieldset_attrs = helpers.tag.attributes html_options
|
136
136
|
@opening_tag = "<fieldset #{fieldset_attrs}>#{legend_tag}<ol>"
|
137
137
|
@closing_tag = "</ol></fieldset>"
|
138
138
|
super(*(args << html_options), &block)
|
139
139
|
end
|
140
|
-
|
141
|
-
private
|
142
|
-
|
143
|
-
def tag_attributes(html_options)
|
144
|
-
if Rails::VERSION::MAJOR <= 6
|
145
|
-
# Reimplement tag.attributes to backport support for Rails 6.1.
|
146
|
-
# TODO: this can be removed when support for Rails 6.x is dropped
|
147
|
-
helpers.tag.tag_options(html_options.to_h).to_s.strip.html_safe
|
148
|
-
else
|
149
|
-
helpers.tag.attributes html_options
|
150
|
-
end
|
151
|
-
end
|
152
140
|
end
|
153
141
|
|
154
142
|
class SemanticActionsProxy < FormtasticProxy
|
data/lib/active_admin.rb
CHANGED
@@ -125,12 +125,12 @@ module ActiveAdmin
|
|
125
125
|
end
|
126
126
|
|
127
127
|
# Require things that don't support autoload
|
128
|
-
|
129
|
-
|
128
|
+
require_relative "active_admin/engine"
|
129
|
+
require_relative "active_admin/error"
|
130
130
|
|
131
131
|
# Require internal plugins
|
132
|
-
|
133
|
-
|
132
|
+
require_relative "active_admin/batch_actions"
|
133
|
+
require_relative "active_admin/filters"
|
134
134
|
|
135
135
|
# Require ORM-specific plugins
|
136
|
-
|
136
|
+
require_relative "active_admin/orm/active_record" if defined? ActiveRecord
|
data/lib/activeadmin.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
require_relative "active_admin"
|
data/plugin.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import plugin from 'tailwindcss/plugin';
|
2
|
+
import defaultTheme from 'tailwindcss/defaultTheme';
|
3
|
+
import colors from 'tailwindcss/colors';
|
4
4
|
const { spacing, borderWidth, borderRadius } = defaultTheme;
|
5
5
|
|
6
6
|
// https://github.com/tailwindlabs/tailwindcss/discussions/9336
|
@@ -28,7 +28,7 @@ const svgToTinyDataUri = (() => {
|
|
28
28
|
return svgToTinyDataUri;
|
29
29
|
})();
|
30
30
|
|
31
|
-
|
31
|
+
export default plugin(
|
32
32
|
function({ addBase, addComponents, theme }) {
|
33
33
|
addBase({
|
34
34
|
[[
|
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.
|
4
|
+
version: 4.0.0.beta14
|
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-
|
18
|
+
date: 2024-11-25 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: arbre
|
@@ -107,14 +107,14 @@ dependencies:
|
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '7.0'
|
111
111
|
type: :runtime
|
112
112
|
prerelease: false
|
113
113
|
version_requirements: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '7.0'
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
119
|
name: ransack
|
120
120
|
requirement: !ruby/object:Gem::Requirement
|
@@ -377,7 +377,6 @@ 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
|
381
380
|
- vendor/javascript/flowbite.js
|
382
381
|
- vendor/javascript/rails_ujs_esm.js
|
383
382
|
homepage: https://activeadmin.info
|
@@ -400,14 +399,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
400
399
|
requirements:
|
401
400
|
- - ">="
|
402
401
|
- !ruby/object:Gem::Version
|
403
|
-
version: '3.
|
402
|
+
version: '3.1'
|
404
403
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
405
404
|
requirements:
|
406
405
|
- - ">="
|
407
406
|
- !ruby/object:Gem::Version
|
408
407
|
version: '0'
|
409
408
|
requirements: []
|
410
|
-
rubygems_version: 3.5.
|
409
|
+
rubygems_version: 3.5.15
|
411
410
|
signing_key:
|
412
411
|
specification_version: 4
|
413
412
|
summary: Active Admin is a Ruby on Rails plugin for generating administration style
|
data/vendor/bundle/offense.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
puts "Ciao"
|