avo 3.13.0 → 3.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/app/components/avo/index/table_row_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 +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2de600c73d3828e8833970ec256410cd40ef633ffc98bf5186a15673bafa6f2e
|
4
|
+
data.tar.gz: 283ada9a58056407dd6214c35e98bd41a0c6550c52edc78272d72c8e0b4db9e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a848c2f29b325f960189def606f1771aea8eed1743ff99c88af020ed0306cc5377df5093d747f86a9c58de071c531714303a532afff86b19b624782aaa3594b
|
7
|
+
data.tar.gz: d7a15a33f6258f355b06075fbf657e3abda9f54590093d72a48ae2b3e6bb4f653a2c3c4b090e1e29cf82609a14e2848259939916b9dc85b744c70772be21166c
|
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.1)
|
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)
|
@@ -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)
|
@@ -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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
@@ -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
|