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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16115bffdc8f969e07e1d01706cbcd76e6df1cdf5e1f8ce11e98dad69eb873b1
4
- data.tar.gz: 8bd21a31f10463840231e58046eb13e22623321aca8a72ca0fd057ad5cd1b41f
3
+ metadata.gz: 2de600c73d3828e8833970ec256410cd40ef633ffc98bf5186a15673bafa6f2e
4
+ data.tar.gz: 283ada9a58056407dd6214c35e98bd41a0c6550c52edc78272d72c8e0b4db9e0
5
5
  SHA512:
6
- metadata.gz: 88932b6f5343c7d4fc6d61a6f53aedeed56b9a67ac0b1ad79ab5aa3d76a6f9e25839139ada620fe9fbe6c79be486d934f0dbee4a9624bfdb29b5110025e36faa
7
- data.tar.gz: 28f672c943abe0f0d2ec0562fc7e1d20ddd210d551f849f276eb9d113a3c3ec276d28626f0d0e05e76c6e19514264e177886bfdd6a951435c69f82feff19d127
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.0)
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.14.0)
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
@@ -2,6 +2,8 @@ require_dependency "avo/application_controller"
2
2
 
3
3
  module Avo
4
4
  class PrivateController < ApplicationController
5
+ before_action :authenticate_developer_or_admin!
6
+
5
7
  def design
6
8
  @page_title = "Design [Private]"
7
9
  end
@@ -76,7 +76,7 @@
76
76
  <ul>
77
77
  <li>Avo <%= Avo::VERSION %></li>
78
78
  <% Avo.plugin_manager.plugins.each do |plugin| %>
79
- <li><%= plugin.klass.name %> - <%= plugin.klass.version %></li>
79
+ <li><%= plugin.name %> - <%= plugin.version %></li>
80
80
  <% end %>
81
81
  </ul>
82
82
  </div>
@@ -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?
@@ -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.klass.to_s,
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.klass.to_s
36
+ plugin.to_s
49
37
  end.join(",")
50
38
  rescue
51
39
  "Failed to fetch plugins."
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "3.13.0" unless const_defined?(:VERSION)
2
+ VERSION = "3.13.1" unless const_defined?(:VERSION)
3
3
  end
@@ -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.0
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