activeadmin 4.0.0.beta13 → 4.0.0.beta14
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 +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/ja.yml +4 -0
- data/config/locales/pl.yml +2 -0
- data/config/locales/zh-CN.yml +4 -0
- data/config/locales/zh-TW.yml +4 -0
- data/lib/active_admin/form_builder.rb +4 -5
- data/lib/active_admin/pundit_adapter.rb +2 -2
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/views/components/active_admin_form.rb +1 -13
- 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/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
data/config/locales/zh-CN.yml
CHANGED
data/config/locales/zh-TW.yml
CHANGED
@@ -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
|
|
@@ -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)
|
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/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"
|