avo 0.5.0.beta2 → 0.5.0.beta3

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: 714d80a0c55444d87252f30e9233fe5db432136e9cd4ba0ad9851a57fd73b37e
4
- data.tar.gz: 184d84ab6338864f1b0479c344278544422cb3967acff3dd6063148a446211fc
3
+ metadata.gz: a01263a88047ada56ed5010750210945dd7b6c60493b6db08f5c6c0eb8588363
4
+ data.tar.gz: 1231108c022e42dbfcc73568ee428f16f37c8ee7fcfffec0199d907c080604b4
5
5
  SHA512:
6
- metadata.gz: bc03e6bcd02b5f628e063f94188cf3293f747ee0f53bfcae46cf198bd1074c5da9304c94024e7a3fbcada4a6ee7342f0f20e9c9659dd57e2a6cd8d4d3bd686c2
7
- data.tar.gz: b7a1c8fdf844e0064eef6df2449b501a75e0ed4f06499c6f74187654f16b02f316690076c00f3bafe98641a651b05c722cabd1c81f080eac0ffab03302754ac3
6
+ metadata.gz: 6c10735c0053dd06808dcce9b03be9b8c2025e020c05a3ae004a71e9ca6f2abcf793bf90dc84790b1097739fb9026980542078a2467036cfe605c771af834cfb
7
+ data.tar.gz: d7d111eb914b662998c288ee9aa399a52b27dabb57be7c1c316924b6ad8f7d31ff0e27491865c761f8d777e3cdfc15c8e9b48a910d69bf10eec8df57a4439f73
data/Gemfile CHANGED
@@ -97,7 +97,7 @@ group :test do
97
97
  gem 'selenium-webdriver'
98
98
  # Easy installation and use of web drivers to run system tests with browsers
99
99
  gem 'webdrivers'
100
- gem 'faker'
100
+ # gem 'faker'
101
101
  gem 'fuubar'
102
102
  gem 'simplecov', require: false
103
103
  gem 'simplecov-cobertura'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (0.5.0.beta2)
4
+ avo (0.5.0.beta3)
5
5
  active_link_to
6
6
  countries
7
7
  hotwire-rails
@@ -1,7 +1,7 @@
1
1
  <% if @resources.present?%>
2
2
  <div class="w-full grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 2xl:grid-cols-6 gap-6">
3
3
  <% @resources.each_with_index do |resource, index| %>
4
- <% cache_if Avo::PACKED, [resource.model, resource.file_hash] do %>
4
+ <% cache_if Avo.configuration.cache_resources_on_index_view, [resource.model, resource.file_hash] do %>
5
5
  <%= render(Avo::Index::GridItemComponent.new(resource: resource, reflection: @reflection, parent_model: @parent_model)) %>
6
6
  <% end %>
7
7
  <% end %>
@@ -4,7 +4,7 @@
4
4
  <%= render partial: 'avo/partials/table_header', locals: {fields: @resource.get_fields(view_type: :table, reflection: @reflection)} %>
5
5
  <tbody>
6
6
  <% @resources.each_with_index do |resource, index| %>
7
- <% cache_if Avo::PACKED, [resource.model, resource.file_hash] do %>
7
+ <% cache_if Avo.configuration.cache_resources_on_index_view, [resource.model, resource.file_hash] do %>
8
8
  <%= render Avo::Index::TableRowComponent.new(resource: resource, reflection: @reflection, parent_model: @parent_model) %>
9
9
  <% end %>
10
10
  <% end %>
@@ -30,7 +30,7 @@
30
30
  end
31
31
  classes = "text-blue-gray-600 tracking-tight leading-tight text-xs font-semibold"
32
32
  %>
33
- <th class="text-left uppercase px-3 py-2 ">
33
+ <th class="text-left uppercase px-3 py-2 whitespace-nowrap">
34
34
  <% if field.sortable %>
35
35
  <%= link_to params.permit!.merge(sort_by: sort_by, sort_direction: sort_direction), class: "flex items-center #{classes} #{'cursor-pointer' if field.sortable}", 'data-turbo-frame': params[:turbo_frame] do %>
36
36
  <%= field.name %>
data/lib/avo/app/app.rb CHANGED
@@ -166,12 +166,14 @@ module Avo
166
166
  def draw_routes
167
167
  Proc.new do
168
168
  Avo::Resources.constants
169
- .select do |r|
170
- r != :Resource
169
+ .select do |resource|
170
+ resource != :Resource
171
171
  end
172
- .map do |r|
173
- if Avo::Resources.const_get(r).is_a? Class
174
- resources r.to_s.underscore.downcase.pluralize.to_sym
172
+ .map do |resource|
173
+ if Avo::Resources.const_get(resource).is_a? Class
174
+ route_key = resource.to_s.underscore.downcase.pluralize.to_sym
175
+
176
+ resources route_key
175
177
  end
176
178
  end
177
179
  end
@@ -19,6 +19,7 @@ module Avo
19
19
  attr_accessor :id_links_to_resource
20
20
  attr_accessor :full_width_container
21
21
  attr_accessor :full_width_index_view
22
+ attr_accessor :cache_resources_on_index_view
22
23
 
23
24
  def initialize
24
25
  @root_path = '/avo'
@@ -48,6 +49,7 @@ module Avo
48
49
  @id_links_to_resource = false
49
50
  @full_width_container = false
50
51
  @full_width_index_view = false
52
+ @cache_resources_on_index_view = Avo::PACKED
51
53
  end
52
54
 
53
55
  def locale_tag
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = '0.5.0.beta2'
2
+ VERSION = '0.5.0.beta3'
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: 0.5.0.beta2
4
+ version: 0.5.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin