rails_admin 3.1.0 → 3.1.1
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/app/helpers/rails_admin/application_helper.rb +1 -1
- data/app/views/layouts/rails_admin/_sidebar_navigation.html.erb +1 -1
- data/lib/generators/rails_admin/install_generator.rb +15 -12
- data/lib/generators/rails_admin/templates/rails_admin.scss.erb +1 -1
- data/lib/generators/rails_admin/templates/rails_admin.webpacker.js +1 -1
- data/lib/rails_admin/config/lazy_model.rb +1 -1
- data/lib/rails_admin/config/model.rb +1 -3
- data/lib/rails_admin/version.rb +1 -1
- data/package.json +2 -2
- data/src/rails_admin/base.js +1 -2
- data/src/rails_admin/filter-box.js +1 -1
- data/src/rails_admin/jquery.js +3 -0
- metadata +3 -4
- data/vendor/assets/images/rails_admin/bootstrap/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/rails_admin/bootstrap/glyphicons-halflings.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32f625ca21a5c94c2fc91766ae74ef690a92ff7f882068b70d617ad7b1e1ff3a
|
4
|
+
data.tar.gz: ed3af9f17b3277f11a4b17db9beffe03d80294b453bb086d7aa819c46ce9cc1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ad917ef318789585952a8e82084d3042960037a441ce1197f752f036e4f581107c37b0dab9466627fbe60e3f22e03d9a62f9af2f92ab9d77b1f5e02cfc85167
|
7
|
+
data.tar.gz: 02225217c1f2997fccfce31605d494bdc5668778482ccb8c84231cf431efaafa4a830988526c1bfae88cac4a0342d41d1d7bd10b9507a8c60c2da2f1131d3250
|
@@ -122,7 +122,7 @@ module RailsAdmin
|
|
122
122
|
nav_icon = node.navigation_icon ? %(<i class="#{node.navigation_icon}"></i>).html_safe : ''
|
123
123
|
css_classes = ['nav-link']
|
124
124
|
css_classes.push("nav-level-#{level}") if level > 0
|
125
|
-
css_classes.push('active') if
|
125
|
+
css_classes.push('active') if @action && current_action?(@action, model_param)
|
126
126
|
li = content_tag :li, data: {model: model_param} do
|
127
127
|
link_to nav_icon + " " + node.label_plural, url, class: css_classes.join(' ')
|
128
128
|
end
|
@@ -64,6 +64,8 @@ module RailsAdmin
|
|
64
64
|
run "yarn add rails_admin@#{RailsAdmin::Version.js}"
|
65
65
|
template 'rails_admin.webpacker.js', 'app/javascript/packs/rails_admin.js'
|
66
66
|
template 'rails_admin.scss.erb', 'app/javascript/stylesheets/rails_admin.scss'
|
67
|
+
# To work around https://github.com/railsadminteam/rails_admin/issues/3565
|
68
|
+
add_package_json_field('resolutions', {'rails_admin/@fortawesome/fontawesome-free' => '^5.15.0'})
|
67
69
|
end
|
68
70
|
|
69
71
|
def configure_for_webpack
|
@@ -99,28 +101,29 @@ module RailsAdmin
|
|
99
101
|
else
|
100
102
|
add_file 'config/initializers/assets.rb', asset_config
|
101
103
|
end
|
102
|
-
|
104
|
+
add_package_json_field('scripts', additional_script_entries.merge({'build:css' => 'sass ./app/assets/stylesheets/rails_admin.scss:./app/assets/builds/rails_admin.css --no-source-map --load-path=node_modules'}), <<~INSTRUCTION)
|
105
|
+
Taking 'build:css' as an example, if you're already have application.sass.css for the sass build, the resulting script would look like:
|
106
|
+
sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css ./app/assets/stylesheets/rails_admin.scss:./app/assets/builds/rails_admin.css --no-source-map --load-path=node_modules
|
107
|
+
INSTRUCTION
|
103
108
|
end
|
104
109
|
|
105
|
-
def
|
106
|
-
display
|
110
|
+
def add_package_json_field(name, entries, instruction = nil)
|
111
|
+
display "Add #{name} to package.json"
|
107
112
|
package = begin
|
108
113
|
JSON.parse(File.read(File.join(destination_root, 'package.json')))
|
109
114
|
rescue Errno::ENOENT, JSON::ParserError
|
110
115
|
{}
|
111
116
|
end
|
112
|
-
if package[
|
113
|
-
say
|
114
|
-
You need to merge "
|
115
|
-
Taking 'build:css' as an example, if you're already have application.sass.css for the sass build, the resulting script would look like:
|
116
|
-
sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css ./app/assets/stylesheets/rails_admin.scss:./app/assets/builds/rails_admin.css --no-source-map --load-path=node_modules
|
117
|
+
if package[name] && (package[name].keys & entries.keys).any?
|
118
|
+
say <<~MESSAGE, :red
|
119
|
+
You need to merge "#{name}": #{JSON.pretty_generate(entries)} into the existing #{name} in your package.json.#{instruction && "\n#{instruction}"}
|
117
120
|
MESSAGE
|
118
121
|
else
|
119
|
-
package[
|
120
|
-
entries.each do |entry,
|
121
|
-
package[
|
122
|
+
package[name] ||= {}
|
123
|
+
entries.each do |entry, value|
|
124
|
+
package[name][entry] = value
|
122
125
|
end
|
123
|
-
add_file 'package.json', JSON.pretty_generate(package)
|
126
|
+
add_file 'package.json', "#{JSON.pretty_generate(package)}\n"
|
124
127
|
end
|
125
128
|
end
|
126
129
|
end
|
@@ -1 +1 @@
|
|
1
|
-
<%=
|
1
|
+
<%= @fa_font_path ? %{$fa-font-path: "#{@fa_font_path}";\n} : '' %>@import "rails_admin/src/rails_admin/styles/base";
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import "rails_admin/src/rails_admin/base";
|
2
|
-
import "../stylesheets/rails_admin.scss";
|
2
|
+
import "../stylesheets/rails_admin.scss";
|
@@ -48,7 +48,7 @@ module RailsAdmin
|
|
48
48
|
# :
|
49
49
|
# end
|
50
50
|
#
|
51
|
-
# Thus, sort all blocks to
|
51
|
+
# Thus, sort all blocks to execute for a resource by Proc.source_path,
|
52
52
|
# to guarantee that blocks from 'config/initializers' evaluate before
|
53
53
|
# blocks defined within a model class.
|
54
54
|
unless @deferred_blocks.empty?
|
@@ -48,9 +48,7 @@ module RailsAdmin
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def excluded?
|
51
|
-
|
52
|
-
|
53
|
-
@excluded = !RailsAdmin::AbstractModel.all.collect(&:model_name).include?(abstract_model.try(:model_name))
|
51
|
+
@excluded ||= !RailsAdmin::AbstractModel.all.collect(&:model_name).include?(abstract_model.try(:model_name))
|
54
52
|
end
|
55
53
|
|
56
54
|
def object_label
|
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.1.
|
3
|
+
"version": "3.1.1",
|
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",
|
@@ -15,7 +15,7 @@
|
|
15
15
|
},
|
16
16
|
"dependencies": {
|
17
17
|
"@babel/runtime": "^7.16.7",
|
18
|
-
"@fortawesome/fontawesome-free": "
|
18
|
+
"@fortawesome/fontawesome-free": ">=5.15.0 <7.0.0",
|
19
19
|
"@hotwired/turbo-rails": "^7.1.0",
|
20
20
|
"@popperjs/core": "^2.11.0",
|
21
21
|
"@rails/ujs": "^6.1.4-1",
|
data/src/rails_admin/base.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import Rails from "@rails/ujs";
|
2
2
|
import "@hotwired/turbo-rails";
|
3
|
-
import
|
3
|
+
import "./jquery";
|
4
4
|
import "./vendor/jquery_nested_form";
|
5
5
|
import "bootstrap";
|
6
6
|
|
@@ -27,4 +27,3 @@ import "./ui";
|
|
27
27
|
import "./widgets";
|
28
28
|
|
29
29
|
Rails.start();
|
30
|
-
window.$ = window.jQuery = jQuery;
|
@@ -172,7 +172,7 @@ import flatpickr from "flatpickr";
|
|
172
172
|
}
|
173
173
|
|
174
174
|
var filterContainerId = field_name + "-" + index + "-filter-container";
|
175
|
-
$("
|
175
|
+
$("#" + filterContainerId).remove();
|
176
176
|
|
177
177
|
var $content = $("<div>")
|
178
178
|
.attr("id", filterContainerId)
|
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.1.
|
4
|
+
version: 3.1.1
|
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-
|
15
|
+
date: 2022-12-18 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activemodel-serializers-xml
|
@@ -323,6 +323,7 @@ files:
|
|
323
323
|
- src/rails_admin/filtering-multiselect.js
|
324
324
|
- src/rails_admin/filtering-select.js
|
325
325
|
- src/rails_admin/i18n.js
|
326
|
+
- src/rails_admin/jquery.js
|
326
327
|
- src/rails_admin/nested-form-hooks.js
|
327
328
|
- src/rails_admin/remote-form.js
|
328
329
|
- src/rails_admin/sidescroll.js
|
@@ -339,8 +340,6 @@ files:
|
|
339
340
|
- src/rails_admin/widgets.js
|
340
341
|
- vendor/assets/fonts/rails_admin/fa-solid-900.ttf
|
341
342
|
- vendor/assets/fonts/rails_admin/fa-solid-900.woff2
|
342
|
-
- vendor/assets/images/rails_admin/bootstrap/glyphicons-halflings-white.png
|
343
|
-
- vendor/assets/images/rails_admin/bootstrap/glyphicons-halflings.png
|
344
343
|
- vendor/assets/javascripts/rails_admin/bootstrap.js
|
345
344
|
- vendor/assets/javascripts/rails_admin/flatpickr-with-locales.js
|
346
345
|
- vendor/assets/javascripts/rails_admin/jquery-ui/data.js
|
Binary file
|
Binary file
|