avo 0.5.0.beta8 → 0.5.0.beta13

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.

Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +46 -50
  3. data/Gemfile.lock +3 -8
  4. data/Rakefile +14 -14
  5. data/app/components/avo/common/multiple_file_viewer_component.rb +1 -1
  6. data/app/components/avo/common/single_file_viewer_component.rb +1 -1
  7. data/app/components/avo/edit/field_wrapper_component.rb +3 -3
  8. data/app/components/avo/edit/fields/trix_field_component.html.erb +1 -1
  9. data/app/components/avo/index/field_wrapper_component.rb +1 -1
  10. data/app/components/avo/index/grid_item_component.rb +10 -9
  11. data/app/components/avo/index/resource_controls_component.rb +2 -2
  12. data/app/components/avo/panel_component.rb +7 -6
  13. data/app/components/avo/resource_component.rb +4 -3
  14. data/app/components/avo/show/field_wrapper_component.rb +3 -3
  15. data/app/components/avo/views/resource_edit_component.rb +4 -3
  16. data/app/components/avo/views/resource_index_component.rb +8 -7
  17. data/app/components/avo/views/resource_new_component.rb +4 -3
  18. data/app/components/avo/views/resource_show_component.rb +21 -21
  19. data/app/controllers/avo/actions_controller.rb +30 -29
  20. data/app/controllers/avo/application_controller.rb +113 -126
  21. data/app/controllers/avo/attachments_controller.rb +3 -3
  22. data/app/controllers/avo/base_controller.rb +81 -80
  23. data/app/controllers/avo/home_controller.rb +2 -2
  24. data/app/controllers/avo/relations_controller.rb +29 -28
  25. data/app/controllers/avo/resources_controller.rb +1 -1
  26. data/app/controllers/avo/search_controller.rb +20 -19
  27. data/app/helpers/avo/application_helper.rb +48 -42
  28. data/app/helpers/avo/resources_helper.rb +11 -11
  29. data/app/mailers/avo/application_mailer.rb +2 -2
  30. data/app/packs/entrypoints/application.js +9 -4
  31. data/app/packs/images/logo.png +0 -0
  32. data/app/packs/js/controllers/fields/code_field_controller.js +14 -14
  33. data/app/packs/js/controllers/filter_controller.js +9 -8
  34. data/app/packs/js/toastr.js +1 -0
  35. data/app/packs/stylesheets/components/code.css +0 -16
  36. data/avo.gemspec +30 -31
  37. data/bin/webpack +1 -0
  38. data/config/initializers/pagy.rb +1 -1
  39. data/config/routes.rb +12 -12
  40. data/config/spring.rb +5 -5
  41. data/config/webpack/base.js +3 -3
  42. data/config/webpacker.yml +32 -0
  43. data/db/factories.rb +3 -5
  44. data/lib/avo.rb +6 -6
  45. data/lib/avo/app.rb +18 -18
  46. data/lib/avo/base_action.rb +20 -20
  47. data/lib/avo/base_resource.rb +41 -45
  48. data/lib/avo/configuration.rb +16 -18
  49. data/lib/avo/engine.rb +18 -18
  50. data/lib/avo/fields/badge_field.rb +2 -2
  51. data/lib/avo/fields/base_field.rb +25 -26
  52. data/lib/avo/fields/belongs_to_field.rb +13 -12
  53. data/lib/avo/fields/boolean_field.rb +4 -4
  54. data/lib/avo/fields/boolean_group_field.rb +3 -3
  55. data/lib/avo/fields/code_field.rb +4 -4
  56. data/lib/avo/fields/country_field.rb +2 -2
  57. data/lib/avo/fields/currency_field.rb +3 -3
  58. data/lib/avo/fields/date_field.rb +3 -3
  59. data/lib/avo/fields/date_time_field.rb +2 -2
  60. data/lib/avo/fields/external_image_field.rb +2 -2
  61. data/lib/avo/fields/field_extensions/has_field_name.rb +2 -2
  62. data/lib/avo/fields/field_extensions/visible_in_different_views.rb +34 -33
  63. data/lib/avo/fields/file_field.rb +1 -1
  64. data/lib/avo/fields/files_field.rb +2 -2
  65. data/lib/avo/fields/gravatar_field.rb +9 -9
  66. data/lib/avo/fields/has_and_belongs_to_many_field.rb +1 -1
  67. data/lib/avo/fields/has_many_field.rb +1 -1
  68. data/lib/avo/fields/has_one_field.rb +2 -2
  69. data/lib/avo/fields/heading_field.rb +2 -2
  70. data/lib/avo/fields/hidden_field.rb +1 -1
  71. data/lib/avo/fields/id_field.rb +3 -3
  72. data/lib/avo/fields/key_value_field.rb +12 -12
  73. data/lib/avo/fields/markdown_field.rb +2 -2
  74. data/lib/avo/fields/number_field.rb +3 -3
  75. data/lib/avo/fields/password_field.rb +1 -1
  76. data/lib/avo/fields/select_field.rb +8 -12
  77. data/lib/avo/fields/status_field.rb +4 -4
  78. data/lib/avo/fields/text_field.rb +2 -2
  79. data/lib/avo/fields/textarea_field.rb +2 -2
  80. data/lib/avo/fields/trix_field.rb +1 -1
  81. data/lib/avo/fields_collector.rb +4 -5
  82. data/lib/avo/filters/base_filter.rb +6 -6
  83. data/lib/avo/filters/boolean_filter.rb +1 -1
  84. data/lib/avo/filters/select_filter.rb +1 -1
  85. data/lib/avo/licensing/h_q.rb +56 -55
  86. data/lib/avo/licensing/license.rb +5 -5
  87. data/lib/avo/licensing/license_manager.rb +4 -4
  88. data/lib/avo/licensing/null_license.rb +2 -2
  89. data/lib/avo/licensing/pro_license.rb +1 -1
  90. data/lib/avo/loaders/fields_loader.rb +4 -4
  91. data/lib/avo/services/authorization_service.rb +2 -2
  92. data/lib/avo/services/panel_service.rb +4 -4
  93. data/lib/avo/version.rb +1 -1
  94. data/lib/generators/avo/action_generator.rb +4 -4
  95. data/lib/generators/avo/controller_generator.rb +4 -4
  96. data/lib/generators/avo/filter_generator.rb +5 -5
  97. data/lib/generators/avo/install_generator.rb +8 -8
  98. data/lib/generators/avo/locales_generator.rb +5 -5
  99. data/lib/generators/avo/partials_generator.rb +4 -4
  100. data/lib/generators/avo/resource_generator.rb +5 -5
  101. data/lib/generators/avo/templates/action.tt +0 -4
  102. data/lib/generators/avo/templates/resource/resource.tt +3 -13
  103. data/lib/tasks/avo_tasks.rake +0 -60
  104. data/public/avo-packs/css/{application-5bb09ba4.css → application-9d115b7e.css} +124 -276
  105. data/public/avo-packs/css/application-9d115b7e.css.br +0 -0
  106. data/public/avo-packs/css/application-9d115b7e.css.gz +0 -0
  107. data/public/avo-packs/css/application-9d115b7e.css.map +1 -0
  108. data/public/avo-packs/css/application-9d115b7e.css.map.br +0 -0
  109. data/public/avo-packs/css/application-9d115b7e.css.map.gz +0 -0
  110. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js +26 -0
  111. data/public/avo-packs/js/{application-86a3ea5a835b0c758203.js.LICENSE.txt → application-4751feac1bb0404b9c47.js.LICENSE.txt} +0 -0
  112. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.br +0 -0
  113. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.gz +0 -0
  114. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.map +1 -0
  115. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.map.br +0 -0
  116. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.map.gz +0 -0
  117. data/public/avo-packs/manifest.json +16 -16
  118. data/public/avo-packs/media/images/dadf2db36589607d107d.png +0 -0
  119. metadata +16 -31
  120. data/config/initializers/inline_svg.rb +0 -33
  121. data/public/avo-packs/css/application-5bb09ba4.css.br +0 -0
  122. data/public/avo-packs/css/application-5bb09ba4.css.gz +0 -0
  123. data/public/avo-packs/css/application-5bb09ba4.css.map +0 -1
  124. data/public/avo-packs/css/application-5bb09ba4.css.map.br +0 -0
  125. data/public/avo-packs/css/application-5bb09ba4.css.map.gz +0 -0
  126. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js +0 -26
  127. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.br +0 -0
  128. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.gz +0 -0
  129. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map +0 -1
  130. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map.br +0 -0
  131. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map.gz +0 -0
  132. data/public/avo-packs/media/images/f1b4befac91a3336db9a.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f7f5a6a457f61e77abd2ac617061c042ead0eab1177a7d98b1ea3d3202db916
