avo 2.15.3.pre.1.data.attrs.to.sidebar.items → 2.15.3
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/components/avo/index/grid_item_component.html.erb +1 -1
- data/app/components/avo/index/grid_item_component.rb +2 -1
- data/app/components/avo/index/resource_grid_component.html.erb +1 -1
- data/app/components/avo/index/resource_grid_component.rb +2 -1
- data/app/components/avo/sidebar/item_switcher_component.html.erb +3 -3
- data/app/components/avo/sidebar/link_component.html.erb +2 -2
- data/app/components/avo/sidebar/link_component.rb +1 -3
- data/app/components/avo/views/resource_index_component.html.erb +1 -1
- data/lib/avo/menu/base_item.rb +0 -1
- data/lib/avo/menu/builder.rb +2 -4
- data/lib/avo/version.rb +1 -1
- metadata +4 -5
- data/config/master.key +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68cfd9efb2f52f774b347c404afe6b68e8e0e21102500e234184a11a4b8dd104
|
4
|
+
data.tar.gz: b8f9fc9d7a24fc30a453f0643aeae48c2e4bb9ecce27b59679e246bd55054fa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c80aedbf84f25b6b53e99d51c6ba3e603eaa619e9963ae988b4f76469f3f14c92e9e5f8045234bb7746cbed3008b9656d598effc0d49c742665acbbd4d35390a
|
7
|
+
data.tar.gz: c116b5296b79976867bd3f3342d334d355e7a5acb012b5bbb7e2965b65d98794f08b6f747d07e1598b144ff78c5c1fcfcf0e978ab681166ea67ca8a86abf9b4c
|
data/Gemfile.lock
CHANGED
@@ -38,7 +38,7 @@
|
|
38
38
|
</div>
|
39
39
|
</div>
|
40
40
|
<div class="w-full place-self-end">
|
41
|
-
<%= render(Avo::Index::ResourceControlsComponent.new(resource: @resource, reflection: @reflection, parent_model: @parent_model, view_type: :grid)) %>
|
41
|
+
<%= render(Avo::Index::ResourceControlsComponent.new(resource: @resource, reflection: @reflection, parent_model: @parent_model, parent_resource: @parent_resource, view_type: :grid)) %>
|
42
42
|
</div>
|
43
43
|
</div>
|
44
44
|
</div>
|
@@ -3,11 +3,12 @@
|
|
3
3
|
class Avo::Index::GridItemComponent < ViewComponent::Base
|
4
4
|
include Avo::ResourcesHelper
|
5
5
|
|
6
|
-
def initialize(resource: nil, reflection: nil, parent_model: nil)
|
6
|
+
def initialize(resource: nil, reflection: nil, parent_model: nil, parent_resource: nil)
|
7
7
|
@resource = resource
|
8
8
|
@reflection = reflection
|
9
9
|
@grid_fields = resource.get_grid_fields
|
10
10
|
@parent_model = parent_model
|
11
|
+
@parent_resource = parent_resource
|
11
12
|
end
|
12
13
|
|
13
14
|
private
|
@@ -3,7 +3,7 @@
|
|
3
3
|
data-selected-resources-name="<%= @resource.model_key %>" data-selected-resources="[]">
|
4
4
|
<% @resources.each_with_index do |resource, index| %>
|
5
5
|
<% cache_if Avo.configuration.cache_resources_on_index_view, resource.cache_hash(@parent_model) do %>
|
6
|
-
<%= render(Avo::Index::GridItemComponent.new(resource: resource, reflection: @reflection, parent_model: @parent_model)) %>
|
6
|
+
<%= render(Avo::Index::GridItemComponent.new(resource: resource, reflection: @reflection, parent_model: @parent_model, parent_resource: @parent_resource)) %>
|
7
7
|
<% end %>
|
8
8
|
<% end %>
|
9
9
|
</div>
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Avo::Index::ResourceGridComponent < ViewComponent::Base
|
4
|
-
def initialize(resources: nil, resource: nil, reflection: nil, parent_model: nil)
|
4
|
+
def initialize(resources: nil, resource: nil, reflection: nil, parent_model: nil, parent_resource: @parent_resource)
|
5
5
|
@resources = resources
|
6
6
|
@resource = resource
|
7
7
|
@reflection = reflection
|
8
8
|
@parent_model = parent_model
|
9
|
+
@parent_resource = parent_resource
|
9
10
|
end
|
10
11
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<% if item.is_a? Avo::Menu::Link %>
|
2
|
-
<%= render Avo::Sidebar::LinkComponent.new label: item.name, path: item.path, target: item.target
|
2
|
+
<%= render Avo::Sidebar::LinkComponent.new label: item.name, path: item.path, target: item.target %>
|
3
3
|
<% end %>
|
4
4
|
<% if item.is_a? Avo::Menu::Resource %>
|
5
|
-
<%= render Avo::Sidebar::LinkComponent.new label: item.navigation_label, path: helpers.resources_path(resource: resource)
|
5
|
+
<%= render Avo::Sidebar::LinkComponent.new label: item.navigation_label, path: helpers.resources_path(resource: resource) %>
|
6
6
|
<% end %>
|
7
7
|
<% if item.is_a? Avo::Menu::Dashboard %>
|
8
|
-
<%= render Avo::Sidebar::LinkComponent.new label: item.navigation_label, path: dashboard.navigation_path
|
8
|
+
<%= render Avo::Sidebar::LinkComponent.new label: item.navigation_label, path: dashboard.navigation_path %>
|
9
9
|
<% end %>
|
10
10
|
<% if item.is_a? Avo::Menu::Section %>
|
11
11
|
<%= render Avo::Sidebar::SectionComponent.new item: item %>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<% if path.present? %>
|
2
|
-
<%= send link_method, path, class: classes, active: active, target: target
|
2
|
+
<%= send link_method, path, class: classes, active: active, target: target do %>
|
3
3
|
<%= label %>
|
4
4
|
<% if target == :_blank %>
|
5
5
|
<%= helpers.svg('heroicons/outline/external-link', class: 'self-center ml-auto h-3 mr-2') %>
|
6
6
|
<% end %>
|
7
7
|
<% end %>
|
8
8
|
<% else %>
|
9
|
-
<%= content_tag :div, class: classes, active: active, target: target
|
9
|
+
<%= content_tag :div, class: classes, active: active, target: target do %>
|
10
10
|
<%= label %>
|
11
11
|
<% end %>
|
12
12
|
<% end %>
|
@@ -5,14 +5,12 @@ class Avo::Sidebar::LinkComponent < ViewComponent::Base
|
|
5
5
|
attr_reader :target
|
6
6
|
attr_reader :label
|
7
7
|
attr_reader :path
|
8
|
-
attr_reader :data
|
9
8
|
|
10
|
-
def initialize(label: nil, path: nil, active: :inclusive, target: nil
|
9
|
+
def initialize(label: nil, path: nil, active: :inclusive, target: nil)
|
11
10
|
@label = label
|
12
11
|
@path = path
|
13
12
|
@active = active
|
14
13
|
@target = target
|
15
|
-
@data = data
|
16
14
|
end
|
17
15
|
|
18
16
|
def is_external?
|
@@ -65,7 +65,7 @@
|
|
65
65
|
<% end %>
|
66
66
|
<% end %>
|
67
67
|
<% if view_type.to_sym == :grid %>
|
68
|
-
<%= render Avo::Index::ResourceGridComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_model: @parent_model) %>
|
68
|
+
<%= render Avo::Index::ResourceGridComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_model: @parent_model, parent_resource: @parent_resource) %>
|
69
69
|
<div class="mt-6">
|
70
70
|
<%= render Avo::PaginatorComponent.new pagy: @pagy, turbo_frame: @turbo_frame || 'none', index_params: @index_params, resource: @resource, parent_model: @parent_model, discreet_pagination: field&.discreet_pagination %>
|
71
71
|
</div>
|
data/lib/avo/menu/base_item.rb
CHANGED
data/lib/avo/menu/builder.rb
CHANGED
@@ -22,11 +22,9 @@ class Avo::Menu::Builder
|
|
22
22
|
end
|
23
23
|
|
24
24
|
# Adds a link
|
25
|
-
def link(name,
|
26
|
-
|
27
|
-
@menu.items << Avo::Menu::Link.new(name: name, path: path, **args)
|
25
|
+
def link(name, **args)
|
26
|
+
@menu.items << Avo::Menu::Link.new(name: name, **args)
|
28
27
|
end
|
29
|
-
alias_method :link_to, :link
|
30
28
|
|
31
29
|
# Validates and adds a resource
|
32
30
|
def resource(name, **args)
|
data/lib/avo/version.rb
CHANGED
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.15.3
|
4
|
+
version: 2.15.3
|
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-09-
|
12
|
+
date: 2022-09-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -1743,7 +1743,6 @@ files:
|
|
1743
1743
|
- config/cable.yml
|
1744
1744
|
- config/credentials.yml.enc
|
1745
1745
|
- config/initializers/pagy.rb
|
1746
|
-
- config/master.key
|
1747
1746
|
- config/routes.rb
|
1748
1747
|
- config/spring.rb
|
1749
1748
|
- db/factories.rb
|
@@ -1976,9 +1975,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1976
1975
|
version: 2.4.0
|
1977
1976
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1978
1977
|
requirements:
|
1979
|
-
- - "
|
1978
|
+
- - ">="
|
1980
1979
|
- !ruby/object:Gem::Version
|
1981
|
-
version:
|
1980
|
+
version: '0'
|
1982
1981
|
requirements: []
|
1983
1982
|
rubygems_version: 3.3.3
|
1984
1983
|
signing_key:
|
data/config/master.key
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2aeb23d82b909d9c6b5abb62f7058c2a
|