avo 0.5.0.beta9 → 0.5.0.beta14

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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +46 -50
  3. data/Gemfile.lock +1 -6
  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/index/field_wrapper_component.rb +1 -1
  9. data/app/components/avo/index/grid_item_component.rb +10 -9
  10. data/app/components/avo/index/resource_controls_component.rb +2 -2
  11. data/app/components/avo/panel_component.rb +7 -6
  12. data/app/components/avo/resource_component.rb +4 -3
  13. data/app/components/avo/show/field_wrapper_component.rb +3 -3
  14. data/app/components/avo/views/resource_edit_component.rb +4 -3
  15. data/app/components/avo/views/resource_index_component.rb +8 -7
  16. data/app/components/avo/views/resource_new_component.rb +4 -3
  17. data/app/components/avo/views/resource_show_component.rb +21 -21
  18. data/app/controllers/avo/actions_controller.rb +30 -29
  19. data/app/controllers/avo/application_controller.rb +113 -126
  20. data/app/controllers/avo/attachments_controller.rb +3 -3
  21. data/app/controllers/avo/base_controller.rb +81 -80
  22. data/app/controllers/avo/home_controller.rb +2 -2
  23. data/app/controllers/avo/relations_controller.rb +29 -28
  24. data/app/controllers/avo/resources_controller.rb +1 -1
  25. data/app/controllers/avo/search_controller.rb +20 -19
  26. data/app/helpers/avo/application_helper.rb +48 -42
  27. data/app/helpers/avo/resources_helper.rb +11 -11
  28. data/app/mailers/avo/application_mailer.rb +2 -2
  29. data/app/packs/entrypoints/application.js +9 -7
  30. data/app/packs/images/logo.png +0 -0
  31. data/app/packs/js/controllers/fields/code_field_controller.js +14 -14
  32. data/app/packs/js/controllers/filter_controller.js +9 -8
  33. data/app/packs/js/toastr.js +1 -0
  34. data/avo.gemspec +30 -31
  35. data/config/initializers/pagy.rb +1 -1
  36. data/config/routes.rb +12 -12
  37. data/config/spring.rb +5 -5
  38. data/config/webpack/base.js +2 -2
  39. data/config/webpacker.yml +32 -0
  40. data/db/factories.rb +3 -5
  41. data/lib/avo.rb +6 -6
  42. data/lib/avo/app.rb +18 -18
  43. data/lib/avo/base_action.rb +20 -20
  44. data/lib/avo/base_resource.rb +41 -45
  45. data/lib/avo/configuration.rb +16 -18
  46. data/lib/avo/engine.rb +18 -18
  47. data/lib/avo/fields/badge_field.rb +2 -2
  48. data/lib/avo/fields/base_field.rb +25 -26
  49. data/lib/avo/fields/belongs_to_field.rb +13 -12
  50. data/lib/avo/fields/boolean_field.rb +4 -4
  51. data/lib/avo/fields/boolean_group_field.rb +3 -3
  52. data/lib/avo/fields/code_field.rb +4 -4
  53. data/lib/avo/fields/country_field.rb +2 -2
  54. data/lib/avo/fields/currency_field.rb +3 -3
  55. data/lib/avo/fields/date_field.rb +3 -3
  56. data/lib/avo/fields/date_time_field.rb +2 -2
  57. data/lib/avo/fields/external_image_field.rb +2 -2
  58. data/lib/avo/fields/field_extensions/has_field_name.rb +2 -2
  59. data/lib/avo/fields/field_extensions/visible_in_different_views.rb +34 -33
  60. data/lib/avo/fields/file_field.rb +1 -1
  61. data/lib/avo/fields/files_field.rb +2 -2
  62. data/lib/avo/fields/gravatar_field.rb +9 -9
  63. data/lib/avo/fields/has_and_belongs_to_many_field.rb +1 -1
  64. data/lib/avo/fields/has_many_field.rb +1 -1
  65. data/lib/avo/fields/has_one_field.rb +2 -2
  66. data/lib/avo/fields/heading_field.rb +2 -2
  67. data/lib/avo/fields/hidden_field.rb +1 -1
  68. data/lib/avo/fields/id_field.rb +3 -3
  69. data/lib/avo/fields/key_value_field.rb +12 -12
  70. data/lib/avo/fields/markdown_field.rb +2 -2
  71. data/lib/avo/fields/number_field.rb +3 -3
  72. data/lib/avo/fields/password_field.rb +1 -1
  73. data/lib/avo/fields/select_field.rb +8 -12
  74. data/lib/avo/fields/status_field.rb +4 -4
  75. data/lib/avo/fields/text_field.rb +2 -2
  76. data/lib/avo/fields/textarea_field.rb +2 -2
  77. data/lib/avo/fields/trix_field.rb +1 -1
  78. data/lib/avo/fields_collector.rb +4 -5
  79. data/lib/avo/filters/base_filter.rb +6 -6
  80. data/lib/avo/filters/boolean_filter.rb +1 -1
  81. data/lib/avo/filters/select_filter.rb +1 -1
  82. data/lib/avo/licensing/h_q.rb +56 -55
  83. data/lib/avo/licensing/license.rb +5 -5
  84. data/lib/avo/licensing/license_manager.rb +4 -4
  85. data/lib/avo/licensing/null_license.rb +2 -2
  86. data/lib/avo/licensing/pro_license.rb +1 -1
  87. data/lib/avo/loaders/fields_loader.rb +4 -4
  88. data/lib/avo/services/authorization_service.rb +2 -2
  89. data/lib/avo/services/panel_service.rb +4 -4
  90. data/lib/avo/version.rb +1 -1
  91. data/lib/generators/avo/action_generator.rb +4 -4
  92. data/lib/generators/avo/controller_generator.rb +4 -4
  93. data/lib/generators/avo/filter_generator.rb +5 -5
  94. data/lib/generators/avo/install_generator.rb +8 -8
  95. data/lib/generators/avo/locales_generator.rb +5 -5
  96. data/lib/generators/avo/partials_generator.rb +4 -4
  97. data/lib/generators/avo/resource_generator.rb +5 -5
  98. data/lib/generators/avo/templates/action.tt +0 -4
  99. data/lib/generators/avo/templates/resource/resource.tt +3 -13
  100. data/lib/tasks/avo_tasks.rake +0 -60
  101. data/public/avo-packs/css/{application-38e7e91b.css → application-9d115b7e.css} +44 -147
  102. data/public/avo-packs/css/application-9d115b7e.css.br +0 -0
  103. data/public/avo-packs/css/application-9d115b7e.css.gz +0 -0
  104. data/public/avo-packs/css/application-9d115b7e.css.map +1 -0
  105. data/public/avo-packs/css/application-9d115b7e.css.map.br +0 -0
  106. data/public/avo-packs/css/application-9d115b7e.css.map.gz +0 -0
  107. data/public/avo-packs/js/{application-2b90fe889f7d6df1ad92.js → application-4751feac1bb0404b9c47.js} +4 -4
  108. data/public/avo-packs/js/{application-2b90fe889f7d6df1ad92.js.LICENSE.txt → application-4751feac1bb0404b9c47.js.LICENSE.txt} +0 -0
  109. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.br +0 -0
  110. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.gz +0 -0
  111. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.map +1 -0
  112. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.map.br +0 -0
  113. data/public/avo-packs/js/application-4751feac1bb0404b9c47.js.map.gz +0 -0
  114. data/public/avo-packs/manifest.json +16 -16
  115. data/public/avo-packs/media/images/dadf2db36589607d107d.png +0 -0
  116. metadata +16 -31
  117. data/config/initializers/inline_svg.rb +0 -33
  118. data/public/avo-packs/css/application-38e7e91b.css.br +0 -0
  119. data/public/avo-packs/css/application-38e7e91b.css.gz +0 -0
  120. data/public/avo-packs/css/application-38e7e91b.css.map +0 -1
  121. data/public/avo-packs/css/application-38e7e91b.css.map.br +0 -0
  122. data/public/avo-packs/css/application-38e7e91b.css.map.gz +0 -0
  123. data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js.br +0 -0
  124. data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js.gz +0 -0
  125. data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js.map +0 -1
  126. data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js.map.br +0 -0
  127. data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js.map.gz +0 -0
  128. 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: fd4edf66c902806aea55c609cf7265acc8d3242704c3f81f688c804357034343
