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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5dbfec366d5d5bdfd29d652fb12b08631ac61984d67b770e82ccdb863e08e5c
4
- data.tar.gz: 79bad15a57aea48250afd9257354caaac639767d794c7fe0dadc893c25b34cd4
3
+ metadata.gz: 142382cf0987b581cb64996e716ad77cf9ae76dab5aa1bf019b8ca38fb7daed0
4
+ data.tar.gz: 58a52e67fc458713f0245ea244e2a129f370309edc91511678ba06bbc756e9cc
5
5
  SHA512:
6
- metadata.gz: e152b02c903442a40d247078958dca2d762c60476e9ce374e37085b11a9419925dbaa0d6f834b3f13c38e12a4e832ab5ea437f465fc6e71f7a1fa206efec28a6
7
- data.tar.gz: 5abb152ffd68f269badf7805e08e328a68b97efbc40030736ebaf45b1fe81de3005694004e3d7526fdd4139ee4beaf66154013b2bee71b3ca8e8402be7f9e17f
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/sferik/rails_admin/Test)][ghactions]
5
- [![Coverage Status](https://img.shields.io/coveralls/sferik/rails_admin.svg)][coveralls]
6
- [![Inline docs](http://inch-ci.org/github/sferik/rails_admin.svg)][inch]
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/sferik/rails_admin
13
- [inch]: http://inch-ci.org/github/sferik/rails_admin
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.rc', '< 4']`
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
@@ -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
- namespace = ask_for('Where do you want to mount rails_admin?', 'admin', _namespace)
16
- route("mount RailsAdmin::Engine => '/#{namespace}', as: 'rails_admin'")
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
@@ -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
- attr_accessor :asset_source
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 = (defined?(Webpacker) ? :webpacker : :sprockets)
340
+ @asset_source = nil
330
341
  @parent_controller = '::ActionController::Base'
331
342
  @forgery_protection_settings = {with: :exception}
332
343
  RailsAdmin::Config::Actions.reset
@@ -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'
@@ -3,7 +3,7 @@ module RailsAdmin
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
5
  PATCH = 0
6
- PRE = 'rc'.freeze
6
+ PRE = 'rc2'.freeze
7
7
 
8
8
  class << self
9
9
  # @return [String]
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rails_admin",
3
- "version": "3.0.0-rc",
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",
@@ -80,9 +80,21 @@ import I18n from "./i18n";
80
80
  .each(function () {
81
81
  $(this).siblings(".control-group").hide();
82
82
  });
83
- $("[formnovalidate]").on("click", function () {
84
- $(this).closest("form").attr("novalidate", true);
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.rc
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-06 00:00:00.000000000 Z
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