avo 2.12.0 → 2.12.1.pre.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb6907b0e852005ad23b73029892ac673ef73f955afe6b317d61c0c9303d3ef3
4
- data.tar.gz: 980fbca1412954ea0e5d1f75ae12e653cd10bfb58307a2fec1a8eafc08c51852
3
+ metadata.gz: c32b3f69d566186e0bd65d5189642e9929bfa7e0ea1cf8c146bfabff1658955a
4
+ data.tar.gz: 1fe470c1af50110165a1ad3b06c28a42153931a9100d8d6f0e0e850427214a6c
5
5
  SHA512:
6
- metadata.gz: c43462a617f2bb6131b899665687ab371823a2c983338f32d095e0b33dfd543a4e3488e94b03f8e6dec1b7ed6162c0fa86d1cbacfde7b1cf07ef6ed5120192e6
7
- data.tar.gz: e06be5c7fd0c244f683d4bf9960892dac729dc155bbc90f0903758ba3beca5a0394feea932db9c8d67c3ef2836fcf03a1e0056efcb90f8fded28998969cb6e56
6
+ metadata.gz: aa99c1aeb3fe23c10d7422dbb651b5b67148e344ddf5c79a992cd67c6b2421611139231d6502d1046234f9fa89050444cdb8bcbc582ee167115d1b5aa7f41600
7
+ data.tar.gz: 5fbeb32c8061326a8c09a0926cb6531f3fb0f5716138a60db2f7e723beeca4dae78d666f1952c66f24434dece2b0abaade6621b0b151b3edcc364f7e53b106c8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.12.0)
4
+ avo (2.12.1.pre.1)
5
5
  active_link_to
6
6
  addressable
7
7
  breadcrumbs_on_rails
@@ -136,7 +136,7 @@ GEM
136
136
  rack-test (>= 0.6.3)
137
137
  regexp_parser (>= 1.5, < 3.0)
138
138
  xpath (~> 3.2)
139
- chartkick (4.2.0)
139
+ chartkick (4.2.1)
140
140
  childprocess (4.1.0)
141
141
  concurrent-ruby (1.1.10)
142
142
  countries (4.2.1)
@@ -252,6 +252,8 @@ GEM
252
252
  nokogiri (1.13.7)
253
253
  mini_portile2 (~> 2.8.0)
254
254
  racc (~> 1.4)
255
+ nokogiri (1.13.7-x86_64-linux)
256
+ racc (~> 1.4)
255
257
  orm_adapter (0.5.0)
256
258
  pagy (5.10.1)
257
259
  activesupport
@@ -17,19 +17,19 @@ module Avo
17
17
  def field(name, **args, &block)
18
18
  ensure_items_holder_initialized
19
19
 
20
- self.items_holder.field name, **args, &block
20
+ items_holder.field name, **args, &block
21
21
  end
22
22
 
23
23
  def panel(name = nil, **args, &block)
24
24
  ensure_items_holder_initialized
25
25
 
26
- self.items_holder.panel name, **args, &block
26
+ items_holder.panel name, **args, &block
27
27
  end
28
28
 
29
29
  def tabs(&block)
30
30
  ensure_items_holder_initialized
31
31
 
32
- self.items_holder.tabs Avo::TabGroupBuilder.parse_block(&block)
32
+ items_holder.tabs Avo::TabGroupBuilder.parse_block(&block)
33
33
  end
34
34
 
35
35
  def tool(klass, **args)
@@ -39,27 +39,29 @@ module Avo
39
39
  end
40
40
 
41
41
  def heading(body, **args)
42
- self.items_holder.heading body, **args
42
+ ensure_items_holder_initialized
43
+
44
+ items_holder.heading body, **args
43
45
  end
44
46
  # END DSL methods
45
47
 
46
48
  def items
47
- if self.items_holder.present?
48
- self.items_holder.items
49
+ if items_holder.present?
50
+ items_holder.items
49
51
  else
50
52
  []
51
53
  end
52
54
  end
53
55
 
54
56
  def tools
55
- self.tools_holder
57
+ tools_holder
56
58
  end
57
59
 
58
60
  # Dives deep into panels and tabs to fetch all the fields for a resource.
59
61
  def fields(only_root: false)
60
62
  fields = []
61
63
 
62
- self.items.each do |item|
64
+ items.each do |item|
63
65
  next if item.nil?
64
66
 
65
67
  unless only_root
@@ -76,7 +78,6 @@ module Avo
76
78
  end
77
79
  end
78
80
 
79
-
80
81
  if item.is_field?
81
82
  fields << item
82
83
  end
@@ -86,7 +87,7 @@ module Avo
86
87
  end
87
88
 
88
89
  def tab_groups
89
- self.items.select do |item|
90
+ items.select do |item|
90
91
  item.instance_of? Avo::TabGroup
91
92
  end
92
93
  end
@@ -1,6 +1,6 @@
1
1
  require "dry-initializer"
2
2
 
3
- # This object holds some data tha is usually needed to compute blocks around the app.
3
+ # This object holds some data that is usually needed to compute blocks around the app.
4
4
  module Avo
5
5
  module Hosts
6
6
  class BaseHost
@@ -10,6 +10,7 @@ module Avo
10
10
  option :params, default: proc { Avo::App.params }
11
11
  option :view_context, default: proc { Avo::App.view_context }
12
12
  option :current_user, default: proc { Avo::App.current_user }
13
+ # This is optional because we might instantiate the `Host` first and later hydrate it with a block.
13
14
  option :block, optional: true
14
15
 
15
16
  delegate :authorize, to: Avo::Services::AuthorizationService
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.12.0" unless const_defined?(:VERSION)
2
+ VERSION = "2.12.1.pre.1" unless const_defined?(:VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.12.1.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-08-02 00:00:00.000000000 Z
12
+ date: 2022-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -1375,9 +1375,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1375
1375
  version: 2.4.0
1376
1376
  required_rubygems_version: !ruby/object:Gem::Requirement
1377
1377
  requirements:
1378
- - - ">="
1378
+ - - ">"
1379
1379
  - !ruby/object:Gem::Version
1380
- version: '0'
1380
+ version: 1.3.1
1381
1381
  requirements: []
1382
1382
  rubygems_version: 3.3.3
1383
1383
  signing_key: