avo 3.0.1.beta20 → 3.0.1.beta22
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.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/builds/avo.base.js +2 -1
- data/app/assets/builds/avo.base.js.map +2 -2
- data/app/components/avo/sidebar_profile_component.html.erb +1 -2
- data/lib/avo/base_resource.rb +10 -8
- data/lib/avo/licensing/h_q.rb +1 -2
- data/lib/avo/version.rb +1 -1
- data/lib/avo/view_inquirer.rb +5 -2
- data/lib/avo.rb +1 -1
- metadata +2 -2
@@ -39,8 +39,7 @@
|
|
39
39
|
<% end %>
|
40
40
|
</div>
|
41
41
|
<% end %>
|
42
|
-
|
43
|
-
<%#= render Avo::ProfileItemComponent.new label: 'Profile', path: '/profile', icon: 'user-circle' %>
|
42
|
+
<%= render "avo/partials/profile_menu_extra" %>
|
44
43
|
<% if can_destroy_user? %>
|
45
44
|
<%= button_to helpers.main_app.send(destroy_user_session_path),
|
46
45
|
form: { "data-turbo" => "false" },
|
data/lib/avo/base_resource.rb
CHANGED
@@ -264,15 +264,17 @@ module Avo
|
|
264
264
|
self
|
265
265
|
end
|
266
266
|
|
267
|
+
VIEW_METHODS_MAPPING = {
|
268
|
+
index: [:index_fields, :display_fields],
|
269
|
+
show: [:show_fields, :display_fields],
|
270
|
+
edit: [:edit_fields, :form_fields],
|
271
|
+
update: [:edit_fields, :form_fields],
|
272
|
+
new: [:new_fields, :form_fields],
|
273
|
+
create: [:new_fields, :form_fields]
|
274
|
+
} unless defined? VIEW_METHODS_MAPPING
|
275
|
+
|
267
276
|
def fetch_fields
|
268
|
-
possible_methods_for_view =
|
269
|
-
index: [:index_fields, :display_fields],
|
270
|
-
show: [:show_fields, :display_fields],
|
271
|
-
edit: [:edit_fields, :form_fields],
|
272
|
-
update: [:edit_fields, :form_fields],
|
273
|
-
new: [:new_fields, :form_fields],
|
274
|
-
create: [:new_fields, :form_fields]
|
275
|
-
}[view.to_sym]
|
277
|
+
possible_methods_for_view = VIEW_METHODS_MAPPING[view.to_sym]
|
276
278
|
|
277
279
|
# Safe navigation operator is used because the view can be "destroy" or "preview"
|
278
280
|
possible_methods_for_view&.each do |method_for_view|
|
data/lib/avo/licensing/h_q.rb
CHANGED
@@ -4,8 +4,7 @@ module Avo
|
|
4
4
|
attr_accessor :current_request
|
5
5
|
attr_accessor :cache_store
|
6
6
|
|
7
|
-
|
8
|
-
ENDPOINT = "https://avohq.io/api/v1/licenses/check".freeze unless const_defined?(:ENDPOINT)
|
7
|
+
ENDPOINT = "https://v3.avohq.io/api/v3/licenses/check".freeze unless const_defined?(:ENDPOINT)
|
9
8
|
REQUEST_TIMEOUT = 5 unless const_defined?(:REQUEST_TIMEOUT) # seconds
|
10
9
|
CACHE_TIME = 3600 unless const_defined?(:CACHE_TIME) # seconds
|
11
10
|
|
data/lib/avo/version.rb
CHANGED
data/lib/avo/view_inquirer.rb
CHANGED
@@ -2,11 +2,14 @@
|
|
2
2
|
# It also allows to check if the view is a form or a display view by using `view.form?` or `view.display?`
|
3
3
|
module Avo
|
4
4
|
class ViewInquirer < ActiveSupport::StringInquirer
|
5
|
+
DISPLAY_VIEWS = %w[index show].freeze unless defined? DISPLAY_VIEWS
|
6
|
+
FORM_VIEWS = %w[new edit].freeze unless defined? FORM_VIEWS
|
7
|
+
|
5
8
|
def initialize(view)
|
6
9
|
super(view.to_s)
|
7
10
|
|
8
|
-
@display = in?
|
9
|
-
@form = in?
|
11
|
+
@display = in? DISPLAY_VIEWS
|
12
|
+
@form = in? FORM_VIEWS
|
10
13
|
end
|
11
14
|
|
12
15
|
def display?
|
data/lib/avo.rb
CHANGED
@@ -147,7 +147,7 @@ module Avo
|
|
147
147
|
def get_cache_store
|
148
148
|
if Rails.env.production?
|
149
149
|
case Rails.cache.class.to_s
|
150
|
-
when "ActiveSupport::Cache::MemCacheStore", "ActiveSupport::Cache::RedisCacheStore"
|
150
|
+
when "ActiveSupport::Cache::MemCacheStore", "ActiveSupport::Cache::RedisCacheStore", "SolidCache::Store"
|
151
151
|
Rails.cache
|
152
152
|
else
|
153
153
|
ActiveSupport::Cache.lookup_store(:file_store, Rails.root.join("tmp", "cache"))
|
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.0.1.
|
4
|
+
version: 3.0.1.beta22
|
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: 2023-10-
|
12
|
+
date: 2023-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|