4
- data.tar.gz: 0a999ae8588fea1973f91a601a00dda8c9eb6d3b4d05e34b55b39799d48659a3
3
+ metadata.gz: 1d8a2b867c1f5e721e0252ddf96c157bc98ee63938e243bead77fdc69ddca52b
4
+ data.tar.gz: 1b15f8e2e663fb24d43a02c4bacfc8ee8a22c8a51155eb6f1a2cedc00a70471f
5
5
  SHA512:
6
- metadata.gz: e64e3c0d8a17c6fab1b79d58fd6eb33e6d92cfc1c71a3aacf81892225a69451901c322d4770956e42bda36ada3de82f78a8cb5ee1e80a0996b1c9f86cda14143
7
- data.tar.gz: db227187abcd8fd276d9e34152b725eb7b7ab2c4312bc305f3d2a09a56a79da654b0d80f31e55b67b2871ae29375c34094b0570b41a0147520e2c8398092c7c2
6
+ metadata.gz: d93d1796485579a529d6096b2c07f665a7ad5f14ccb5fa9b1a9945ff4778793ce51ce0a1617c8b1273a1f0b289792075967745726fe5afa64aa7297c6f498ed5
7
+ data.tar.gz: bb7fa6d37d162cf29ca803b92259ce60ea874352858a79b64def192f5b5d1240aa04e8e5b3b8f21c341e7e95ac457b69c15c004b0217c4362818e15bad8878dd
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
3
 
