avo 2.15.3.pre.1.data.attrs.to.sidebar.items → 2.15.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64729fc8e5570fcc659daa51c57938d6b75690ab2952fa054149e7208c064e5a
4
- data.tar.gz: 373621511d2f61b098add0594a1cfdfb687f1587ac7a6e3c1f1c388b663146fd
3
+ metadata.gz: 68cfd9efb2f52f774b347c404afe6b68e8e0e21102500e234184a11a4b8dd104
4
+ data.tar.gz: b8f9fc9d7a24fc30a453f0643aeae48c2e4bb9ecce27b59679e246bd55054fa3
5
5
  SHA512:
6
- metadata.gz: 36b5950de108a20d8fa2dd24e68022d7eee35d16bb9cd07e926748c887e3bc42d42fb6ef36d3932e60c31fbbf2860a1aee6af035287515393e20619be4c59f62
7
- data.tar.gz: e047c958831467741cb77c330b8fe62df5349b40fee2f5de42e2965e11587dc193d2266883c217d1d9b529536264101aa76fb41d884008e9ca8d192b0d33928d
6
+ metadata.gz: c80aedbf84f25b6b53e99d51c6ba3e603eaa619e9963ae988b4f76469f3f14c92e9e5f8045234bb7746cbed3008b9656d598effc0d49c742665acbbd4d35390a
7
+ data.tar.gz: c116b5296b79976867bd3f3342d334d355e7a5acb012b5bbb7e2965b65d98794f08b6f747d07e1598b144ff78c5c1fcfcf0e978ab681166ea67ca8a86abf9b4c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.15.3.pre.1.data.attrs.to.sidebar.items)
4
+ avo (2.15.3)
5
5
  active_link_to
6
6
  addressable
7
7
  breadcrumbs_on_rails
@@ -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, data: item.data %>
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), data: item.data %>
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, data: item.data %>
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, data: data do %>
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, data: data do %>
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, data: {})
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>
@@ -9,7 +9,6 @@ class Avo::Menu::BaseItem
9
9
  option :items, default: proc { [] }
10
10
  option :name, default: proc { "" }
11
11
  option :visible, default: proc { true }
12
- option :data, default: proc { {} }
13
12
 
14
13
  def visible?
15
14
  return visible if visible.in? [true, false]
@@ -22,11 +22,9 @@ class Avo::Menu::Builder
22
22
  end
23
23
 
24
24
  # Adds a link
25
- def link(name, path = nil, **args)
26
- path ||= args[:path]
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
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.15.3.pre.1.data.attrs.to.sidebar.items" unless const_defined?(:VERSION)
2
+ VERSION = "2.15.3" unless const_defined?(:VERSION)
3
3
  end
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.pre.1.data.attrs.to.sidebar.items
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-14 00:00:00.000000000 Z
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: 1.3.1
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