rails_admin 3.0.0.rc → 3.0.0.rc4
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/controllers/rails_admin/main_controller.rb +2 -3
- data/app/helpers/rails_admin/application_helper.rb +33 -11
- data/app/views/layouts/rails_admin/_head.html.erb +8 -5
- data/app/views/layouts/rails_admin/_secondary_navigation.html.erb +2 -2
- data/app/views/layouts/rails_admin/application.html.erb +1 -1
- data/app/views/rails_admin/main/export.html.erb +1 -1
- data/app/views/rails_admin/main/index.html.erb +2 -2
- data/app/views/rails_admin/main/show.html.erb +11 -9
- data/lib/generators/rails_admin/install_generator.rb +8 -6
- data/lib/rails_admin/abstract_model.rb +3 -4
- data/lib/rails_admin/adapters/active_record.rb +2 -1
- data/lib/rails_admin/adapters/mongoid.rb +2 -2
- data/lib/rails_admin/config/actions/base.rb +5 -0
- data/lib/rails_admin/config/actions/export.rb +2 -1
- data/lib/rails_admin/config/actions/index.rb +2 -1
- data/lib/rails_admin/config/actions/new.rb +2 -1
- data/lib/rails_admin/config/actions/show_in_app.rb +4 -0
- data/lib/rails_admin/config/fields/base.rb +2 -2
- data/lib/rails_admin/config/fields/factories/active_storage.rb +2 -1
- data/lib/rails_admin/config/fields/factories/association.rb +4 -4
- data/lib/rails_admin/config/fields/factories/carrierwave.rb +2 -1
- data/lib/rails_admin/config/fields/factories/devise.rb +2 -1
- data/lib/rails_admin/config/fields/factories/dragonfly.rb +2 -1
- data/lib/rails_admin/config/fields/factories/paperclip.rb +2 -1
- data/lib/rails_admin/config/fields/types/datetime.rb +2 -1
- data/lib/rails_admin/config.rb +14 -3
- data/lib/rails_admin/engine.rb +8 -9
- data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +2 -2
- data/lib/rails_admin/extensions/pundit/authorization_adapter.rb +1 -1
- data/lib/rails_admin/version.rb +34 -1
- data/package.json +1 -1
- data/src/rails_admin/ui.js +19 -3
- data/vendor/assets/javascripts/rails_admin/flatpickr-with-locales.js +958 -395
- metadata +11 -6
data/lib/rails_admin/version.rb
CHANGED
@@ -3,7 +3,7 @@ module RailsAdmin
|
|
3
3
|
MAJOR = 3
|
4
4
|
MINOR = 0
|
5
5
|
PATCH = 0
|
6
|
-
PRE = '
|
6
|
+
PRE = 'rc4'.freeze
|
7
7
|
|
8
8
|
class << self
|
9
9
|
# @return [String]
|
@@ -14,6 +14,39 @@ module RailsAdmin
|
|
14
14
|
def js
|
15
15
|
JSON.parse(File.read("#{__dir__}/../../package.json"))['version']
|
16
16
|
end
|
17
|
+
|
18
|
+
def actual_js_version
|
19
|
+
case RailsAdmin.config.asset_source
|
20
|
+
when :webpacker, :webpack
|
21
|
+
js_version_from_node_modules
|
22
|
+
else
|
23
|
+
js
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def warn_with_js_version
|
28
|
+
return unless Rails.env.development? || Rails.env.test?
|
29
|
+
|
30
|
+
case actual_js_version
|
31
|
+
when js
|
32
|
+
# Good
|
33
|
+
when nil
|
34
|
+
warn "[Warning] Failed to detect RailsAdmin npm package, did you run 'yarn install'?"
|
35
|
+
else
|
36
|
+
warn <<~MSG
|
37
|
+
[Warning] RailsAdmin npm package version inconsistency detected, expected #{js} but actually used is #{actual_js_version}.
|
38
|
+
This may cause partial or total malfunction of RailsAdmin frontend features.
|
39
|
+
MSG
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def js_version_from_node_modules
|
46
|
+
JSON.parse(File.read(Rails.root.join('node_modules/rails_admin/package.json')))['version']
|
47
|
+
rescue StandardError
|
48
|
+
nil
|
49
|
+
end
|
17
50
|
end
|
18
51
|
end
|
19
52
|
end
|
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-rc4",
|
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,12 +80,28 @@ import I18n from "./i18n";
|
|
80
80
|
.each(function () {
|
81
81
|
$(this).siblings(".control-group").hide();
|
82
82
|
});
|
83
|
-
$(
|
84
|
-
|
85
|
-
|
83
|
+
$('button[name][type="submit"]')
|
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
|
});
|
101
|
+
// Workaround for https://github.com/heartcombo/devise/issues/5458
|
102
|
+
$("a[data-method]").on("click", function (event) {
|
103
|
+
window.Turbo.session.drive = false;
|
104
|
+
});
|
89
105
|
});
|
90
106
|
|
91
107
|
$(document).on("click", ".bulk-link", function (event) {
|