4
4
  # Declare your gem's dependencies in avo.gemspec.
@@ -15,113 +15,109 @@ gemspec
15
15
  # gem 'byebug', group: [:development, :test]
16
16
 
17
17
  # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
18
- gem 'webpacker', '6.0.0.beta.5'
18
+ gem "webpacker", "6.0.0.beta.6"
19
19
 
20
- # SVGs
21
- gem 'inline_svg'
22
-
23
- gem 'countries'
20
+ gem "countries"
24
21
 
25
22
  # Authorization
26
- gem 'pundit'
23
+ gem "pundit"
27
24
 
28
25
  #
29
26
  # Dependencies for dummy_app
30
27
  #
31
28
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
32
- gem 'rails', '~> 6.0.2', '>= 6.0.2.2'
29
+ gem "rails", "~> 6.0.2", ">= 6.0.2.2"
33
30
  # Use postgresql as the database for Active Record
34
- gem 'pg', '>= 0.18', '< 2.0'
31
+ gem "pg", ">= 0.18", "< 2.0"
35
32
  # Use Puma as the app server
36
- gem 'puma', '~> 4.3.5'
33
+ gem "puma", "~> 4.3.5"
37
34
  # Use SCSS for stylesheets
38
- gem 'sass-rails', '>= 6'
35
+ gem "sass-rails", ">= 6"
39
36
  # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
40
37
  # gem 'turbolinks', '~> 5'
41
38
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
42
- gem 'jbuilder', '~> 2.7'
39
+ gem "jbuilder", "~> 2.7"
43
40
  # Use Redis adapter to run Action Cable in production
44
41
  # gem 'redis', '~> 4.0'
45
42
  # Use Active Model has_secure_password
