avo 1.4.5.pre.1 → 1.5.4
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 -0
- data/Gemfile.lock +57 -54
- data/README.md +1 -0
- data/app/components/avo/fields/id_field/index_component.html.erb +1 -1
- data/app/components/avo/index/grid_item_component.html.erb +1 -1
- data/app/helpers/avo/application_helper.rb +4 -6
- data/app/views/avo/base/index.html.erb +2 -2
- data/app/views/avo/base/show.html.erb +2 -2
- data/app/views/avo/partials/_profile_dropdown.html.erb +12 -8
- data/app/views/avo/partials/_turbo_frame_wrap.html.erb +3 -0
- data/lib/avo/app.rb +1 -1
- data/lib/avo/base_resource.rb +3 -1
- data/lib/avo/engine.rb +2 -0
- data/lib/avo/fields/external_image_field.rb +4 -0
- data/lib/avo/licensing/license_manager.rb +0 -2
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/templates/locales/avo.en.yml +0 -1
- data/lib/generators/avo/templates/locales/avo.nb-NO.yml +1 -2
- data/lib/generators/avo/templates/locales/avo.pt-BR.yml +1 -2
- data/lib/generators/avo/templates/locales/avo.ro.yml +0 -1
- data/lib/generators/avo/templates/resource/resource.tt +1 -1
- data/lib/generators/avo/templates/tool/sidebar_item.tt +1 -1
- data/public/avo-packs/css/{application-d69fe930.css → application-797341b7.css} +4 -1
- data/public/avo-packs/css/application-797341b7.css.br +0 -0
- data/public/avo-packs/css/{application-d69fe930.css.gz → application-797341b7.css.gz} +0 -0
- data/public/avo-packs/css/application-797341b7.css.map +1 -0
- data/public/avo-packs/css/application-797341b7.css.map.br +0 -0
- data/public/avo-packs/css/application-797341b7.css.map.gz +0 -0
- data/public/avo-packs/js/application-7b3d507875f4bc1f6677.js.map +1 -1
- data/public/avo-packs/js/application-7b3d507875f4bc1f6677.js.map.br +0 -0
- data/public/avo-packs/js/application-7b3d507875f4bc1f6677.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +7 -7
- metadata +11 -10
- data/public/avo-packs/css/application-d69fe930.css.br +0 -0
- data/public/avo-packs/css/application-d69fe930.css.map +0 -1
- data/public/avo-packs/css/application-d69fe930.css.map.br +0 -0
- data/public/avo-packs/css/application-d69fe930.css.map.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc3e86bb2bed5bb314aba376cf8e2cbbec351f8af1b5585c3cd34f73fb8eef82
|
4
|
+
data.tar.gz: a43b72f1ebbaa89aea87ac44f8092d1dd4963bcf3b875787f03b8b4a1142db0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fdac7b7ae32a39b6437fe887b313de0a94c99731578eb427034439bb752cff3edc0e615bd2a04fb12e175f0b57b037f7f01edeb25cc6e2d3bc9d1a91701067d
|
7
|
+
data.tar.gz: 36a6eccf3ad9376df602866487bbaf0a6b4a0d4d4e5dc495570418b6561f6ba69edef46abd13e1fdcbf65fbc3a26097cebd441fbefdeed95e728d49a6ddbe745
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (1.
|
4
|
+
avo (1.5.4)
|
5
5
|
active_link_to
|
6
6
|
addressable
|
7
7
|
breadcrumbs_on_rails
|
@@ -21,38 +21,38 @@ PATH
|
|
21
21
|
GEM
|
22
22
|
remote: https://rubygems.org/
|
23
23
|
specs:
|
24
|
-
actioncable (6.0.3.
|
25
|
-
actionpack (= 6.0.3.
|
24
|
+
actioncable (6.0.3.7)
|
25
|
+
actionpack (= 6.0.3.7)
|
26
26
|
nio4r (~> 2.0)
|
27
27
|
websocket-driver (>= 0.6.1)
|
28
|
-
actionmailbox (6.0.3.
|
29
|
-
actionpack (= 6.0.3.
|
30
|
-
activejob (= 6.0.3.
|
31
|
-
activerecord (= 6.0.3.
|
32
|
-
activestorage (= 6.0.3.
|
33
|
-
activesupport (= 6.0.3.
|
28
|
+
actionmailbox (6.0.3.7)
|
29
|
+
actionpack (= 6.0.3.7)
|
30
|
+
activejob (= 6.0.3.7)
|
31
|
+
activerecord (= 6.0.3.7)
|
32
|
+
activestorage (= 6.0.3.7)
|
33
|
+
activesupport (= 6.0.3.7)
|
34
34
|
mail (>= 2.7.1)
|
35
|
-
actionmailer (6.0.3.
|
36
|
-
actionpack (= 6.0.3.
|
37
|
-
actionview (= 6.0.3.
|
38
|
-
activejob (= 6.0.3.
|
35
|
+
actionmailer (6.0.3.7)
|
36
|
+
actionpack (= 6.0.3.7)
|
37
|
+
actionview (= 6.0.3.7)
|
38
|
+
activejob (= 6.0.3.7)
|
39
39
|
mail (~> 2.5, >= 2.5.4)
|
40
40
|
rails-dom-testing (~> 2.0)
|
41
|
-
actionpack (6.0.3.
|
42
|
-
actionview (= 6.0.3.
|
43
|
-
activesupport (= 6.0.3.
|
41
|
+
actionpack (6.0.3.7)
|
42
|
+
actionview (= 6.0.3.7)
|
43
|
+
activesupport (= 6.0.3.7)
|
44
44
|
rack (~> 2.0, >= 2.0.8)
|
45
45
|
rack-test (>= 0.6.3)
|
46
46
|
rails-dom-testing (~> 2.0)
|
47
47
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
48
|
-
actiontext (6.0.3.
|
49
|
-
actionpack (= 6.0.3.
|
50
|
-
activerecord (= 6.0.3.
|
51
|
-
activestorage (= 6.0.3.
|
52
|
-
activesupport (= 6.0.3.
|
48
|
+
actiontext (6.0.3.7)
|
49
|
+
actionpack (= 6.0.3.7)
|
50
|
+
activerecord (= 6.0.3.7)
|
51
|
+
activestorage (= 6.0.3.7)
|
52
|
+
activesupport (= 6.0.3.7)
|
53
53
|
nokogiri (>= 1.8.5)
|
54
|
-
actionview (6.0.3.
|
55
|
-
activesupport (= 6.0.3.
|
54
|
+
actionview (6.0.3.7)
|
55
|
+
activesupport (= 6.0.3.7)
|
56
56
|
builder (~> 3.1)
|
57
57
|
erubi (~> 1.4)
|
58
58
|
rails-dom-testing (~> 2.0)
|
@@ -60,20 +60,20 @@ GEM
|
|
60
60
|
active_link_to (1.0.5)
|
61
61
|
actionpack
|
62
62
|
addressable
|
63
|
-
activejob (6.0.3.
|
64
|
-
activesupport (= 6.0.3.
|
63
|
+
activejob (6.0.3.7)
|
64
|
+
activesupport (= 6.0.3.7)
|
65
65
|
globalid (>= 0.3.6)
|
66
|
-
activemodel (6.0.3.
|
67
|
-
activesupport (= 6.0.3.
|
68
|
-
activerecord (6.0.3.
|
69
|
-
activemodel (= 6.0.3.
|
70
|
-
activesupport (= 6.0.3.
|
71
|
-
activestorage (6.0.3.
|
72
|
-
actionpack (= 6.0.3.
|
73
|
-
activejob (= 6.0.3.
|
74
|
-
activerecord (= 6.0.3.
|
66
|
+
activemodel (6.0.3.7)
|
67
|
+
activesupport (= 6.0.3.7)
|
68
|
+
activerecord (6.0.3.7)
|
69
|
+
activemodel (= 6.0.3.7)
|
70
|
+
activesupport (= 6.0.3.7)
|
71
|
+
activestorage (6.0.3.7)
|
72
|
+
actionpack (= 6.0.3.7)
|
73
|
+
activejob (= 6.0.3.7)
|
74
|
+
activerecord (= 6.0.3.7)
|
75
75
|
marcel (~> 1.0.0)
|
76
|
-
activesupport (6.0.3.
|
76
|
+
activesupport (6.0.3.7)
|
77
77
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
78
78
|
i18n (>= 0.7, < 2)
|
79
79
|
minitest (~> 5.1)
|
@@ -157,6 +157,8 @@ GEM
|
|
157
157
|
i18n
|
158
158
|
jbuilder (2.10.1)
|
159
159
|
activesupport (>= 5.0.0)
|
160
|
+
launchy (2.5.0)
|
161
|
+
addressable (~> 2.7)
|
160
162
|
listen (3.5.1)
|
161
163
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
162
164
|
rb-inotify (~> 0.9, >= 0.9.10)
|
@@ -177,7 +179,7 @@ GEM
|
|
177
179
|
mime-types-data (3.2021.0225)
|
178
180
|
mini_magick (4.11.0)
|
179
181
|
mini_mime (1.1.0)
|
180
|
-
mini_portile2 (2.5.
|
182
|
+
mini_portile2 (2.5.1)
|
181
183
|
minitest (5.14.4)
|
182
184
|
msgpack (1.4.2)
|
183
185
|
multi_xml (0.6.0)
|
@@ -204,20 +206,20 @@ GEM
|
|
204
206
|
rack
|
205
207
|
rack-test (1.1.0)
|
206
208
|
rack (>= 1.0, < 3)
|
207
|
-
rails (6.0.3.
|
208
|
-
actioncable (= 6.0.3.
|
209
|
-
actionmailbox (= 6.0.3.
|
210
|
-
actionmailer (= 6.0.3.
|
211
|
-
actionpack (= 6.0.3.
|
212
|
-
actiontext (= 6.0.3.
|
213
|
-
actionview (= 6.0.3.
|
214
|
-
activejob (= 6.0.3.
|
215
|
-
activemodel (= 6.0.3.
|
216
|
-
activerecord (= 6.0.3.
|
217
|
-
activestorage (= 6.0.3.
|
218
|
-
activesupport (= 6.0.3.
|
209
|
+
rails (6.0.3.7)
|
210
|
+
actioncable (= 6.0.3.7)
|
211
|
+
actionmailbox (= 6.0.3.7)
|
212
|
+
actionmailer (= 6.0.3.7)
|
213
|
+
actionpack (= 6.0.3.7)
|
214
|
+
actiontext (= 6.0.3.7)
|
215
|
+
actionview (= 6.0.3.7)
|
216
|
+
activejob (= 6.0.3.7)
|
217
|
+
activemodel (= 6.0.3.7)
|
218
|
+
activerecord (= 6.0.3.7)
|
219
|
+
activestorage (= 6.0.3.7)
|
220
|
+
activesupport (= 6.0.3.7)
|
219
221
|
bundler (>= 1.3.0)
|
220
|
-
railties (= 6.0.3.
|
222
|
+
railties (= 6.0.3.7)
|
221
223
|
sprockets-rails (>= 2.0.0)
|
222
224
|
rails-controller-testing (1.0.5)
|
223
225
|
actionpack (>= 5.0.1.rc1)
|
@@ -228,9 +230,9 @@ GEM
|
|
228
230
|
nokogiri (>= 1.6)
|
229
231
|
rails-html-sanitizer (1.3.0)
|
230
232
|
loofah (~> 2.3)
|
231
|
-
railties (6.0.3.
|
232
|
-
actionpack (= 6.0.3.
|
233
|
-
activesupport (= 6.0.3.
|
233
|
+
railties (6.0.3.7)
|
234
|
+
actionpack (= 6.0.3.7)
|
235
|
+
activesupport (= 6.0.3.7)
|
234
236
|
method_source
|
235
237
|
rake (>= 0.8.7)
|
236
238
|
thor (>= 0.20.3, < 2.0)
|
@@ -247,7 +249,7 @@ GEM
|
|
247
249
|
responders (3.0.1)
|
248
250
|
actionpack (>= 5.0)
|
249
251
|
railties (>= 5.0)
|
250
|
-
rexml (3.2.
|
252
|
+
rexml (3.2.5)
|
251
253
|
rspec-core (3.9.2)
|
252
254
|
rspec-support (~> 3.9.3)
|
253
255
|
rspec-expectations (3.9.2)
|
@@ -387,6 +389,7 @@ DEPENDENCIES
|
|
387
389
|
image_processing (~> 1.2)
|
388
390
|
iso
|
389
391
|
jbuilder (~> 2.7)
|
392
|
+
launchy
|
390
393
|
listen (>= 3.5.1)
|
391
394
|
manifester
|
392
395
|
meta-tags
|
@@ -415,4 +418,4 @@ DEPENDENCIES
|
|
415
418
|
zeitwerk (~> 2.3)
|
416
419
|
|
417
420
|
BUNDLED WITH
|
418
|
-
2.2.
|
421
|
+
2.2.17
|
data/README.md
CHANGED
@@ -24,6 +24,7 @@ Avo is a beautiful next-generation framework that empowers you, the developer, t
|
|
24
24
|
- **Powered by Hotwire** - Rails ❤️ Hotwire
|
25
25
|
- **Code driven configuration** - Configure your Rails dashboard entirely by writing Ruby code.
|
26
26
|
- **Resource Management** - Create a CRUD interface for Active Record from one command. No more copy-pasting view and controller files around.
|
27
|
+
- **Resource Search** - Quickly run a search through one or more resources at once.
|
27
28
|
- **Active Storage support** - Amazingly easy, **one-line**, single or multi-file integration with **ActiveStorage**.
|
28
29
|
- **Grid view** - Beautiful card layout to showcase your content.
|
29
30
|
- **Actions** - Run custom actions to one or more of your resources with as little as pressing a button 💪
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= index_field_wrapper field: @field do %>
|
1
|
+
<%= index_field_wrapper field: @field, class: 'whitespace-no-wrap w-[1%]' do %>
|
2
2
|
<% link_to_if (@field.link_to_resource or Avo.configuration.id_links_to_resource), @field.value, resource_path, title: t('avo.view_item', item: @resource.name).humanize %>
|
3
3
|
<% end %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
<% if cover.blank? %>
|
8
8
|
<%= render Avo::Index::GridCoverEmptyStateComponent.new %>
|
9
|
-
<% elsif cover.respond_to?
|
9
|
+
<% elsif cover.respond_to?(:to_image) && cover.to_image.present? %>
|
10
10
|
<%= link_to_if cover.link_to_resource, image_tag(cover.to_image, class: 'absolute h-full w-full object-cover'), helpers.resource_path(@resource.model), class: 'absolute h-full w-full object-cover', title: title.value %>
|
11
11
|
<% elsif cover.type == 'file' %>
|
12
12
|
<% if cover.value.attached? && cover.value.representable? %>
|
@@ -31,12 +31,10 @@ module Avo
|
|
31
31
|
render partial: "avo/partials/empty_state", locals: {resource_name: resource_name}
|
32
32
|
end
|
33
33
|
|
34
|
-
def
|
35
|
-
"
|
36
|
-
|
37
|
-
|
38
|
-
def turbo_frame_end(name)
|
39
|
-
"</turbo-frame>".html_safe if name.present?
|
34
|
+
def turbo_frame_wrap(name, &block)
|
35
|
+
render layout: "avo/partials/turbo_frame_wrap", locals: {name: name} do
|
36
|
+
capture(&block)
|
37
|
+
end
|
40
38
|
end
|
41
39
|
|
42
40
|
def a_button(label = nil, **args, &block)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%=
|
1
|
+
<%= turbo_frame_wrap(params[:turbo_frame]) do %>
|
2
2
|
<%= render Avo::Views::ResourceIndexComponent.new(
|
3
3
|
resource: @resource,
|
4
4
|
resources: @resources,
|
@@ -12,4 +12,4 @@
|
|
12
12
|
parent_model: @parent_model,
|
13
13
|
)
|
14
14
|
%>
|
15
|
-
|
15
|
+
<% end %>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%=
|
1
|
+
<%= turbo_frame_wrap(params[:turbo_frame]) do %>
|
2
2
|
<%= render Avo::Views::ResourceShowComponent.new(resource: @resource, reflection: @reflection) %>
|
3
|
-
|
3
|
+
<% end %>
|
@@ -1,19 +1,23 @@
|
|
1
1
|
<div data-controller="toggle-panel">
|
2
2
|
<a href="javascript:void(0);" class="flex items-center cursor-pointer font-semibold text-gray-700" data-action="click->toggle-panel#togglePanel">
|
3
|
-
<% if _current_user.respond_to?
|
4
|
-
<%= image_tag _current_user.avatar, class: "h-12 rounded-full border-4 border-white mr-1"
|
3
|
+
<% if _current_user.respond_to?(:avatar) && _current_user.avatar.present? %>
|
4
|
+
<%= image_tag _current_user.avatar, class: "h-12 rounded-full border-4 border-white mr-1" %>
|
5
5
|
<% end %>
|
6
|
-
<% if _current_user.name.present? %>
|
6
|
+
<% if _current_user.respond_to?(:name) && _current_user.name.present? %>
|
7
7
|
<%= _current_user.name %>
|
8
|
-
<% elsif _current_user.email.present? %>
|
8
|
+
<% elsif _current_user.respond_to?(:email) && _current_user.email.present? %>
|
9
9
|
<%= _current_user.email %>
|
10
10
|
<% else %>
|
11
11
|
Avo user
|
12
12
|
<% end %>
|
13
|
-
|
13
|
+
<% if main_app.respond_to?(:destroy_user_session_path) %>
|
14
|
+
<%= svg 'chevron-down', class: "ml-1 h-4" %>
|
15
|
+
<% end %>
|
14
16
|
</a>
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
|
18
|
+
<% if main_app.respond_to?(:destroy_user_session_path) %>
|
19
|
+
<div class="hidden absolute inset-auto inset-auto right-0 mr-6 mt-0 py-4 bg-white rounded-xl min-w-[200px] shadow-context" data-toggle-panel-target="panel">
|
20
|
+
<%= button_to "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" %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
19
23
|
</div>
|
data/lib/avo/app.rb
CHANGED
@@ -119,7 +119,7 @@ module Avo
|
|
119
119
|
|
120
120
|
def get_available_resources(user = nil)
|
121
121
|
resources.select do |resource|
|
122
|
-
Services::AuthorizationService.authorize user, resource.
|
122
|
+
Services::AuthorizationService.authorize user, resource.model_class, Avo.configuration.authorization_methods.stringify_keys["index"], raise_exception: false
|
123
123
|
end
|
124
124
|
.sort_by { |r| r.name }
|
125
125
|
end
|
data/lib/avo/base_resource.rb
CHANGED
data/lib/avo/engine.rb
CHANGED
@@ -13,6 +13,8 @@ module Avo
|
|
13
13
|
::Avo::App.boot
|
14
14
|
end
|
15
15
|
|
16
|
+
config.i18n.load_path += Dir[Avo::Engine.root.join('lib', 'generators', 'avo', 'templates', 'locales', '*.{rb,yml}')]
|
17
|
+
|
16
18
|
initializer "avo.autoload", before: :set_autoload_paths do |app|
|
17
19
|
[
|
18
20
|
["app", "avo", "fields"],
|
data/lib/avo/version.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
nb:
|
1
|
+
nb-NO:
|
2
2
|
avo:
|
3
3
|
dashboard: 'Dashboard'
|
4
4
|
choose_a_country: 'Velg et land'
|
@@ -43,7 +43,6 @@ nb:
|
|
43
43
|
per_page: 'Per side'
|
44
44
|
more: 'Mer'
|
45
45
|
attach: 'Legg til'
|
46
|
-
cancel: 'Avslutt'
|
47
46
|
save: 'Lagre'
|
48
47
|
attach_and_attach_another: 'Legg til & Legg til ny'
|
49
48
|
hide_content: 'Skjul innhold'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
pt:
|
1
|
+
pt-BR:
|
2
2
|
avo:
|
3
3
|
dashboard: 'Painel'
|
4
4
|
choose_a_country: 'Escolha um país'
|
@@ -43,7 +43,6 @@ pt:
|
|
43
43
|
per_page: 'Por página'
|
44
44
|
more: 'Mais'
|
45
45
|
attach: 'Anexar'
|
46
|
-
cancel: 'Cancelar'
|
47
46
|
save: 'Salvar'
|
48
47
|
attach_and_attach_another: 'Anexar & anexar outro'
|
49
48
|
hide_content: 'Esconder conteúdo'
|
@@ -2,7 +2,7 @@ class <%= resource_class %> < Avo::BaseResource
|
|
2
2
|
self.title = :id
|
3
3
|
self.includes = []
|
4
4
|
# self.search_query = ->(params:) do
|
5
|
-
|
5
|
+
# scope.ransack(id_eq: params[:q], m: "or").result(distinct: false)
|
6
6
|
# end
|
7
7
|
|
8
8
|
field :id, as: :id
|
@@ -1 +1 @@
|
|
1
|
-
<%%= render Avo::NavigationLinkComponent.new label: '<%= human_name %>', path:
|
1
|
+
<%%= render Avo::NavigationLinkComponent.new label: '<%= human_name %>', path: "#{Avo.configuration.root_path}/<%= file_name %>" %>
|
@@ -5044,6 +5044,9 @@ progress[value]::-moz-progress-bar {
|
|
5044
5044
|
.w-3 {
|
5045
5045
|
width: 0.75rem
|
5046
5046
|
}
|
5047
|
+
.w-\[1\%\] {
|
5048
|
+
width: 1%
|
5049
|
+
}
|
5047
5050
|
.min-w-300px {
|
5048
5051
|
min-width: 300px
|
5049
5052
|
}
|
@@ -6241,4 +6244,4 @@ html, body{
|
|
6241
6244
|
}
|
6242
6245
|
|
6243
6246
|
|
6244
|
-
/*# sourceMappingURL=application-
|
6247
|
+
/*# sourceMappingURL=application-797341b7.css.map*/
|