active_admin-sortable_tree 2.0.0 → 2.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0e22264b733cb656adcdd397fe186a6e4de1fbfe06e55d7e45f361f66022cf3
4
- data.tar.gz: f83027613f9891cbabe4e9ba39e52380811f753a51b0f787750a36459d82b386
3
+ metadata.gz: 6347bcf5f4c693e94967a6967a0d470a90416d266553451530ea2957a6269e12
4
+ data.tar.gz: 6b41d0490c2a9dfff755b1e2a7713a7e4b7b5ca846e92aa45dd890fd5f172b85
5
5
  SHA512:
6
- metadata.gz: e8d5e6495c061de3bbde7dccc1252bb6df52d7a2179f24b26dfd7383f150d04b64dec6b8effe4b74fb546986566c33bb80d1903f1eb1925354f3a923e0819d2e
7
- data.tar.gz: f0057f2bbbc9e978c043f4ee815f1b8de90006d0d8f29b9ee5789168ab282f32b7fa08c1c99e244df7082861c3895145698b0a3d55cb8184ffc0bbef084988c5
6
+ metadata.gz: 0f7a1956d45b3e8ef9ff1a00aad02be83d925992adabc79a84fca245ff6fda881b3120dafa4697baf07cb1c41b03e48e222cbd0a56fa898ccb488e2d01af1b44
7
+ data.tar.gz: ab37314d2cabc08afabc745edbb4a2fca4b7d3ed349d31e01a79d96164d759adf82aa49da1902ac94dc938a37ecdbeaa529a9d307a0ddd00d2035a8023afc8f7
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.1.0] - 2020-03-11
6
+
7
+ ### Added
8
+
9
+ - A config to opt out of registering assets (see #81)
10
+ - Support for UUID primary keys (see #85)
11
+
5
12
  ## [2.0.0] - 2018-01-22
6
13
 
7
14
  ### Changed
@@ -73,3 +80,5 @@ Installation section of the [README.md](README.md#installation) for instructions
73
80
  [0.3.0]: https://github.com/zorab47/active_admin-sortable_tree/compare/v0.2.1...v0.3.0
74
81
  [1.0.0]: https://github.com/zorab47/active_admin-sortable_tree/compare/v0.3.0...v1.0.0
75
82
  [1.1.0]: https://github.com/zorab47/active_admin-sortable_tree/compare/v1.0.0...v1.1.0
83
+ [2.0.0]: https://github.com/zorab47/active_admin-sortable_tree/compare/v1.1.0...v2.0.0
84
+ [2.1.0]: https://github.com/zorab47/active_admin-sortable_tree/compare/v2.0.0...v2.1.0
data/README.md CHANGED
@@ -21,9 +21,9 @@ sortable via drag'n'drop.
21
21
  //= require active_admin/sortable
22
22
  ```
23
23
 
24
- 3. Add an import in your stylesheet manifest `app/assets/javascripts/active_admin.js`
24
+ 3. Add an import in your stylesheet manifest `app/assets/stylesheets/active_admin.scss`
25
25
 
26
- ```sass
26
+ ```scss
27
27
  @import "active_admin/sortable";
28
28
  ```
29
29
 
@@ -38,7 +38,7 @@ ActiveAdmin.register Page do
38
38
 
39
39
  index :as => :sortable do
40
40
  label :title # item content
41
- actions
41
+ actions
42
42
  end
43
43
  end
44
44
  ```
@@ -198,6 +198,23 @@ or later.
198
198
  gem 'activeadmin', github: 'activeadmin', ref: 'b3a9f4b'
199
199
  ```
200
200
 
201
+ ### Suppressing warnings from Active Admin
202
+
203
+ As of Active Admin 1.1.0, `config.register_stylesheet` and `config.register_javascript` have been deprecated. `ActiveAdmin::SortableTree` uses these interfaces to register required assets automatically. Because of this, you may see a deprecation warning:
204
+
205
+ ```
206
+ DEPRECATION WARNING: Active Admin: The `register_javascript` config is deprecated and will be removed
207
+ in v2. Import your "active_admin/sortable.js" javascript in the active_admin.js.
208
+ (called from <main> at config/environment.rb:5)
209
+ ```
210
+
211
+ You could opt out of it by setting `config.aa_sortable_tree.register_assets` to `false`:
212
+
213
+ ```ruby
214
+ # config/application.rb
215
+ config.aa_sortable_tree.register_assets = false
216
+ ```
217
+
201
218
  ## Semantic Versioning
202
219
 
203
220
  ActiveAdmin::SortableTree follows [semantic versioning](http://semver.org).
@@ -5,6 +5,9 @@ module ActiveAdmin
5
5
  class Engine < ::Rails::Engine
6
6
  engine_name "active_admin-sortable_tree"
7
7
 
8
+ config.aa_sortable_tree = ActiveSupport::OrderedOptions.new
9
+ config.aa_sortable_tree.register_assets = true
10
+
8
11
  initializer "active_admin-sortable_tree.precompile", group: :all do |app|
9
12
  app.config.assets.precompile += [
10
13
  "active_admin/sortable.css",
@@ -13,8 +16,10 @@ module ActiveAdmin
13
16
  end
14
17
 
15
18
  initializer "active_admin-sortable_tree.register_assets" do
16
- ActiveAdmin.application.register_stylesheet "active_admin/sortable.css"
17
- ActiveAdmin.application.register_javascript "active_admin/sortable.js"
19
+ if config.aa_sortable_tree.register_assets
20
+ ActiveAdmin.application.register_stylesheet "active_admin/sortable.css"
21
+ ActiveAdmin.application.register_javascript "active_admin/sortable.js"
22
+ end
18
23
  end
19
24
  end
20
25
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveAdmin
2
2
  module SortableTree
3
- VERSION = "2.0.0"
3
+ VERSION = "2.1.0"
4
4
  end
5
5
  end
@@ -426,11 +426,11 @@
426
426
 
427
427
  $(items).each(function() {
428
428
  var res = ($(o.item || this).attr(o.attribute || 'id') || '')
429
- .match(o.expression || (/(.+)[-=_](.+)/)),
429
+ .match(o.expression || (/(.+)[=_](.+)/)),
430
430
  pid = ($(o.item || this).parent(o.listType)
431
431
  .parent(o.items)
432
432
  .attr(o.attribute || 'id') || '')
433
- .match(o.expression || (/(.+)[-=_](.+)/));
433
+ .match(o.expression || (/(.+)[=_](.+)/));
434
434
 
435
435
  if (res) {
436
436
  str.push(((o.key || res[1]) + '[' + (o.key && o.expression ? res[1] : res[2]) + ']')
@@ -610,4 +610,4 @@
610
610
  }));
611
611
 
612
612
  $.mjs.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.nestedSortable.prototype.options);
613
- })(jQuery);
613
+ })(jQuery);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin-sortable_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Disperati
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-01-23 00:00:00.000000000 Z
12
+ date: 2020-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activeadmin