46
43
  # gem 'bcrypt', '~> 3.1.7'
47
44
 
48
45
  # Use Active Storage variant
49
- gem 'image_processing', '~> 1.2'
46
+ gem "image_processing", "~> 1.2"
50
47
 
51
48
  # Reduces boot times through caching; required in config/boot.rb
52
- gem 'bootsnap', '>= 1.4.2', require: false
49
+ gem "bootsnap", ">= 1.4.2", require: false
53
50
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
54
- gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
55
- gem 'dotenv-rails'
51
+ gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
52
+ gem "dotenv-rails"
56
53
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
57
- gem 'web-console', '>= 3.3.0'
58
- gem 'listen', '>= 3.0.5', '< 3.2'
54
+ gem "web-console", ">= 3.3.0"
55
+ gem "listen", ">= 3.0.5", "< 3.2"
59
56
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
60
- gem 'spring'
57
+ gem "spring"
61
58
 
62
- gem 'factory_bot_rails'
59
+ gem "factory_bot_rails"
63
60
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
64
- gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
61
+ gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
65
62
 
66
- gem 'devise'
67
- gem 'database_cleaner'
63
+ gem "devise"
64
+ gem "database_cleaner"
68
65
 
69
- gem 'ruby-debug-ide', require: false
70
- gem 'debase'
66
+ gem "ruby-debug-ide", require: false
67
+ gem "debase"
71
68
  #
72
69
  # END Dependencies for dummy_app
73
70
  #
74
71
 
75
72
  group :development do
76
- gem 'standard'
73
+ gem "standard"
77
74
 
78
75
  # Release helper
79
- gem 'bump', require: false
80
- gem 'gem-release', require: false
76
+ gem "bump", require: false
77
+ gem "gem-release", require: false
81
78
 
82
79
  # gem 'rack-mini-profiler'
83
80
  # gem 'memory_profiler'
84
81
  # gem 'stackprof'
85
82
  # gem 'ruby-prof'
86
83
 
87
-
88
84
  # gem 'pry-rails'
89
85
  end
90
86
 
91
87
  group :development, :test do
92
- gem 'faker', require: false
88
+ gem "faker", require: false
93
89
  end
94
90
 
95
91
  group :test do
96
- gem 'rspec-rails', '~> 4.0.0'
97
- gem 'rails-controller-testing'
92
+ gem "rspec-rails", "~> 4.0.0"
93
+ gem "rails-controller-testing"
98
94
  # Adds support for Capybara system testing and selenium driver
99
- gem 'capybara', '>= 2.15'
100
- gem 'selenium-webdriver'
95
+ gem "capybara", ">= 2.15"
96
+ gem "selenium-webdriver"
101
97
  # Easy installation and use of web drivers to run system tests with browsers
102
- gem 'webdrivers'
103
- gem 'fuubar'
104
- gem 'simplecov', require: false
105
- gem 'simplecov-cobertura'
106
- gem 'webmock'
107
- gem 'spring-commands-rspec'
108
-
109
- gem 'test-prof'
98
+ gem "webdrivers"
99
+ gem "fuubar"
100
+ gem "simplecov", require: false
101
+ gem "simplecov-cobertura"
102
+ gem "webmock"
103
+ gem "spring-commands-rspec"
104
+
105
+ gem "test-prof"
110
106
  end
111
107
 
112
- gem 'zeitwerk', '~> 2.3'
108
+ gem "zeitwerk", "~> 2.3"
113
109
 
114
110
  # Pagination
115
- gem 'pagy'
111
+ gem "pagy"
116
112
 
117
- gem 'httparty'
113
+ gem "httparty"
118
114
 
119
- gem 'iso'
115
+ gem "iso"
120
116
 
121
- gem 'hotwire-rails'
117
+ gem "hotwire-rails"
122
118
 
123
- gem 'active_link_to'
119
+ gem "active_link_to"
124
120
 
125
- gem 'view_component', require: 'view_component/engine'
121
+ gem "view_component", require: "view_component/engine"
126
122
 
