rails_admin 3.0.0.rc → 3.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails_admin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +6 -8
- data/app/assets/javascripts/{rails_admin.js → rails_admin/application.js} +0 -0
- data/app/assets/stylesheets/{rails_admin.scss → rails_admin/application.scss} +0 -0
- data/app/views/layouts/rails_admin/_head.html.erb +2 -2
- data/lib/generators/rails_admin/install_generator.rb +6 -2
- data/lib/rails_admin/abstract_model.rb +1 -1
- data/lib/rails_admin/config.rb +13 -2
- data/lib/rails_admin/engine.rb +2 -2
- data/lib/rails_admin/version.rb +1 -1
- data/package.json +1 -1
- data/src/rails_admin/ui.js +15 -3
- metadata +10 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 142382cf0987b581cb64996e716ad77cf9ae76dab5aa1bf019b8ca38fb7daed0
|
4
|
+
data.tar.gz: 58a52e67fc458713f0245ea244e2a129f370309edc91511678ba06bbc756e9cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55fce15b0a7bf4f168b042ab7415fd24f0cefdb509d61efdb2f3f15de42b657bbbe24b62e686a359f18239f0c9ad36436bbd229c22b35c28be17d8f27fb5ef7f
|
7
|
+
data.tar.gz: 9d076ac618ecdbb0680e7d8e7dd3472b7d0e47d10d5d12b4bdfc260c43297ded2e430a410926d0a680cbe120406e20da3678b5adb5ef2050efebe9aa8e2f8e12
|
data/README.md
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
# RailsAdmin
|
2
2
|
|
3
3
|
[![Gem Version](https://img.shields.io/gem/v/rails_admin.svg)][gem]
|
4
|
-
[![Build Status](https://img.shields.io/github/workflow/status/
|
5
|
-
[![Coverage Status](https://img.shields.io/coveralls/
|
6
|
-
[![
|
7
|
-
[![Code Climate](https://codeclimate.com/github/sferik/rails_admin.svg)][codeclimate]
|
4
|
+
[![Build Status](https://img.shields.io/github/workflow/status/railsadminteam/rails_admin/Test)][ghactions]
|
5
|
+
[![Coverage Status](https://img.shields.io/coveralls/railsadminteam/rails_admin.svg)][coveralls]
|
6
|
+
[![Code Climate](https://codeclimate.com/github/railsadminteam/rails_admin.svg)][codeclimate]
|
8
7
|
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=rails_admin&package-manager=bundler&version-scheme=semver)][semver]
|
9
8
|
|
10
9
|
[gem]: https://rubygems.org/gems/rails_admin
|
11
10
|
[ghactions]: https://github.com/railsadminteam/rails_admin/actions
|
12
|
-
[coveralls]: https://coveralls.io/r/
|
13
|
-
[
|
14
|
-
[codeclimate]: https://codeclimate.com/github/sferik/rails_admin
|
11
|
+
[coveralls]: https://coveralls.io/r/railsadminteam/rails_admin
|
12
|
+
[codeclimate]: https://codeclimate.com/github/railsadminteam/rails_admin
|
15
13
|
[semver]: https://dependabot.com/compatibility-score.html?dependency-name=rails_admin&package-manager=bundler&version-scheme=semver
|
16
14
|
|
17
15
|
RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.
|
@@ -47,7 +45,7 @@ RailsAdmin is a Rails engine that provides an easy-to-use interface for managing
|
|
47
45
|
|
48
46
|
## Installation
|
49
47
|
|
50
|
-
1. On your gemfile: `gem 'rails_admin', ['>= 3.0.0.
|
48
|
+
1. On your gemfile: `gem 'rails_admin', ['>= 3.0.0.rc2', '< 4']`
|
51
49
|
2. Run `bundle install`
|
52
50
|
3. Run `rails g rails_admin:install`
|
53
51
|
4. Provide a namespace for the routes when asked
|
File without changes
|
File without changes
|
@@ -9,8 +9,8 @@
|
|
9
9
|
<%= javascript_pack_tag "rails_admin", async: true %>
|
10
10
|
<% when :webpack, :sprockets %>
|
11
11
|
<% handle_asset_dependency_error do %>
|
12
|
-
<%= stylesheet_link_tag "rails_admin.css", media: :all %>
|
13
|
-
<%= javascript_include_tag "rails_admin.js", async: true %>
|
12
|
+
<%= stylesheet_link_tag "rails_admin/application.css", media: :all %>
|
13
|
+
<%= javascript_include_tag "rails_admin/application.js", async: true %>
|
14
14
|
<% end %>
|
15
15
|
<% else
|
16
16
|
raise "Unknown asset_source: #{RailsAdmin::config.asset_source}"
|
@@ -12,8 +12,12 @@ module RailsAdmin
|
|
12
12
|
desc 'RailsAdmin installation generator'
|
13
13
|
|
14
14
|
def install
|
15
|
-
|
16
|
-
|
15
|
+
if File.read(File.join(destination_root, 'config/routes.rb')).include?('mount RailsAdmin::Engine')
|
16
|
+
display "Skipped route addition, since it's already there"
|
17
|
+
else
|
18
|
+
namespace = ask_for('Where do you want to mount rails_admin?', 'admin', _namespace)
|
19
|
+
route("mount RailsAdmin::Engine => '/#{namespace}', as: 'rails_admin'")
|
20
|
+
end
|
17
21
|
if File.exist? File.join(destination_root, 'config/initializers/rails_admin.rb')
|
18
22
|
insert_into_file 'config/initializers/rails_admin.rb', " config.asset_source = :#{asset}\n", after: "RailsAdmin.config do |config|\n"
|
19
23
|
else
|
@@ -19,7 +19,7 @@ module RailsAdmin
|
|
19
19
|
def new(m)
|
20
20
|
m = m.constantize unless m.is_a?(Class)
|
21
21
|
(am = old_new(m)).model && am.adapter ? am : nil
|
22
|
-
rescue *([LoadError, NameError] + (defined?(ActiveRecord) ? ['ActiveRecord::NoDatabaseError'.constantize] : []))
|
22
|
+
rescue *([LoadError, NameError] + (defined?(ActiveRecord) ? ['ActiveRecord::NoDatabaseError'.constantize, 'ActiveRecord::ConnectionNotEstablished'.constantize] : []))
|
23
23
|
puts "[RailsAdmin] Could not load model #{m}, assuming model is non existing. (#{$ERROR_INFO})" unless Rails.env.test?
|
24
24
|
nil
|
25
25
|
end
|
data/lib/rails_admin/config.rb
CHANGED
@@ -81,7 +81,7 @@ module RailsAdmin
|
|
81
81
|
attr_accessor :navigation_static_label
|
82
82
|
|
83
83
|
# Set where RailsAdmin fetches JS/CSS from, defaults to :sprockets
|
84
|
-
|
84
|
+
attr_writer :asset_source
|
85
85
|
|
86
86
|
# Finish initialization by executing deferred configuration blocks
|
87
87
|
def initialize!
|
@@ -257,6 +257,17 @@ module RailsAdmin
|
|
257
257
|
@registry[key]
|
258
258
|
end
|
259
259
|
|
260
|
+
def asset_source
|
261
|
+
@asset_source ||=
|
262
|
+
begin
|
263
|
+
warn <<-MSG.gsub(/^ +/, '').freeze
|
264
|
+
[Warning] After upgrading RailsAdmin to 3.x you haven't set asset_source yet, using :sprockets as the default.
|
265
|
+
To suppress this message, run 'rails rails_admin:install' to setup the asset delivery method suitable to you.
|
266
|
+
MSG
|
267
|
+
:sprockets
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
260
271
|
def default_hidden_fields=(fields)
|
261
272
|
if fields.is_a?(Array)
|
262
273
|
@default_hidden_fields = {}
|
@@ -326,7 +337,7 @@ module RailsAdmin
|
|
326
337
|
@show_gravatar = true
|
327
338
|
@navigation_static_links = {}
|
328
339
|
@navigation_static_label = nil
|
329
|
-
@asset_source =
|
340
|
+
@asset_source = nil
|
330
341
|
@parent_controller = '::ActionController::Base'
|
331
342
|
@forgery_protection_settings = {with: :exception}
|
332
343
|
RailsAdmin::Config::Actions.reset
|
data/lib/rails_admin/engine.rb
CHANGED
@@ -13,8 +13,8 @@ module RailsAdmin
|
|
13
13
|
initializer 'RailsAdmin precompile hook', group: :all do |app|
|
14
14
|
if app.config.respond_to?(:assets)
|
15
15
|
app.config.assets.precompile += %w[
|
16
|
-
rails_admin.js
|
17
|
-
rails_admin.css
|
16
|
+
rails_admin/application.js
|
17
|
+
rails_admin/application.css
|
18
18
|
]
|
19
19
|
app.config.assets.paths << RailsAdmin::Engine.root.join('src')
|
20
20
|
require 'rails_admin/support/esmodule_preprocessor'
|
data/lib/rails_admin/version.rb
CHANGED
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "rails_admin",
|
3
|
-
"version": "3.0.0-
|
3
|
+
"version": "3.0.0-rc2",
|
4
4
|
"description": "RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.",
|
5
5
|
"homepage": "https://github.com/railsadminteam/rails_admin",
|
6
6
|
"license": "MIT",
|
data/src/rails_admin/ui.js
CHANGED
@@ -80,9 +80,21 @@ import I18n from "./i18n";
|
|
80
80
|
.each(function () {
|
81
81
|
$(this).siblings(".control-group").hide();
|
82
82
|
});
|
83
|
-
$("
|
84
|
-
|
85
|
-
|
83
|
+
$(".form-actions .extra_buttons button")
|
84
|
+
.attr("type", "button")
|
85
|
+
.on("click", function () {
|
86
|
+
var form = $(this).closest("form");
|
87
|
+
form.append(
|
88
|
+
$("<input />")
|
89
|
+
.attr("type", "hidden")
|
90
|
+
.attr("name", $(this).attr("name"))
|
91
|
+
.attr("value", true)
|
92
|
+
);
|
93
|
+
if ($(this).is("[formnovalidate]")) {
|
94
|
+
form.attr("novalidate", true);
|
95
|
+
}
|
96
|
+
form.trigger("submit");
|
97
|
+
});
|
86
98
|
$.each($("#filters_box").data("options"), function () {
|
87
99
|
$.filters.append(this);
|
88
100
|
});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Michaels-Ober
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2022-02-
|
15
|
+
date: 2022-02-20 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activemodel-serializers-xml
|
@@ -124,9 +124,9 @@ files:
|
|
124
124
|
- LICENSE.md
|
125
125
|
- README.md
|
126
126
|
- Rakefile
|
127
|
-
- app/assets/javascripts/rails_admin.js
|
127
|
+
- app/assets/javascripts/rails_admin/application.js
|
128
128
|
- app/assets/javascripts/rails_admin/custom/ui.js
|
129
|
-
- app/assets/stylesheets/rails_admin.scss
|
129
|
+
- app/assets/stylesheets/rails_admin/application.scss
|
130
130
|
- app/assets/stylesheets/rails_admin/custom/mixins.scss
|
131
131
|
- app/assets/stylesheets/rails_admin/custom/theming.scss
|
132
132
|
- app/assets/stylesheets/rails_admin/custom/variables.scss
|
@@ -444,7 +444,12 @@ homepage: https://github.com/railsadminteam/rails_admin
|
|
444
444
|
licenses:
|
445
445
|
- MIT
|
446
446
|
metadata: {}
|
447
|
-
post_install_message:
|
447
|
+
post_install_message: "\n ### Upgrading RailsAdmin from 2.x.x to 3.x.x ###\n\n
|
448
|
+
\ Due to introduction of Webpack/Webpacker support, some additional dependencies
|
449
|
+
and configuration will be needed.\n Running `bin/rails g rails_admin:install`
|
450
|
+
will suggest required changes, based on the current setup of your app.\n\n For
|
451
|
+
a complete list of changes, see https://github.com/railsadminteam/rails_admin/blob/master/CHANGELOG.md\n
|
452
|
+
\ "
|
448
453
|
rdoc_options: []
|
449
454
|
require_paths:
|
450
455
|
- lib
|