4
- data.tar.gz: f8ccf103ffbb145d5b5263105ba24329290e6d005c28ff7c9c3371a96fedf0d0
3
+ metadata.gz: 839449acaf247c7135ea8d6a80a6c163d86059f632d1c3ae40a03390be46c29d
4
+ data.tar.gz: a79e5d8d4d58b1c61e0a7c0a6738a5492e348a6e22049aebf7dc7886c67cb117
5
5
  SHA512:
6
- metadata.gz: b4ac9daac031f9e81cf5e4bd19797e3e811cbe6b629aff1cefd069b906b7952561798fc4301cd929a2a973678ad889393c058983bc494e6d3e40d37a9d5b3651
7
- data.tar.gz: bb58f96475ccf2d3c719fa1b6292a9f76f71c95186fa357e7703963b160d0d9d2e3cf80da8f4355af6a9f48a9930d0c437e8e62d4a580695ba6933a7198bcb7c
6
+ metadata.gz: b632623b228c41ceca6b253d1a0df8829a12572227f40d71740975c8692b8c406e5a4437be28a7223c271fce9b6629ffa927e357feb7d8189cae459bde1f0524
7
+ data.tar.gz: a37d1c79eee1ba3975f72598ba04e8d89835ad98d6be96a0f32b70ff49ec3a4a553508c5f1abff1e9a34831fc38c9db330713935e62b2c4475f5e4bc01b79398
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.6'
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.beta9)
4
+ avo (0.5.0.beta14)
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)
@@ -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)
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
@@ -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