127
- gem 'addressable'
123
+ gem "addressable"
data/Gemfile.lock CHANGED
@@ -1,14 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (0.5.0.beta8)
4
+ avo (0.5.0.beta13)
5
5
  active_link_to
6
6
  addressable
7
7
  countries
8
8
  hotwire-rails
9
9
  httparty
10
10
  image_processing
11
- inline_svg
12
11
  pagy
13
12
  pundit
14
13
  rails (>= 6.0)
@@ -148,9 +147,6 @@ GEM
148
147
  image_processing (1.12.1)
149
148
  mini_magick (>= 4.9.5, < 5)
150
149
  ruby-vips (>= 2.0.17, < 3)
151
- inline_svg (1.7.2)
152
- activesupport (>= 3.0)
153
- nokogiri (>= 1.6)
154
150
  iso (0.3.0)
155
151
  i18n
156
152
  jbuilder (2.10.1)
@@ -341,7 +337,7 @@ GEM
341
337
  addressable (>= 2.3.6)
342
338
  crack (>= 0.3.2)
343
339
  hashdiff (>= 0.4.0, < 2.0.0)
344
- webpacker (6.0.0.beta.5)
340
+ webpacker (6.0.0.beta.6)
345
341
  activesupport (>= 5.2)
346
342
  rack-proxy (>= 0.6.1)
347
343
  railties (>= 5.2)
@@ -376,7 +372,6 @@ DEPENDENCIES
376
372
  hotwire-rails
377
373
  httparty
378
374
  image_processing (~> 1.2)
379
- inline_svg
380
375
  iso
381
376
  jbuilder (~> 2.7)
382
377
  listen (>= 3.0.5, < 3.2)
@@ -401,7 +396,7 @@ DEPENDENCIES
401
396
  web-console (>= 3.3.0)
402
397
  webdrivers
403
398
  webmock
404
- webpacker (= 6.0.0.beta.5)
399
+ webpacker (= 6.0.0.beta.6)
405
400
  zeitwerk (~> 2.3)
406
401
 
407
402
  BUNDLED WITH
data/Rakefile CHANGED
@@ -1,31 +1,31 @@
1
1
  begin
2
- require 'bundler/setup'
2
+ require "bundler/setup"
3
3
  rescue LoadError
4
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
4
+ puts "You must `gem install bundler` and `bundle install` to run rake tasks"
5
5
  end
6
6
 
7
- require 'rdoc/task'
7
+ require "rdoc/task"
8
8
 
9
9
  RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'Avo'
12
- rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.md')
14
- rdoc.rdoc_files.include('lib/**/*.rb')
10
+ rdoc.rdoc_dir = "rdoc"
11
+ rdoc.title = "Avo"
12
+ rdoc.options << "--line-numbers"
13
+ rdoc.rdoc_files.include("README.md")
14
+ rdoc.rdoc_files.include("lib/**/*.rb")
15
15
  end
16
16
 
17
17
  APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
18
- load 'rails/tasks/engine.rake'
18
+ load "rails/tasks/engine.rake"
19
19
 
20
- load 'rails/tasks/statistics.rake'
20
+ load "rails/tasks/statistics.rake"
21
21
 
22
- require 'bundler/gem_tasks'
22
+ require "bundler/gem_tasks"
23
23
 
24
- require 'rake/testtask'
24
+ require "rake/testtask"
25
25
 
26
26
  Rake::TestTask.new(:test) do |t|
27
- t.libs << 'test'
28
- t.pattern = 'test/**/*_test.rb'
27
+ t.libs << "test"
28
+ t.pattern = "test/**/*_test.rb"
29
29
  t.verbose = false
30
30
  end
31
31
 
@@ -3,7 +3,7 @@
3
3
  class Avo::Common::MultipleFileViewerComponent < ViewComponent::Base
4
4
  include Avo::ApplicationHelper
5
5
 
6
- def initialize(id:, file:, is_image:, button_size: :md, resource:)
6
+ def initialize(id:, file:, is_image:, resource:, button_size: :md)
7
7
  @id = id
