avo 3.13.0 → 3.13.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 +2 -2
- data/app/components/avo/index/resource_table_component.rb +1 -1
- data/app/components/avo/index/table_row_component.rb +1 -1
- data/app/components/avo/modal_component.rb +1 -1
- data/app/components/avo/views/resource_index_component.rb +1 -1
- data/app/controllers/avo/application_controller.rb +8 -0
- data/app/controllers/avo/debug_controller.rb +6 -0
- data/app/controllers/avo/private_controller.rb +2 -0
- data/app/views/avo/debug/status.html.erb +1 -1
- data/app/views/avo/debug/status.text.erb +6 -0
- data/app/views/layouts/avo/application.html.erb +0 -6
- data/lib/avo/plugin.rb +6 -0
- data/lib/avo/plugin_manager.rb +2 -14
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/templates/initializer/avo.tt +1 -1
- 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: 661b7efdb938f2b72205c0fd4d62dcfaaf778af38c3ffe15e7a13b070d11db88
|
4
|
+
data.tar.gz: 0ce3b4ff38787188323dcde5a287daa8780637a21c99ab66c9bfe6509258d3d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45fcf56fea15a88f5bf24a7e973ee570c6dd26f43d233467611ae504d6c40f436bfe0e94839e342203942e1e185144cbebe7e7ec45810233b3c2f2b809a3ef7b
|
7
|
+
data.tar.gz: 8d16dee5688f0853a3b46f451413ed47ecaded7efb047678393f390177c9989cb3d7ca73b9c01e8bee998b3b44e4eb60c056cea03e8282a36d5b1d5a8182295b
|
data/Gemfile.lock
CHANGED
@@ -107,7 +107,7 @@ GIT
|
|
107
107
|
PATH
|
108
108
|
remote: .
|
109
109
|
specs:
|
110
|
-
avo (3.13.
|
110
|
+
avo (3.13.2)
|
111
111
|
actionview (>= 6.1)
|
112
112
|
active_link_to
|
113
113
|
activerecord (>= 6.1)
|
@@ -642,7 +642,7 @@ GEM
|
|
642
642
|
unicode-display_width (2.6.0)
|
643
643
|
uri (0.13.1)
|
644
644
|
useragent (0.16.10)
|
645
|
-
view_component (3.
|
645
|
+
view_component (3.15.1)
|
646
646
|
activesupport (>= 5.2.0, < 8.0)
|
647
647
|
concurrent-ruby (~> 1.0)
|
648
648
|
method_source (~> 1.0)
|
@@ -14,7 +14,7 @@ class Avo::Index::ResourceTableComponent < Avo::BaseComponent
|
|
14
14
|
prop :parent_record, _Nilable(_Any)
|
15
15
|
prop :parent_resource, _Nilable(Avo::BaseResource)
|
16
16
|
prop :pagy, _Nilable(Pagy)
|
17
|
-
prop :query, _Nilable(
|
17
|
+
prop :query, _Nilable(_Any)
|
18
18
|
prop :actions, _Nilable(_Array(Avo::BaseAction))
|
19
19
|
|
20
20
|
def encrypted_query
|
@@ -6,7 +6,7 @@ class Avo::Index::TableRowComponent < Avo::BaseComponent
|
|
6
6
|
|
7
7
|
attr_writer :header_fields
|
8
8
|
|
9
|
-
prop :resource, _Nilable(Avo::BaseResource)
|
9
|
+
prop :resource, _Nilable(Avo::BaseResource), reader: :public
|
10
10
|
prop :reflection, _Nilable(ActiveRecord::Reflection::AbstractReflection)
|
11
11
|
prop :parent_record, _Nilable(_Any)
|
12
12
|
prop :parent_resource, _Nilable(Avo::BaseResource)
|
@@ -17,7 +17,7 @@ class Avo::Views::ResourceIndexComponent < Avo::ResourceComponent
|
|
17
17
|
prop :parent_record, _Nilable(_Any)
|
18
18
|
prop :parent_resource, _Nilable(Avo::BaseResource)
|
19
19
|
prop :applied_filters, Hash, default: {}.freeze
|
20
|
-
prop :query, _Nilable(
|
20
|
+
prop :query, _Nilable(_Any), reader: :public
|
21
21
|
# This should be
|
22
22
|
# prop :scopes, _Nilable(_Array(Avo::Advanced::Scopes::BaseScope)), reader: :public
|
23
23
|
# However, Avo::Advanced::Scopes::BaseScope raises an error because
|
@@ -328,5 +328,13 @@ module Avo
|
|
328
328
|
"avo/application"
|
329
329
|
end
|
330
330
|
end
|
331
|
+
|
332
|
+
def authenticate_developer_or_admin!
|
333
|
+
raise_404 unless Avo::Current.user_is_developer? || Avo::Current.user_is_admin?
|
334
|
+
end
|
335
|
+
|
336
|
+
def raise_404
|
337
|
+
raise ActionController::RoutingError.new "No route matches"
|
338
|
+
end
|
331
339
|
end
|
332
340
|
end
|
@@ -2,7 +2,13 @@ require_dependency "avo/application_controller"
|
|
2
2
|
|
3
3
|
module Avo
|
4
4
|
class DebugController < ApplicationController
|
5
|
+
before_action :authenticate_developer_or_admin!
|
6
|
+
|
5
7
|
def status
|
8
|
+
respond_to do |format|
|
9
|
+
format.html { render :status }
|
10
|
+
format.text { render :status }
|
11
|
+
end
|
6
12
|
end
|
7
13
|
|
8
14
|
def send_to_hq
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<!-- Avo version: <%= Avo::VERSION %> -->
|
2
|
+
<!-- Rails version: <%= Rails::VERSION::STRING %> -->
|
3
|
+
<!-- Environment: <%= Rails.env %> -->
|
4
|
+
<!-- License ID: <%= Avo.license.id %> -->
|
5
|
+
<!-- License valid?: <%= Avo.license.valid ? "valid" : "invalid" %> -->
|
6
|
+
<!-- Plugins: <%= Avo.plugin_manager.to_s %> -->
|
@@ -53,12 +53,6 @@
|
|
53
53
|
<%= render partial: "avo/partials/alerts" %>
|
54
54
|
<%= render partial: "avo/partials/scripts" %>
|
55
55
|
<%= render partial: "avo/partials/confirm_dialog" %>
|
56
|
-
<!-- Avo version: <%= Avo::VERSION %> -->
|
57
|
-
<!-- Rails version: <%= Rails::VERSION::STRING %> -->
|
58
|
-
<!-- Environment: <%= Rails.env %> -->
|
59
|
-
<!-- License ID: <%= Avo.license.id %> -->
|
60
|
-
<!-- License valid?: <%= Avo.license.valid ? "valid" : "invalid" %> -->
|
61
|
-
<!-- Plugins: <%= Avo.plugin_manager.to_s %> -->
|
62
56
|
</body>
|
63
57
|
</html>
|
64
58
|
<!-- ✨ Built with Avo • https://www.avohq.io/ -->
|
data/lib/avo/plugin.rb
CHANGED
@@ -3,11 +3,17 @@ module Avo
|
|
3
3
|
attr_reader :name
|
4
4
|
attr_reader :priority
|
5
5
|
|
6
|
+
delegate :version, :namespace, :engine, to: :class
|
7
|
+
|
6
8
|
def initialize(*, name:, priority:, **, &block)
|
7
9
|
@name = name
|
8
10
|
@priority = priority
|
9
11
|
end
|
10
12
|
|
13
|
+
def to_s
|
14
|
+
"#{name}-#{version}"
|
15
|
+
end
|
16
|
+
|
11
17
|
class << self
|
12
18
|
def name
|
13
19
|
return gemspec.name if gemspec.present?
|
data/lib/avo/plugin_manager.rb
CHANGED
@@ -12,18 +12,6 @@ module Avo
|
|
12
12
|
@plugins << Plugin.new(name:, priority: priority)
|
13
13
|
end
|
14
14
|
|
15
|
-
def boot_plugins
|
16
|
-
Avo.plugin_manager.all.sort_by(&:priority).each do |plugin|
|
17
|
-
plugin.klass.boot
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def init_plugins
|
22
|
-
Avo.plugin_manager.all.sort_by(&:priority).each do |plugin|
|
23
|
-
plugin.klass.init
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
15
|
def register_field(method_name, klass)
|
28
16
|
Avo.field_manager.load_field method_name, klass
|
29
17
|
end
|
@@ -37,7 +25,7 @@ module Avo
|
|
37
25
|
def as_json(*arg)
|
38
26
|
plugins.map do |plugin|
|
39
27
|
{
|
40
|
-
klass: plugin.
|
28
|
+
klass: plugin.to_s,
|
41
29
|
priority: plugin.priority,
|
42
30
|
}
|
43
31
|
end
|
@@ -45,7 +33,7 @@ module Avo
|
|
45
33
|
|
46
34
|
def to_s
|
47
35
|
plugins.map do |plugin|
|
48
|
-
plugin.
|
36
|
+
plugin.to_s
|
49
37
|
end.join(",")
|
50
38
|
rescue
|
51
39
|
"Failed to fetch plugins."
|
data/lib/avo/version.rb
CHANGED
@@ -101,6 +101,7 @@ Avo.configure do |config|
|
|
101
101
|
# }
|
102
102
|
|
103
103
|
## == Customization ==
|
104
|
+
config.click_row_to_view_record = true
|
104
105
|
# config.app_name = 'Avocadelicious'
|
105
106
|
# config.timezone = 'UTC'
|
106
107
|
# config.currency = 'USD'
|
@@ -114,7 +115,6 @@ Avo.configure do |config|
|
|
114
115
|
# config.buttons_on_form_footers = true
|
115
116
|
# config.field_wrapper_layout = true
|
116
117
|
# config.resource_parent_controller = "Avo::ResourcesController"
|
117
|
-
# config.click_row_to_view_record = false
|
118
118
|
|
119
119
|
## == Branding ==
|
120
120
|
# config.branding = {
|
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: 3.13.
|
4
|
+
version: 3.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-10-
|
13
|
+
date: 2024-10-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -2234,6 +2234,7 @@ files:
|
|
2234
2234
|
- app/views/avo/debug/_valid_indicator.html.erb
|
2235
2235
|
- app/views/avo/debug/report.html.erb
|
2236
2236
|
- app/views/avo/debug/status.html.erb
|
2237
|
+
- app/views/avo/debug/status.text.erb
|
2237
2238
|
- app/views/avo/home/_actions.html.erb
|
2238
2239
|
- app/views/avo/home/_dashboards.html.erb
|
2239
2240
|
- app/views/avo/home/_docs.html.erb
|