avo 2.15.2 → 2.15.3.pre.1.data.attrs.to.sidebar.items
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -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 +3 -1
- data/config/master.key +1 -0
- data/lib/avo/menu/base_item.rb +1 -0
- data/lib/avo/menu/builder.rb +4 -2
- data/lib/avo/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 64729fc8e5570fcc659daa51c57938d6b75690ab2952fa054149e7208c064e5a
|
|
4
|
+
data.tar.gz: 373621511d2f61b098add0594a1cfdfb687f1587ac7a6e3c1f1c388b663146fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 36b5950de108a20d8fa2dd24e68022d7eee35d16bb9cd07e926748c887e3bc42d42fb6ef36d3932e60c31fbbf2860a1aee6af035287515393e20619be4c59f62
|
|
7
|
+
data.tar.gz: e047c958831467741cb77c330b8fe62df5349b40fee2f5de42e2965e11587dc193d2266883c217d1d9b529536264101aa76fb41d884008e9ca8d192b0d33928d
|
data/Gemfile.lock
CHANGED
|
@@ -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, data: item.data %>
|
|
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), data: item.data %>
|
|
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, data: item.data %>
|
|
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 do %>
|
|
2
|
+
<%= send link_method, path, class: classes, active: active, target: target, data: data 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 do %>
|
|
9
|
+
<%= content_tag :div, class: classes, active: active, target: target, data: data do %>
|
|
10
10
|
<%= label %>
|
|
11
11
|
<% end %>
|
|
12
12
|
<% end %>
|
|
@@ -5,12 +5,14 @@ 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
|
|
8
9
|
|
|
9
|
-
def initialize(label: nil, path: nil, active: :inclusive, target: nil)
|
|
10
|
+
def initialize(label: nil, path: nil, active: :inclusive, target: nil, data: {})
|
|
10
11
|
@label = label
|
|
11
12
|
@path = path
|
|
12
13
|
@active = active
|
|
13
14
|
@target = target
|
|
15
|
+
@data = data
|
|
14
16
|
end
|
|
15
17
|
|
|
16
18
|
def is_external?
|
data/config/master.key
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2aeb23d82b909d9c6b5abb62f7058c2a
|
data/lib/avo/menu/base_item.rb
CHANGED
data/lib/avo/menu/builder.rb
CHANGED
|
@@ -22,9 +22,11 @@ class Avo::Menu::Builder
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
# Adds a link
|
|
25
|
-
def link(name, **args)
|
|
26
|
-
|
|
25
|
+
def link(name, path = nil, **args)
|
|
26
|
+
path ||= args[:path]
|
|
27
|
+
@menu.items << Avo::Menu::Link.new(name: name, path: path, **args)
|
|
27
28
|
end
|
|
29
|
+
alias_method :link_to, :link
|
|
28
30
|
|
|
29
31
|
# Validates and adds a resource
|
|
30
32
|
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.
|
|
4
|
+
version: 2.15.3.pre.1.data.attrs.to.sidebar.items
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adrian Marin
|
|
@@ -1743,6 +1743,7 @@ files:
|
|
|
1743
1743
|
- config/cable.yml
|
|
1744
1744
|
- config/credentials.yml.enc
|
|
1745
1745
|
- config/initializers/pagy.rb
|
|
1746
|
+
- config/master.key
|
|
1746
1747
|
- config/routes.rb
|
|
1747
1748
|
- config/spring.rb
|
|
1748
1749
|
- db/factories.rb
|
|
@@ -1975,9 +1976,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
1975
1976
|
version: 2.4.0
|
|
1976
1977
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1977
1978
|
requirements:
|
|
1978
|
-
- - "
|
|
1979
|
+
- - ">"
|
|
1979
1980
|
- !ruby/object:Gem::Version
|
|
1980
|
-
version:
|
|
1981
|
+
version: 1.3.1
|
|
1981
1982
|
requirements: []
|
|
1982
1983
|
rubygems_version: 3.3.3
|
|
1983
1984
|
signing_key:
|