avo 2.11.1.pre.1 → 2.11.1.pre.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 +0 -2
- data/Gemfile.lock +5 -6
- data/app/components/avo/item_switcher_component.rb +2 -0
- data/app/components/avo/panel_component.html.erb +2 -4
- data/app/components/avo/panel_component.rb +0 -4
- data/app/components/avo/resource_component.rb +3 -22
- data/app/components/avo/sidebar/link_component.rb +4 -1
- data/app/components/avo/tab_group_component.html.erb +1 -2
- data/app/components/avo/views/resource_edit_component.html.erb +30 -8
- data/app/components/avo/views/resource_edit_component.rb +0 -2
- data/app/components/avo/views/resource_show_component.html.erb +13 -1
- data/app/components/avo/views/resource_show_component.rb +0 -2
- data/app/controllers/avo/base_controller.rb +3 -2
- data/app/views/avo/base/edit.html.erb +0 -1
- data/avo.gemspec +1 -1
- data/lib/avo/version.rb +1 -1
- data/public/avo-assets/avo.css +8 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bc7baa68c6256d8c8a26e4a40be36129d1187451015bc72c0ec2be65c3acd8b
|
4
|
+
data.tar.gz: 57a8ef18222e622ed7d3f45334b46c97183d10ea845b321044648cd1974faf22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3df946571876e5742a86eb9314fe1122ea2838bedd0c3af3027e754df24ca20a4c9961e62c46f50a399c9265ddbf2b1f2cb9b2fd2ffb43e13bdcf6595634d71c
|
7
|
+
data.tar.gz: 7d9b4560a2069d752f5e82bc66c0d0eb4e1e9df5d95261371e859c8907741ac80a43a7ba09ce5ed6f59da316723b9f1ab9dbb8de3931f98113fc5de1c619ee74
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (2.11.1.pre.
|
4
|
+
avo (2.11.1.pre.2)
|
5
5
|
active_link_to
|
6
6
|
addressable
|
7
7
|
breadcrumbs_on_rails
|
@@ -16,7 +16,7 @@ PATH
|
|
16
16
|
pagy
|
17
17
|
pundit
|
18
18
|
rails (>= 6.0)
|
19
|
-
view_component
|
19
|
+
view_component (= 2.60)
|
20
20
|
zeitwerk
|
21
21
|
|
22
22
|
GEM
|
@@ -201,7 +201,7 @@ GEM
|
|
201
201
|
httparty (0.20.0)
|
202
202
|
mime-types (~> 3.0)
|
203
203
|
multi_xml (>= 0.5.2)
|
204
|
-
i18n (1.
|
204
|
+
i18n (1.12.0)
|
205
205
|
concurrent-ruby (~> 1.0)
|
206
206
|
i18n_data (0.15.0)
|
207
207
|
simple_po_parser (~> 1.1)
|
@@ -390,10 +390,10 @@ GEM
|
|
390
390
|
turbo-rails (1.0.1)
|
391
391
|
actionpack (>= 6.0.0)
|
392
392
|
railties (>= 6.0.0)
|
393
|
-
tzinfo (2.0.
|
393
|
+
tzinfo (2.0.5)
|
394
394
|
concurrent-ruby (~> 1.0)
|
395
395
|
unicode-display_width (2.1.0)
|
396
|
-
view_component (2.
|
396
|
+
view_component (2.60.0)
|
397
397
|
activesupport (>= 5.0.0, < 8.0)
|
398
398
|
method_source (~> 1.0)
|
399
399
|
warden (1.2.9)
|
@@ -483,7 +483,6 @@ DEPENDENCIES
|
|
483
483
|
standard
|
484
484
|
test-prof
|
485
485
|
tzinfo-data
|
486
|
-
view_component
|
487
486
|
web-console (>= 3.3.0)
|
488
487
|
webdrivers
|
489
488
|
webmock
|
@@ -34,10 +34,8 @@
|
|
34
34
|
</div>
|
35
35
|
<% end %>
|
36
36
|
<% if footer_tools? %>
|
37
|
-
<div class="
|
38
|
-
|
39
|
-
<%= footer_tools %>
|
40
|
-
</div>
|
37
|
+
<div class="flex-1 w-full flex flex-col sm:flex-row xl:justify-end sm:items-end space-y-2 sm:space-y-0 sm:space-x-2 mt-4 xl:mt-0">
|
38
|
+
<%= footer_tools %>
|
41
39
|
</div>
|
42
40
|
<% end %>
|
43
41
|
<% if footer? %>
|
@@ -58,33 +58,14 @@ class Avo::ResourceComponent < Avo::BaseComponent
|
|
58
58
|
association_policy
|
59
59
|
end
|
60
60
|
|
61
|
-
def
|
62
|
-
|
63
|
-
|
64
|
-
case field.class.to_s
|
65
|
-
when "Avo::Fields::HasOneField"
|
66
|
-
@has_one_panels << field
|
67
|
-
when "Avo::Fields::HasManyField"
|
68
|
-
@has_many_panels << field
|
69
|
-
when "Avo::Fields::HasAndBelongsToManyField"
|
70
|
-
@has_as_belongs_to_many_panels << field
|
71
|
-
else
|
72
|
-
@fields_by_panel[field.panel_name] ||= []
|
73
|
-
@fields_by_panel[field.panel_name] << field
|
74
|
-
end
|
61
|
+
def main_panel
|
62
|
+
@resource.get_items.find do |item|
|
63
|
+
item.is_main_panel?
|
75
64
|
end
|
76
65
|
end
|
77
66
|
|
78
67
|
private
|
79
68
|
|
80
|
-
def initialize_panels
|
81
|
-
@fields_by_panel = {}
|
82
|
-
@has_one_panels = []
|
83
|
-
@has_many_panels = []
|
84
|
-
@has_as_belongs_to_many_panels = []
|
85
|
-
@resource_tools = @resource.tools
|
86
|
-
end
|
87
|
-
|
88
69
|
def via_resource?
|
89
70
|
params[:via_resource_class].present? && params[:via_resource_id].present?
|
90
71
|
end
|
@@ -14,7 +14,10 @@ class Avo::Sidebar::LinkComponent < ViewComponent::Base
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def is_external?
|
17
|
-
|
17
|
+
# If the path contains the scheme, check if it includes the root path or not
|
18
|
+
return !path.include?(Avo::App.root_path) if URI(path).scheme.present?
|
19
|
+
|
20
|
+
false
|
18
21
|
end
|
19
22
|
|
20
23
|
# For external links active_link_to marks them all as active.
|
@@ -33,20 +33,42 @@
|
|
33
33
|
<% end %>
|
34
34
|
<% end %>
|
35
35
|
<% end %>
|
36
|
+
<%# Extract the main panel and display the fields here. %>
|
37
|
+
<%# This way we'll be able to render the footer buttons under the main fields. %>
|
38
|
+
<% if main_panel.present? %>
|
39
|
+
<% c.body do %>
|
40
|
+
<div class="divide-y">
|
41
|
+
<% main_panel.items.each_with_index do |field, index| %>
|
42
|
+
<%= render field.hydrate(resource: @resource, model: @resource.model, user: @resource.user, view: view)
|
43
|
+
.component_for_view(view)
|
44
|
+
.new(field: field, resource: @resource, index: index, form: form)
|
45
|
+
%>
|
46
|
+
<% end %>
|
47
|
+
</div>
|
48
|
+
<% end %>
|
49
|
+
<% end %>
|
36
50
|
<% if Avo.configuration.buttons_on_form_footers %>
|
37
51
|
<% c.footer_tools do %>
|
38
|
-
|
39
|
-
<%=
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
<%= t('avo.save').capitalize %>
|
52
|
+
<div class="mt-4">
|
53
|
+
<%= a_link back_path,
|
54
|
+
style: :text,
|
55
|
+
icon: 'arrow-left' do %>
|
56
|
+
<%= t('avo.cancel').capitalize %>
|
44
57
|
<% end %>
|
45
|
-
|
58
|
+
<% if can_see_the_save_button? %>
|
59
|
+
<%= a_button color: :primary,
|
60
|
+
style: :primary,
|
61
|
+
loading: true,
|
62
|
+
type: :submit,
|
63
|
+
icon: 'save' do %>
|
64
|
+
<%= t('avo.save').capitalize %>
|
65
|
+
<% end %>
|
66
|
+
<% end %>
|
67
|
+
</div>
|
46
68
|
<% end %>
|
47
69
|
<% end %>
|
48
70
|
<% end %>
|
49
|
-
<%= content_tag :div, class: 'space-y-12' do %>
|
71
|
+
<%= content_tag :div, class: 'space-y-12 mt-12' do %>
|
50
72
|
<% @resource.get_items.each_with_index do |item, index| %>
|
51
73
|
<% next if item.nil? %>
|
52
74
|
<%= render Avo::ItemSwitcherComponent.new resource: @resource, item: item, index: index + 1, view: @view, form: form %>
|
@@ -64,8 +64,20 @@
|
|
64
64
|
<% end %>
|
65
65
|
<% end %>
|
66
66
|
<% end %>
|
67
|
+
<% if main_panel.present? %>
|
68
|
+
<% c.body do %>
|
69
|
+
<div class="divide-y">
|
70
|
+
<% main_panel.items.each_with_index do |field, index| %>
|
71
|
+
<%= render field.hydrate(resource: @resource, model: @resource.model, user: @resource.user, view: view)
|
72
|
+
.component_for_view(view)
|
73
|
+
.new(field: field, resource: @resource, index: index)
|
74
|
+
%>
|
75
|
+
<% end %>
|
76
|
+
</div>
|
77
|
+
<% end %>
|
78
|
+
<% end %>
|
67
79
|
<% end %>
|
68
|
-
<%= content_tag :div, class: 'space-y-12' do %>
|
80
|
+
<%= content_tag :div, class: 'space-y-12 mt-12' do %>
|
69
81
|
<% @resource.get_items.each_with_index do |item, index| %>
|
70
82
|
<% next if item.nil? %>
|
71
83
|
<%= render Avo::ItemSwitcherComponent.new resource: @resource, reflection: @reflection, item: item, index: index + 1, view: @view %>
|
@@ -320,7 +320,9 @@ module Avo
|
|
320
320
|
.map do |action|
|
321
321
|
action.new(model: @model, resource: @resource, view: @view)
|
322
322
|
end
|
323
|
-
.select
|
323
|
+
.select do |action|
|
324
|
+
action.visible_in_view
|
325
|
+
end
|
324
326
|
end
|
325
327
|
|
326
328
|
def set_applied_filters
|
@@ -380,7 +382,6 @@ module Avo
|
|
380
382
|
|
381
383
|
add_breadcrumb via_resource.plural_name, resources_path(resource: @resource)
|
382
384
|
add_breadcrumb via_resource.model_title, resource_path(model: via_model, resource: via_resource)
|
383
|
-
puts ["via_resource.model_title->", via_resource.model_title].inspect
|
384
385
|
|
385
386
|
last_crumb_args = {
|
386
387
|
via_resource_class: params[:via_resource_class],
|
data/avo.gemspec
CHANGED
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
|
|
40
40
|
spec.add_dependency "httparty"
|
41
41
|
spec.add_dependency "active_link_to"
|
42
42
|
spec.add_dependency "image_processing"
|
43
|
-
spec.add_dependency "view_component"
|
43
|
+
spec.add_dependency "view_component", "2.60"
|
44
44
|
spec.add_dependency "hotwire-rails"
|
45
45
|
spec.add_dependency "addressable"
|
46
46
|
spec.add_dependency "meta-tags"
|
data/lib/avo/version.rb
CHANGED
data/public/avo-assets/avo.css
CHANGED
@@ -6461,10 +6461,6 @@ trix-editor .attachment__metadata .attachment__size {
|
|
6461
6461
|
margin-bottom:0.5rem
|
6462
6462
|
}
|
6463
6463
|
|
6464
|
-
.mt-6{
|
6465
|
-
margin-top:1.5rem
|
6466
|
-
}
|
6467
|
-
|
6468
6464
|
.ml-1\/2{
|
6469
6465
|
margin-left:50%
|
6470
6466
|
}
|
@@ -6481,6 +6477,10 @@ trix-editor .attachment__metadata .attachment__size {
|
|
6481
6477
|
margin-left:auto
|
6482
6478
|
}
|
6483
6479
|
|
6480
|
+
.mt-12{
|
6481
|
+
margin-top:3rem
|
6482
|
+
}
|
6483
|
+
|
6484
6484
|
.-mb-2{
|
6485
6485
|
margin-bottom:-0.5rem
|
6486
6486
|
}
|
@@ -6489,6 +6489,10 @@ trix-editor .attachment__metadata .attachment__size {
|
|
6489
6489
|
margin-top:0px
|
6490
6490
|
}
|
6491
6491
|
|
6492
|
+
.mt-6{
|
6493
|
+
margin-top:1.5rem
|
6494
|
+
}
|
6495
|
+
|
6492
6496
|
.mr-px{
|
6493
6497
|
margin-right:1px
|
6494
6498
|
}
|
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: 2.11.1.pre.
|
4
|
+
version: 2.11.1.pre.2
|
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: 2022-07-
|
12
|
+
date: 2022-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -127,16 +127,16 @@ dependencies:
|
|
127
127
|
name: view_component
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- -
|
130
|
+
- - '='
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '
|
132
|
+
version: '2.60'
|
133
133
|
type: :runtime
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- -
|
137
|
+
- - '='
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: '
|
139
|
+
version: '2.60'
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: hotwire-rails
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|