8
8
  @file = file
9
9
  @is_image = is_image
@@ -3,7 +3,7 @@
3
3
  class Avo::Common::SingleFileViewerComponent < ViewComponent::Base
4
4
  include Avo::ApplicationHelper
5
5
 
6
- def initialize(id:, file:, is_image:, button_size: :md, resource:)
6
+ def initialize(id:, file:, is_image:, resource:, button_size: :md)
7
7
  @id = id
8
8
  @file = file
9
9
  @is_image = is_image
@@ -4,7 +4,7 @@ class Avo::Edit::FieldWrapperComponent < ViewComponent::Base
4
4
  def initialize(field: nil, dash_if_blank: true, full_width: false, displayed_in_modal: false, form: nil, resource: {}, **args)
5
5
  @field = field
6
6
  @dash_if_blank = dash_if_blank
7
- @classes = args[:class].present? ? args[:class] : ''
7
+ @classes = args[:class].present? ? args[:class] : ""
8
8
  @args = args
9
9
  @displayed_in_modal = displayed_in_modal
10
10
  @form = form
@@ -12,8 +12,8 @@ class Avo::Edit::FieldWrapperComponent < ViewComponent::Base
12
12
  @model = resource.present? ? resource.model : nil
13
13
  @full_width = full_width
14
14
 
15
- if @index != 0 or @displayed_in_modal
16
- @classes += ' border-t'
15
+ if (@index != 0) || @displayed_in_modal
16
+ @classes += " border-t"
17
17
  end
18
18
  end
19
19
  end
@@ -1,6 +1,6 @@
1
1
  <%= edit_field_wrapper field: @field, index: @index, form: @form, resource: @resource, displayed_in_modal: @displayed_in_modal do %>
2
2
  <% trix_id = "trix_#{@resource.name.underscore}_#{@field.id}" %>
3
- <trix-editor input="<%= trix_id %>" value="<%= @field.id %>" placeholder="<%= @field.placeholder %>"></trix-editor>
3
+ <trix-editor input="<%= trix_id %>" value="<%= @field.value %>" placeholder="<%= @field.placeholder %>"><%== @field.value %></trix-editor>
4
4
  <%= @form.text_area @field.id,
5
5
  id: trix_id,
6
6
  class: helpers.input_classes('w-full hidden', has_error: (@resource.model.present? and @resource.model.errors.include?(@field.id))),
@@ -4,7 +4,7 @@ class Avo::Index::FieldWrapperComponent < ViewComponent::Base
4
4
  def initialize(field: nil, dash_if_blank: true, **args)
5
5
  @field = field
6
6
  @dash_if_blank = dash_if_blank
7
- @classes = args[:class].present? ? args[:class] : ''
7
+ @classes = args[:class].present? ? args[:class] : ""
8
8
  @args = args
9
9
  end
10
10
  end
@@ -11,15 +11,16 @@ class Avo::Index::GridItemComponent < ViewComponent::Base
11
11
  end
12
12
 
13
13
  private
14
- def cover
15
- @grid_fields.cover_field
16
- end
17
14
 
18
- def title
19
- @grid_fields.title_field
20
- end
15
+ def cover
16
+ @grid_fields.cover_field
17
+ end
18
+
19
+ def title
20
+ @grid_fields.title_field
21
+ end
21
22
 
22
- def body
23
- @grid_fields.body_field
24
- end
23
+ def body
24
+ @grid_fields.body_field
25
+ end
25
26
  end
@@ -9,8 +9,8 @@ class Avo::Index::ResourceControlsComponent < Avo::ResourceComponent
9
9
 
10
10
  def can_detach?
11
11
  @reflection.present? &&
12
- @resource.model.present? &&
13
- (@reflection.is_a?(::ActiveRecord::Reflection::HasManyReflection) || @reflection.is_a?(::ActiveRecord::Reflection::ThroughReflection))
12
+ @resource.model.present? &&
13
+ (@reflection.is_a?(::ActiveRecord::Reflection::HasManyReflection) || @reflection.is_a?(::ActiveRecord::Reflection::ThroughReflection))
14
14
  end
