avo 3.19.1 → 3.19.2
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 +4 -4
- data/Gemfile.lock +13 -13
- data/app/avo/base_resource.rb +2 -0
- data/lib/avo/concerns/abstract_resource.rb +13 -0
- data/lib/avo/resources/array_resource.rb +2 -0
- data/lib/avo/resources/base.rb +5 -0
- data/lib/avo/resources/resource_manager.rb +2 -5
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/concerns/parent_controller.rb +1 -0
- data/lib/generators/avo/resource_generator.rb +7 -0
- data/lib/generators/avo/templates/resource/resource.tt +24 -0
- data/public/avo-assets/avo.base.js +103 -103
- data/public/avo-assets/avo.base.js.map +3 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9c26ac44eca3a86bccd3eeb9c147102bbd0eee8c37450e12ea5d3f154c798f9
|
4
|
+
data.tar.gz: 1309cfdc3b9d1753084862a4d690491d3da65c27d5d578cc649fe3f038315d38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d53e5a7a7a8841c13ce1991d8e4a5f7d291c37a53745d09f38f32b7dde5a336e482a0f04559089b65f52ee96a9940c0c0fc8c06a1b0065b71cdf1cb4b2046ce5
|
7
|
+
data.tar.gz: c76572642d357dab41b4db733c0f5c87ccee9c1573366d88846c1c82e1d6f3559f78dd2820a9c471fc7ac591e7dec806ab99c516e17a1ed41385c138edef43be
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (3.19.
|
4
|
+
avo (3.19.2)
|
5
5
|
actionview (>= 6.1)
|
6
6
|
active_link_to
|
7
7
|
activerecord (>= 6.1)
|
@@ -131,8 +131,8 @@ GEM
|
|
131
131
|
money-rails (~> 1.12)
|
132
132
|
avo-record_link_field (0.0.2)
|
133
133
|
aws-eventstream (1.3.2)
|
134
|
-
aws-partitions (1.
|
135
|
-
aws-sdk-core (3.
|
134
|
+
aws-partitions (1.1080.0)
|
135
|
+
aws-sdk-core (3.222.1)
|
136
136
|
aws-eventstream (~> 1, >= 1.3.0)
|
137
137
|
aws-partitions (~> 1, >= 1.992.0)
|
138
138
|
aws-sigv4 (~> 1.9)
|
@@ -142,7 +142,7 @@ GEM
|
|
142
142
|
aws-sdk-kms (1.99.0)
|
143
143
|
aws-sdk-core (~> 3, >= 3.216.0)
|
144
144
|
aws-sigv4 (~> 1.5)
|
145
|
-
aws-sdk-s3 (1.
|
145
|
+
aws-sdk-s3 (1.183.0)
|
146
146
|
aws-sdk-core (~> 3, >= 3.216.0)
|
147
147
|
aws-sdk-kms (~> 1)
|
148
148
|
aws-sigv4 (~> 1.5)
|
@@ -426,18 +426,18 @@ GEM
|
|
426
426
|
net-smtp (0.5.1)
|
427
427
|
net-protocol
|
428
428
|
nio4r (2.7.4)
|
429
|
-
nokogiri (1.18.
|
429
|
+
nokogiri (1.18.7-aarch64-linux-gnu)
|
430
430
|
racc (~> 1.4)
|
431
|
-
nokogiri (1.18.
|
431
|
+
nokogiri (1.18.7-arm64-darwin)
|
432
432
|
racc (~> 1.4)
|
433
|
-
nokogiri (1.18.
|
433
|
+
nokogiri (1.18.7-x86_64-linux-gnu)
|
434
434
|
racc (~> 1.4)
|
435
435
|
observer (0.1.2)
|
436
436
|
orm_adapter (0.5.0)
|
437
437
|
ostruct (0.6.1)
|
438
438
|
pagy (9.3.4)
|
439
439
|
parallel (1.26.3)
|
440
|
-
parser (3.3.7.
|
440
|
+
parser (3.3.7.4)
|
441
441
|
ast (~> 2.4.1)
|
442
442
|
racc
|
443
443
|
path_expander (1.1.3)
|
@@ -512,9 +512,9 @@ GEM
|
|
512
512
|
rb-fsevent (0.11.2)
|
513
513
|
rb-inotify (0.11.1)
|
514
514
|
ffi (~> 1.0)
|
515
|
-
rbs (3.9.
|
515
|
+
rbs (3.9.2)
|
516
516
|
logger
|
517
|
-
rdoc (6.13.
|
517
|
+
rdoc (6.13.1)
|
518
518
|
psych (>= 4.0.0)
|
519
519
|
redis (5.4.0)
|
520
520
|
redis-client (>= 0.22.0)
|
@@ -566,7 +566,7 @@ GEM
|
|
566
566
|
rubocop-ast (>= 1.38.0, < 2.0)
|
567
567
|
ruby-progressbar (~> 1.7)
|
568
568
|
unicode-display_width (>= 2.4.0, < 4.0)
|
569
|
-
rubocop-ast (1.
|
569
|
+
rubocop-ast (1.44.0)
|
570
570
|
parser (>= 3.3.7.2)
|
571
571
|
prism (~> 1.4)
|
572
572
|
rubocop-performance (1.24.0)
|
@@ -575,7 +575,7 @@ GEM
|
|
575
575
|
rubocop-ast (>= 1.38.0, < 2.0)
|
576
576
|
rubocop-shopify (2.16.0)
|
577
577
|
rubocop (~> 1.62)
|
578
|
-
ruby-openai (8.
|
578
|
+
ruby-openai (8.1.0)
|
579
579
|
event_stream_parser (>= 0.3.0, < 2.0.0)
|
580
580
|
faraday (>= 1)
|
581
581
|
faraday-multipart (>= 1)
|
@@ -612,7 +612,7 @@ GEM
|
|
612
612
|
simplecov-lcov (0.8.0)
|
613
613
|
simplecov_json_formatter (0.1.4)
|
614
614
|
smart_properties (1.17.0)
|
615
|
-
solargraph (0.53.
|
615
|
+
solargraph (0.53.4)
|
616
616
|
backport (~> 1.2)
|
617
617
|
benchmark
|
618
618
|
bundler (~> 2.0)
|
data/app/avo/base_resource.rb
CHANGED
data/lib/avo/resources/base.rb
CHANGED
@@ -19,6 +19,9 @@ module Avo
|
|
19
19
|
include Avo::Concerns::HasDiscreetInformation
|
20
20
|
include Avo::Concerns::RowControlsConfiguration
|
21
21
|
include Avo::Concerns::SafeCall
|
22
|
+
include Avo::Concerns::AbstractResource
|
23
|
+
|
24
|
+
abstract_resource!
|
22
25
|
|
23
26
|
# Avo::Current methods
|
24
27
|
delegate :context, to: Avo::Current
|
@@ -84,6 +87,8 @@ module Avo
|
|
84
87
|
class_attribute :default_sort_direction, default: :desc
|
85
88
|
class_attribute :external_link, default: nil
|
86
89
|
|
90
|
+
class_attribute :abstract, default: false
|
91
|
+
|
87
92
|
# EXTRACT:
|
88
93
|
class_attribute :ordering
|
89
94
|
|
@@ -40,12 +40,9 @@ module Avo
|
|
40
40
|
load_resources_namespace
|
41
41
|
end
|
42
42
|
|
43
|
-
# All descendants from Avo::Resources::Base except the internal ones
|
44
|
-
Base.descendants - internal_resources
|
45
|
-
end
|
43
|
+
# All descendants from Avo::Resources::Base except the internal abstract ones
|
46
44
|
|
47
|
-
|
48
|
-
[Avo::BaseResource, Avo::Resources::ArrayResource]
|
45
|
+
Base.descendants.reject { _1.is_abstract? }
|
49
46
|
end
|
50
47
|
|
51
48
|
def load_resources_namespace
|
data/lib/avo/version.rb
CHANGED
@@ -22,6 +22,11 @@ module Generators
|
|
22
22
|
type: :boolean,
|
23
23
|
default: false
|
24
24
|
|
25
|
+
class_option "http",
|
26
|
+
desc: "Indicates if the resource should be HTTP.",
|
27
|
+
type: :boolean,
|
28
|
+
default: false
|
29
|
+
|
25
30
|
def create
|
26
31
|
return if override_controller?
|
27
32
|
|
@@ -33,6 +38,8 @@ module Generators
|
|
33
38
|
def parent_resource
|
34
39
|
if options["array"]
|
35
40
|
"Avo::Resources::ArrayResource"
|
41
|
+
elsif options["http"]
|
42
|
+
"Avo::Core::Resources::Http"
|
36
43
|
else
|
37
44
|
"Avo::BaseResource"
|
38
45
|
end
|
@@ -11,6 +11,26 @@ class Avo::Resources::<%= resource_class %> < <%= parent_resource %><% if option
|
|
11
11
|
}
|
12
12
|
]
|
13
13
|
end
|
14
|
+
<% elsif options["http"] %>
|
15
|
+
# self.endpoint = "https://api.openalex.org/"
|
16
|
+
# self.endpoint_key = "authors"
|
17
|
+
# self.parse_collection = -> {
|
18
|
+
# raise Avo::HttpError.new response["message"] if response["error"].present?
|
19
|
+
#
|
20
|
+
# response["results"]
|
21
|
+
# }
|
22
|
+
# self.parse_record = -> { response }
|
23
|
+
# self.parse_count = -> { response["meta"]["count"] }
|
24
|
+
|
25
|
+
## This is required only when the ID includes characters (e.g., ".") that could be improperly routed.
|
26
|
+
# self.find_record_method = -> { query.find Base64.decode64(id) }
|
27
|
+
## Encodes the ID for use in URL helpers. The `model_class_eval` block is executed when the model is defined in memory,
|
28
|
+
## allowing us to override `to_param` and obfuscate the raw ID via Base64 encoding.
|
29
|
+
# self.model_class_eval = -> {
|
30
|
+
# define_method :to_param do
|
31
|
+
# Base64.encode64(id)
|
32
|
+
# end
|
33
|
+
# }
|
14
34
|
<% else %>
|
15
35
|
# self.includes = []
|
16
36
|
# self.attachments = []<%= model_class_from_args %>
|
@@ -21,6 +41,10 @@ class Avo::Resources::<%= resource_class %> < <%= parent_resource %><% if option
|
|
21
41
|
def fields
|
22
42
|
field :id, as: :id
|
23
43
|
field :title
|
44
|
+
end<% elsif options["http"] %>
|
45
|
+
def fields
|
46
|
+
field :id, as: :id
|
47
|
+
# field :display_name
|
24
48
|
end<% else %>
|
25
49
|
def fields
|
26
50
|
field :id, as: :id<%= generate_fields %>
|