rails_admin 3.1.0 → 3.1.1

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.

Potentially problematic release.


This version of rails_admin might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4703829ff74c1be721a1622986bfe87c98c07e908991e997c903070c12216255
4
- data.tar.gz: 3eddba360a94a4bd0a3d3e0c1eb62af9752b90e4637082b3ce6e3d576274c7b8
3
+ metadata.gz: 32f625ca21a5c94c2fc91766ae74ef690a92ff7f882068b70d617ad7b1e1ff3a
4
+ data.tar.gz: ed3af9f17b3277f11a4b17db9beffe03d80294b453bb086d7aa819c46ce9cc1d
5
5
  SHA512:
6
- metadata.gz: b13e1468096711b8dfc4217563f26524512e2e219cdf69bf56aece88400bce7a3b2ec958fc1676f1fd253745c86ca1739f35f0e199983e0597fce986cda41484
7
- data.tar.gz: bdb5a417cd53c3e301358ce96452b3d96acc73ccdd752a81187429aaabaa969c7c77fa02ee72be201c8303e61a3f6ffc3f07aea77ac1fb3a8d70da717c117647
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 defined?(@action) && current_action?(@action, model_param)
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
@@ -1,4 +1,4 @@
1
- <ul class="sidebar col-sm-3 col-md-2 nav btn-toggle-nav flex-column bg-light">
1
+ <ul class="sidebar col-sm-3 col-md-2 nav btn-toggle-nav flex-column flex-nowrap bg-light">
2
2
  <%= main_navigation %>
3
3
  <%= root_navigation %>
4
4
  <%= static_navigation %>
@@ -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
- add_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'}))
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 add_scripts(entries)
106
- display 'Add scripts to package.json'
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['scripts'] && (package['scripts'].keys & entries.keys).any?
113
- say <<-MESSAGE.gsub(/^ {10}/, ''), :red
114
- You need to merge "scripts": #{JSON.pretty_generate(entries)} into the existing scripts in your package.json .
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['scripts'] ||= {}
120
- entries.each do |entry, build_script|
121
- package['scripts'][entry] = build_script
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
- <%= instance_variable_defined?(:@fa_font_path) ? %{$fa-font-path: "#{@fa_font_path}";\n} : '' %>@import "rails_admin/src/rails_admin/styles/base";
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 excute for a resource by Proc.source_path,
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
- return @excluded if defined?(@excluded)
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
@@ -4,7 +4,7 @@ module RailsAdmin
4
4
  class Version
5
5
  MAJOR = 3
6
6
  MINOR = 1
7
- PATCH = 0
7
+ PATCH = 1
8
8
  PRE = nil
9
9
 
10
10
  class << self
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rails_admin",
3
- "version": "3.1.0",
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": "^6.1.1",
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",
@@ -1,6 +1,6 @@
1
1
  import Rails from "@rails/ujs";
2
2
  import "@hotwired/turbo-rails";
3
- import jQuery from "jquery";
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
- $("p#" + filterContainerId).remove();
175
+ $("#" + filterContainerId).remove();
176
176
 
177
177
  var $content = $("<div>")
178
178
  .attr("id", filterContainerId)
@@ -0,0 +1,3 @@
1
+ import jQuery from "jquery";
2
+
3
+ window.$ = window.jQuery = jQuery;
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.0
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-11-06 00:00:00.000000000 Z
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