avo 1.18.2.pre.0 → 1.18.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -4
- data/app/components/avo/fields/text_field/index_component.html.erb +5 -1
- data/app/components/avo/fields/text_field/show_component.html.erb +5 -1
- data/app/views/avo/partials/_profile_dropdown.html.erb +7 -5
- data/lib/avo/app.rb +8 -4
- data/lib/avo/configuration.rb +2 -0
- data/lib/avo/fields/text_field.rb +2 -0
- data/lib/avo/version.rb +1 -1
- data/public/avo-packs/css/application-f9191617.css.map +1 -1
- data/public/avo-packs/css/application-f9191617.css.map.br +0 -0
- data/public/avo-packs/css/application-f9191617.css.map.gz +0 -0
- data/public/avo-packs/js/application-cc89f096028eb1d4d971.js.map +1 -1
- data/public/avo-packs/js/application-cc89f096028eb1d4d971.js.map.br +0 -0
- data/public/avo-packs/js/application-cc89f096028eb1d4d971.js.map.gz +0 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a9e6624587295b46f8f052da4cb2b6ffb8faff958d1de9ab0fe2eb98a58c05c
|
4
|
+
data.tar.gz: 1010b48e463a388d0b20e3348de1c49f8468d63c2a14d78fe9ca4a9ad5c87e3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d18de447e0138f28d1ceb806bf16968b88dc81c0f1b097fee892bda8b19259a8df939c3fe3060e963a0f1f04e2696f3706b1f68a42b92c2e1f53a48e09788518
|
7
|
+
data.tar.gz: 91d9ec101ce25c6dba5300a054476ef8fef432cfe18d6140b0f6ff92a73be95fca213a549af6c38bfd7e3f392822ad6feaeea2fff77f208395137f063e3b7594
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (1.18.2
|
4
|
+
avo (1.18.2)
|
5
5
|
active_link_to
|
6
6
|
addressable
|
7
7
|
breadcrumbs_on_rails
|
@@ -227,10 +227,8 @@ GEM
|
|
227
227
|
nokogiri (1.13.0)
|
228
228
|
mini_portile2 (~> 2.7.0)
|
229
229
|
racc (~> 1.4)
|
230
|
-
nokogiri (1.13.0-x86_64-linux)
|
231
|
-
racc (~> 1.4)
|
232
230
|
orm_adapter (0.5.0)
|
233
|
-
pagy (5.7.
|
231
|
+
pagy (5.7.3)
|
234
232
|
parallel (1.21.0)
|
235
233
|
parser (3.1.0.0)
|
236
234
|
ast (~> 2.4.1)
|
@@ -1,3 +1,7 @@
|
|
1
1
|
<%= index_field_wrapper field: @field do %>
|
2
|
-
|
2
|
+
<% if @field.as_html %>
|
3
|
+
<%== @field.value %>
|
4
|
+
<% else %>
|
5
|
+
<%= link_to_if @field.link_to_resource, @field.value, resource_path %>
|
6
|
+
<% end %>
|
3
7
|
<% end %>
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
<% destroy_user_session_path = "destroy_#{Avo.configuration.current_user_resource_name}_session_path".to_sym %>
|
2
|
+
|
3
|
+
<div <% if main_app.respond_to?(destroy_user_session_path) %> data-controller="toggle-panel" <% end %>>
|
2
4
|
<a href="javascript:void(0);" class="flex items-center cursor-pointer font-semibold text-gray-700" data-action="click->toggle-panel#togglePanel">
|
3
5
|
<% if _current_user.respond_to?(:avatar) && _current_user.avatar.present? %>
|
4
6
|
<%= image_tag _current_user.avatar, class: "h-12 rounded-full border-4 border-white mr-1" %>
|
@@ -10,14 +12,14 @@
|
|
10
12
|
<% else %>
|
11
13
|
Avo user
|
12
14
|
<% end %>
|
13
|
-
<% if main_app.respond_to?(
|
15
|
+
<% if main_app.respond_to?(destroy_user_session_path) %>
|
14
16
|
<%= svg 'chevron-down', class: "ml-1 h-4" %>
|
15
17
|
<% end %>
|
16
18
|
</a>
|
17
19
|
|
18
|
-
<% if main_app.respond_to?(
|
19
|
-
<div class="hidden absolute inset-auto
|
20
|
-
<%= button_to t('avo.sign_out'), main_app.destroy_user_session_path, method: :delete, form: { "data-turbo" => "false" }, class: "appearance-none bg-white text-left cursor-pointer text-green-600 font-semibold hover:text-white hover:bg-green-500 block px-4 py-1 w-full" %>
|
20
|
+
<% if main_app.respond_to?(destroy_user_session_path) %>
|
21
|
+
<div class="hidden absolute inset-auto right-0 mr-6 mt-0 py-4 bg-white rounded-xl min-w-[200px] shadow-context" data-toggle-panel-target="panel">
|
22
|
+
<%= button_to t('avo.sign_out'), main_app.send(:destroy_user_session_path), method: :delete, form: { "data-turbo" => "false" }, class: "appearance-none bg-white text-left cursor-pointer text-green-600 font-semibold hover:text-white hover:bg-green-500 block px-4 py-1 w-full" %>
|
21
23
|
</div>
|
22
24
|
<% end %>
|
23
25
|
</div>
|
data/lib/avo/app.rb
CHANGED
@@ -32,7 +32,11 @@ module Avo
|
|
32
32
|
|
33
33
|
# Set the current host for ActiveStorage
|
34
34
|
begin
|
35
|
-
|
35
|
+
if Rails::VERSION::MAJOR === 6
|
36
|
+
ActiveStorage::Current.host = request.base_url
|
37
|
+
elsif Rails::VERSION::MAJOR === 7
|
38
|
+
ActiveStorage::Current.url_options = request.base_url
|
39
|
+
end
|
36
40
|
rescue => exception
|
37
41
|
Rails.logger.debug "[Avo] Failed to set ActiveStorage::Current.url_options, #{exception.inspect}"
|
38
42
|
end
|
@@ -121,8 +125,8 @@ module Avo
|
|
121
125
|
|
122
126
|
def get_available_resources(user = nil)
|
123
127
|
resources.select do |resource|
|
124
|
-
|
125
|
-
|
128
|
+
Services::AuthorizationService.authorize user, resource.model_class, Avo.configuration.authorization_methods.stringify_keys["index"], raise_exception: false
|
129
|
+
end
|
126
130
|
.sort_by { |r| r.name }
|
127
131
|
end
|
128
132
|
|
@@ -145,7 +149,7 @@ module Avo
|
|
145
149
|
# remove the leading underscore (_)
|
146
150
|
filename[0] = ""
|
147
151
|
# remove the extension
|
148
|
-
filename.gsub!(
|
152
|
+
filename.gsub!(".html.erb", "")
|
149
153
|
filename
|
150
154
|
end
|
151
155
|
end
|
data/lib/avo/configuration.rb
CHANGED
@@ -25,6 +25,7 @@ module Avo
|
|
25
25
|
attr_accessor :search_debounce
|
26
26
|
attr_accessor :view_component_path
|
27
27
|
attr_accessor :display_license_request_timeout_error
|
28
|
+
attr_accessor :current_user_resource_name
|
28
29
|
|
29
30
|
def initialize
|
30
31
|
@root_path = "/avo"
|
@@ -62,6 +63,7 @@ module Avo
|
|
62
63
|
@search_debounce = 300
|
63
64
|
@view_component_path = "app/components"
|
64
65
|
@display_license_request_timeout_error = true
|
66
|
+
@current_user_resource_name = "user"
|
65
67
|
end
|
66
68
|
|
67
69
|
def locale_tag
|
@@ -2,11 +2,13 @@ module Avo
|
|
2
2
|
module Fields
|
3
3
|
class TextField < BaseField
|
4
4
|
attr_reader :link_to_resource
|
5
|
+
attr_reader :as_html
|
5
6
|
|
6
7
|
def initialize(id, **args, &block)
|
7
8
|
super(id, **args, &block)
|
8
9
|
|
9
10
|
@link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
|
11
|
+
@as_html = args[:as_html].present? ? args[:as_html] : false
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
data/lib/avo/version.rb
CHANGED