15
15
 
16
16
  def can_edit?
@@ -10,11 +10,12 @@ class Avo::PanelComponent < ViewComponent::Base
10
10
  end
11
11
 
12
12
  private
13
- def data_attributes
14
- return if @data.blank?
15
13
 
16
- @data.map do |key, value|
17
- " data-#{key}=\"#{value}\""
18
- end.join
19
- end
14
+ def data_attributes
15
+ return if @data.blank?
16
+
17
+ @data.map do |key, value|
18
+ " data-#{key}=\"#{value}\""
19
+ end.join
20
+ end
20
21
  end
@@ -8,7 +8,8 @@ class Avo::ResourceComponent < ViewComponent::Base
8
8
  end
9
9
 
10
10
  private
11
- def simple_relation?
12
- @reflection.is_a? ::ActiveRecord::Reflection::HasManyReflection
13
- end
11
+
12
+ def simple_relation?
13
+ @reflection.is_a? ::ActiveRecord::Reflection::HasManyReflection
14
+ end
14
15
  end
@@ -4,12 +4,12 @@ class Avo::Show::FieldWrapperComponent < ViewComponent::Base
4
4
  def initialize(field: nil, dash_if_blank: true, full_width: false, **args)
5
5
  @field = field
6
6
  @dash_if_blank = dash_if_blank
7
- @classes = args[:class].present? ? args[:class] : ''
7
+ @classes = args[:class].present? ? args[:class] : ""
8
8
  @args = args
9
9
  @full_width = full_width
10
10
 
11
- if @index != 0 or @displayed_in_modal
12
- @classes += ' border-t'
11
+ if (@index != 0) || @displayed_in_modal
12
+ @classes += " border-t"
13
13
  end
14
14
  end
15
15
  end
@@ -17,7 +17,8 @@ class Avo::Views::ResourceEditComponent < ViewComponent::Base
17
17
  end
18
18
 
19
19
  private
20
- def via_resource?
21
- params[:via_resource_class].present? and params[:via_resource_id].present?
22
- end
20
+
21
+ def via_resource?
22
+ params[:via_resource_class].present? && params[:via_resource_id].present?
23
+ end
23
24
  end
@@ -13,7 +13,7 @@ class Avo::Views::ResourceIndexComponent < Avo::ResourceComponent
13
13
  filters: [],
14
14
  actions: [],
15
15
  reflection: nil,
16
- turbo_frame: '',
16
+ turbo_frame: "",
17
17
  parent_model: nil
18
18
  )
19
19
  @resource = resource
@@ -63,7 +63,7 @@ class Avo::Views::ResourceIndexComponent < Avo::ResourceComponent
63
63
  if @reflection.present?
64
64
  path_args = {
65
65
  via_relation_class: @parent_model.model_name,
66
- via_resource_id: @parent_model.id,
66
+ via_resource_id: @parent_model.id
67
67
  }
68
68
 
69
69
  if @reflection.inverse_of.present?
@@ -77,7 +77,7 @@ class Avo::Views::ResourceIndexComponent < Avo::ResourceComponent
77
77
  end
78
78
 
79
79
  def attach_path
80
- "#{Avo.configuration.root_path}#{request.env['PATH_INFO']}/new"
80
+ "#{Avo.configuration.root_path}#{request.env["PATH_INFO"]}/new"
81
81
  end
82
82
 
83
83
  def detach_path
@@ -85,9 +85,10 @@ class Avo::Views::ResourceIndexComponent < Avo::ResourceComponent
85
85
  end
86
86
 
87
87
  private
88
- def simple_relation?
89
- return @reflection.is_a? ::ActiveRecord::Reflection::HasManyReflection if @reflection.present?
90
88
 
91
- true
92
- end
89
+ def simple_relation?
90
+ return @reflection.is_a? ::ActiveRecord::Reflection::HasManyReflection if @reflection.present?
91
+
92
+ true
93
+ end
93
94
  end