avo 0.5.0.beta7 → 0.5.0.beta8

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 (203) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -2
  3. data/Gemfile.lock +28 -18
  4. data/app/components/avo/common/badge_viewer_component.html.erb +1 -1
  5. data/app/components/avo/common/gravatar_viewer_component.html.erb +2 -2
  6. data/app/components/avo/common/gravatar_viewer_component.rb +2 -1
  7. data/app/components/avo/edit/fields/trix_field_component.html.erb +1 -1
  8. data/app/components/avo/index/field_wrapper_component.html.erb +1 -1
  9. data/app/components/avo/index/fields/belongs_to_field_component.html.erb +1 -5
  10. data/app/components/avo/index/fields/boolean_group_field_component.html.erb +1 -1
  11. data/app/components/avo/index/fields/gravatar_field_component.html.erb +2 -1
  12. data/app/components/avo/index/fields/has_one_field_component.html.erb +1 -5
  13. data/app/components/avo/index/fields/id_field_component.html.erb +1 -1
  14. data/app/components/avo/index/grid_item_component.html.erb +2 -2
  15. data/app/components/avo/index/grid_item_component.rb +3 -3
  16. data/app/components/avo/index/resource_controls_component.html.erb +12 -4
  17. data/app/components/avo/show/field_wrapper_component.html.erb +1 -1
  18. data/app/components/avo/show/fields/boolean_group_field_component.html.erb +1 -1
  19. data/app/components/avo/show/fields/external_image_field_component.html.erb +1 -1
  20. data/app/components/avo/views/resource_show_component.html.erb +14 -2
  21. data/app/controllers/avo/actions_controller.rb +5 -4
  22. data/app/controllers/avo/application_controller.rb +18 -2
  23. data/app/controllers/avo/base_controller.rb +5 -8
  24. data/app/controllers/avo/relations_controller.rb +1 -1
  25. data/app/helpers/avo/application_helper.rb +1 -1
  26. data/app/{frontend/css → packs/entrypoints}/application.css +12 -11
  27. data/app/{frontend/packs → packs/entrypoints}/application.js +3 -2
  28. data/app/{frontend → packs}/fonts/nunito-v16-latin-700.eot +0 -0
  29. data/app/{frontend → packs}/fonts/nunito-v16-latin-700.svg +0 -0
  30. data/app/{frontend → packs}/fonts/nunito-v16-latin-700.ttf +0 -0
  31. data/app/{frontend → packs}/fonts/nunito-v16-latin-700.woff +0 -0
  32. data/app/{frontend → packs}/fonts/nunito-v16-latin-700.woff2 +0 -0
  33. data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.eot +0 -0
  34. data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.svg +0 -0
  35. data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.ttf +0 -0
  36. data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.woff +0 -0
  37. data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.woff2 +0 -0
  38. data/app/{frontend → packs}/images/logo.png +0 -0
  39. data/app/{frontend → packs}/importmap.json.erb +0 -0
  40. data/app/{frontend → packs}/js/controllers/action_controller.js +0 -0
  41. data/app/{frontend → packs}/js/controllers/actions_picker_controller.js +0 -0
  42. data/app/{frontend → packs}/js/controllers/alerts_controller.js +0 -0
  43. data/app/{frontend → packs}/js/controllers/attachments_controller.js +0 -0
  44. data/app/{frontend → packs}/js/controllers/boolean_filter_controller.js +0 -0
  45. data/app/{frontend → packs}/js/controllers/fields/code_field_controller.js +0 -0
  46. data/app/{frontend → packs}/js/controllers/fields/date_field_controller.js +0 -0
  47. data/app/{frontend → packs}/js/controllers/fields/simple_mde_controller.js +0 -0
  48. data/app/{frontend → packs}/js/controllers/filter_controller.js +19 -3
  49. data/app/{frontend → packs}/js/controllers/hidden_input_controller.js +0 -0
  50. data/app/{frontend → packs}/js/controllers/item_selector_controller.js +0 -0
  51. data/app/{frontend → packs}/js/controllers/modal_controller.js +0 -0
  52. data/app/{frontend → packs}/js/controllers/per_page_controller.js +5 -1
  53. data/app/{frontend → packs}/js/controllers/select_filter_controller.js +0 -0
  54. data/app/{frontend → packs}/js/controllers/tippy_controller.js +0 -0
  55. data/app/{frontend → packs}/js/controllers/toggle_panel_controller.js +0 -0
  56. data/app/{frontend → packs}/js/helpers/cast_boolean.js +0 -0
  57. data/app/{frontend → packs}/js/toastr.js +0 -0
  58. data/app/{frontend/css → packs/stylesheets}/alerts.css +0 -0
  59. data/app/{frontend/css → packs/stylesheets}/components/code.css +0 -0
  60. data/app/{frontend/css → packs/stylesheets}/components/status.css +0 -0
  61. data/app/{frontend/css → packs/stylesheets}/fonts.css +0 -0
  62. data/app/{frontend/css → packs/stylesheets}/loader.css +0 -0
  63. data/app/{frontend/css → packs/stylesheets}/pagination.css +0 -0
  64. data/app/{frontend/css → packs/stylesheets}/tailwindcss/base.css +0 -0
  65. data/app/{frontend/css → packs/stylesheets}/tailwindcss/components.css +0 -0
  66. data/app/{frontend/css → packs/stylesheets}/tailwindcss/utilities.css +0 -0
  67. data/app/{frontend/css → packs/stylesheets}/tooltips.css +0 -0
  68. data/app/{frontend/css → packs/stylesheets}/typography.css +0 -0
  69. data/app/{frontend → packs}/svgs/arrow-circle-right.svg +0 -0
  70. data/app/{frontend → packs}/svgs/arrow-left.svg +0 -0
  71. data/app/{frontend → packs}/svgs/avocado.svg +0 -0
  72. data/app/{frontend → packs}/svgs/badge-check-sm.svg +0 -0
  73. data/app/{frontend → packs}/svgs/check-circle.svg +0 -0
  74. data/app/{frontend → packs}/svgs/chevron-down.svg +0 -0
  75. data/app/{frontend → packs}/svgs/chevron-up.svg +0 -0
  76. data/app/{frontend → packs}/svgs/code.svg +0 -0
  77. data/app/{frontend → packs}/svgs/color-swatch.svg +0 -0
  78. data/app/{frontend → packs}/svgs/document-text.svg +0 -0
  79. data/app/{frontend → packs}/svgs/download.svg +0 -0
  80. data/app/{frontend → packs}/svgs/edit.svg +0 -0
  81. data/app/{frontend → packs}/svgs/exclamation-circle-sm.svg +0 -0
  82. data/app/{frontend → packs}/svgs/exclamation-sm.svg +0 -0
  83. data/app/{frontend → packs}/svgs/exclamation.svg +0 -0
  84. data/app/{frontend → packs}/svgs/eye.svg +0 -0
  85. data/app/{frontend → packs}/svgs/filter.svg +0 -0
  86. data/app/{frontend → packs}/svgs/fire.svg +0 -0
  87. data/app/{frontend → packs}/svgs/game-board.svg +0 -0
  88. data/app/{frontend → packs}/svgs/globe.svg +0 -0
  89. data/app/{frontend → packs}/svgs/information-circle-sm.svg +0 -0
  90. data/app/{frontend → packs}/svgs/information-circle.svg +0 -0
  91. data/app/{frontend → packs}/svgs/library.svg +0 -0
  92. data/app/{frontend → packs}/svgs/photograph.svg +0 -0
  93. data/app/{frontend → packs}/svgs/play.svg +0 -0
  94. data/app/{frontend → packs}/svgs/plus-circle.svg +0 -0
  95. data/app/{frontend → packs}/svgs/plus.svg +0 -0
  96. data/app/{frontend → packs}/svgs/question-mark-circle.svg +0 -0
  97. data/app/{frontend → packs}/svgs/save.svg +0 -0
  98. data/app/{frontend → packs}/svgs/selector.svg +0 -0
  99. data/app/{frontend → packs}/svgs/sort-ascending.svg +0 -0
  100. data/app/{frontend → packs}/svgs/sort-descending.svg +0 -0
  101. data/app/{frontend → packs}/svgs/switch-horizontal.svg +0 -0
  102. data/app/{frontend → packs}/svgs/thumbs-down.svg +0 -0
  103. data/app/{frontend → packs}/svgs/thumbs-up.svg +0 -0
  104. data/app/{frontend → packs}/svgs/times.svg +0 -0
  105. data/app/{frontend → packs}/svgs/trash-sm.svg +0 -0
  106. data/app/{frontend → packs}/svgs/trash.svg +0 -0
  107. data/app/{frontend → packs}/svgs/view-grid-add.svg +0 -0
  108. data/app/{frontend → packs}/svgs/view-grid.svg +0 -0
  109. data/app/{frontend → packs}/svgs/view-list.svg +0 -0
  110. data/app/{frontend → packs}/svgs/x-circle.svg +0 -0
  111. data/app/views/avo/actions/show.html.erb +3 -39
  112. data/app/views/avo/attachments/show.html.erb +8 -1
  113. data/app/views/avo/base/_boolean_filter.html.erb +1 -0
  114. data/app/views/avo/base/_filters.html.erb +1 -0
  115. data/app/views/avo/base/_select_filter.html.erb +1 -0
  116. data/app/views/avo/partials/_paginator.html.erb +24 -5
  117. data/app/views/avo/relations/new.html.erb +5 -1
  118. data/app/views/layouts/avo/application.html.erb +0 -5
  119. data/avo.gemspec +1 -0
  120. data/bin/helpers.rb +0 -0
  121. data/bin/rspec +1 -0
  122. data/bin/webpack +2 -1
  123. data/config/webpack/aliases.js +1 -1
  124. data/config/webpack/base.js +14 -0
  125. data/config/webpack/development.js +2 -2
  126. data/config/webpack/production.js +2 -2
  127. data/config/webpack/test.js +2 -2
  128. data/config/webpacker.yml +5 -44
  129. data/db/factories.rb +1 -0
  130. data/lib/avo/action_model.rb +20 -0
  131. data/lib/avo/app.rb +0 -42
  132. data/lib/avo/base_action.rb +40 -37
  133. data/lib/avo/base_resource.rb +26 -51
  134. data/lib/avo/configuration.rb +0 -4
  135. data/lib/avo/engine.rb +16 -0
  136. data/lib/avo/fields/base_field.rb +19 -9
  137. data/lib/avo/fields/field_extensions/has_field_name.rb +2 -9
  138. data/lib/avo/fields/gravatar_field.rb +1 -1
  139. data/lib/avo/fields_collector.rb +31 -0
  140. data/lib/avo/grid_collector.rb +39 -0
  141. data/lib/avo/has_context.rb +7 -0
  142. data/lib/avo/version.rb +1 -1
  143. data/lib/generators/avo/templates/action.tt +2 -2
  144. data/public/avo-packs/css/application-5bb09ba4.css +6024 -0
  145. data/public/avo-packs/css/application-5bb09ba4.css.br +0 -0
  146. data/public/avo-packs/css/application-5bb09ba4.css.gz +0 -0
  147. data/public/avo-packs/css/application-5bb09ba4.css.map +1 -0
  148. data/public/avo-packs/css/application-5bb09ba4.css.map.br +0 -0
  149. data/public/avo-packs/css/application-5bb09ba4.css.map.gz +0 -0
  150. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js +2 -0
  151. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.br +0 -0
  152. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.gz +0 -0
  153. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.map +1 -0
  154. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.map.br +0 -0
  155. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.map.gz +0 -0
  156. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js +26 -0
  157. data/public/avo-packs/js/{application-8849c6e2c8f75d55c666.js.LICENSE.txt → application-86a3ea5a835b0c758203.js.LICENSE.txt} +17 -17
  158. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.br +0 -0
  159. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.gz +0 -0
  160. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map +1 -0
  161. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map.br +0 -0
  162. data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map.gz +0 -0
  163. data/public/avo-packs/manifest.json +46 -23
  164. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg → images/13ae283c0d7cc04efe7e.svg} +0 -0
  165. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg.br → images/13ae283c0d7cc04efe7e.svg.br} +0 -0
  166. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg.gz → images/13ae283c0d7cc04efe7e.svg.gz} +0 -0
  167. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg → images/195026a50008c53526ef.svg} +0 -0
  168. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg.br → images/195026a50008c53526ef.svg.br} +0 -0
  169. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg.gz → images/195026a50008c53526ef.svg.gz} +0 -0
  170. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-cb632c9fe211ba2c2bf1564c9a9295cc.woff → images/1f30e08faa7c60d1f7ac.woff} +0 -0
  171. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf → images/1fd17dabf6b7d2b15348.ttf} +0 -0
  172. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf.br → images/1fd17dabf6b7d2b15348.ttf.br} +0 -0
  173. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf.gz → images/1fd17dabf6b7d2b15348.ttf.gz} +0 -0
  174. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-bcf84d6cb8a0ac214c8c14ba9af834f3.woff2 → images/39a18f443d434999b89b.woff2} +0 -0
  175. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-412073df419ad5f6f8f2ea76eb4aced9.woff2 → images/4ad349571e28bb59c5a5.woff2} +0 -0
  176. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-2fae1e2418251b68fe5d0505ab93dd5c.eot → images/57a5470848663767abbf.eot} +0 -0
  177. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf → images/b2e4cf0fab6c8ca66b7f.ttf} +0 -0
  178. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf.br → images/b2e4cf0fab6c8ca66b7f.ttf.br} +0 -0
  179. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf.gz → images/b2e4cf0fab6c8ca66b7f.ttf.gz} +0 -0
  180. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-df7e79af617f98cd3b95d320e8b2a1af.eot → images/b78d61ab7e046de8c156.eot} +0 -0
  181. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-7c472b19cb573f537bad8ef62ca917ac.woff → images/c9ab29becb76ddab01d0.woff} +0 -0
  182. data/public/avo-packs/media/images/{logo-edf8d8d0d263e0c1f73bb32a222d9991.png → f1b4befac91a3336db9a.png} +0 -0
  183. metadata +144 -127
  184. data/app/views/layouts/avo/application_vue.html.erb +0 -61
  185. data/config/webpack/environment.js +0 -18
  186. data/db/migrate/20210305082639_add_url_to_teams.rb +0 -5
  187. data/public/avo-packs/css/application-c75ac28c.css +0 -6
  188. data/public/avo-packs/css/application-c75ac28c.css.br +0 -0
  189. data/public/avo-packs/css/application-c75ac28c.css.gz +0 -0
  190. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js +0 -2
  191. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.br +0 -0
  192. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.gz +0 -0
  193. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.map +0 -1
  194. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.map.br +0 -0
  195. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.map.gz +0 -0
  196. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js +0 -26
  197. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.br +0 -0
  198. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.gz +0 -0
  199. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.map +0 -1
  200. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.map.br +0 -0
  201. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.map.gz +0 -0
  202. data/public/avo-packs/manifest.json.br +0 -0
  203. data/public/avo-packs/manifest.json.gz +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48ae6c7207084645f7a7a14a462ebc7161f94801e100054d53f48722f758f9c2
4
- data.tar.gz: dcc5caabc807328ddd1c52c640d446d88d84c58f786b693d59455f1e7d251744
3
+ metadata.gz: 4f7f5a6a457f61e77abd2ac617061c042ead0eab1177a7d98b1ea3d3202db916
4
+ data.tar.gz: 0a999ae8588fea1973f91a601a00dda8c9eb6d3b4d05e34b55b39799d48659a3
5
5
  SHA512:
6
- metadata.gz: '038536c5cc11eeae399c9cbb59d366868bb3affe39592075c8852d65df49f1a362917a9e96861c804e807a6ed0e2cb39932e5bb82cb04d54b9830301a44b7056'
7
- data.tar.gz: b9d16aa4a175c5a43a0ec24059e4715febc755cea5b28be601b0b9fb22f9414881ec170b6ad9e1dbe2e51a77d6b8d5cae7e620d8d1d7dc95c4c01c988f9f09ca
6
+ metadata.gz: e64e3c0d8a17c6fab1b79d58fd6eb33e6d92cfc1c71a3aacf81892225a69451901c322d4770956e42bda36ada3de82f78a8cb5ee1e80a0996b1c9f86cda14143
7
+ data.tar.gz: db227187abcd8fd276d9e34152b725eb7b7ab2c4312bc305f3d2a09a56a79da654b0d80f31e55b67b2871ae29375c34094b0570b41a0147520e2c8398092c7c2
data/Gemfile CHANGED
@@ -15,7 +15,7 @@ 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', '~> 5.x'
18
+ gem 'webpacker', '6.0.0.beta.5'
19
19
 
20
20
  # SVGs
21
21
  gem 'inline_svg'
@@ -73,7 +73,7 @@ gem 'debase'
73
73
  #
74
74
 
75
75
  group :development do
76
- gem 'rubocop'
76
+ gem 'standard'
77
77
 
78
78
  # Release helper
79
79
  gem 'bump', require: false
@@ -123,3 +123,5 @@ gem 'hotwire-rails'
123
123
  gem 'active_link_to'
124
124
 
125
125
  gem 'view_component', require: 'view_component/engine'
126
+
127
+ gem 'addressable'
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (0.5.0.beta7)
4
+ avo (0.5.0.beta8)
5
5
  active_link_to
6
+ addressable
6
7
  countries
7
8
  hotwire-rails
8
9
  httparty
@@ -78,7 +79,7 @@ GEM
78
79
  zeitwerk (~> 2.2, >= 2.2.2)
79
80
  addressable (2.7.0)
80
81
  public_suffix (>= 2.0.2, < 5.0)
81
- ast (2.4.1)
82
+ ast (2.4.2)
82
83
  bcrypt (3.1.16)
83
84
  bindex (0.8.1)
84
85
  bootsnap (1.4.8)
@@ -169,7 +170,9 @@ GEM
169
170
  mime-types (3.3.1)
170
171
  mime-types-data (~> 3.2015)
171
172
  mime-types-data (3.2020.0512)
172
- mimemagic (0.3.5)
173
+ mimemagic (0.3.10)
174
+ nokogiri (~> 1)
175
+ rake
173
176
  mini_magick (4.11.0)
174
177
  mini_mime (1.0.2)
175
178
  mini_portile2 (2.5.0)
@@ -177,13 +180,13 @@ GEM
177
180
  msgpack (1.3.3)
178
181
  multi_xml (0.6.0)
179
182
  nio4r (2.5.5)
180
- nokogiri (1.11.1)
183
+ nokogiri (1.11.2)
181
184
  mini_portile2 (~> 2.5.0)
182
185
  racc (~> 1.4)
183
186
  orm_adapter (0.5.0)
184
187
  pagy (3.10.0)
185
- parallel (1.19.2)
186
- parser (2.7.1.5)
188
+ parallel (1.20.1)
189
+ parser (3.0.0.0)
187
190
  ast (~> 2.4.1)
188
191
  pg (1.2.3)
189
192
  public_suffix (4.0.6)
@@ -254,17 +257,20 @@ GEM
254
257
  rspec-mocks (~> 3.9)
255
258
  rspec-support (~> 3.9)
256
259
  rspec-support (3.9.3)
257
- rubocop (0.92.0)
260
+ rubocop (1.11.0)
258
261
  parallel (~> 1.10)
259
- parser (>= 2.7.1.5)
262
+ parser (>= 3.0.0.0)
260
263
  rainbow (>= 2.2.2, < 4.0)
261
- regexp_parser (>= 1.7)
264
+ regexp_parser (>= 1.8, < 3.0)
262
265
  rexml
263
- rubocop-ast (>= 0.5.0)
266
+ rubocop-ast (>= 1.2.0, < 2.0)
264
267
  ruby-progressbar (~> 1.7)
265
- unicode-display_width (>= 1.4.0, < 2.0)
266
- rubocop-ast (0.7.1)
268
+ unicode-display_width (>= 1.4.0, < 3.0)
269
+ rubocop-ast (1.4.1)
267
270
  parser (>= 2.7.1.5)
271
+ rubocop-performance (1.10.1)
272
+ rubocop (>= 0.90.0, < 2.0)
273
+ rubocop-ast (>= 0.4.0)
268
274
  ruby-debug-ide (0.7.2)
269
275
  rake (>= 0.8.1)
270
276
  ruby-progressbar (1.10.1)
@@ -285,7 +291,7 @@ GEM
285
291
  selenium-webdriver (3.142.7)
286
292
  childprocess (>= 0.5, < 4.0)
287
293
  rubyzip (>= 1.2.2)
288
- semantic_range (2.3.1)
294
+ semantic_range (3.0.0)
289
295
  simplecov (0.19.0)
290
296
  docile (~> 1.1)
291
297
  simplecov-html (~> 0.11)
@@ -303,6 +309,9 @@ GEM
303
309
  actionpack (>= 4.0)
304
310
  activesupport (>= 4.0)
305
311
  sprockets (>= 3.0.0)
312
+ standard (1.0.4)
313
+ rubocop (= 1.11.0)
314
+ rubocop-performance (= 1.10.1)
306
315
  stimulus-rails (0.2.3)
307
316
  rails (>= 6.0.0)
308
317
  test-prof (0.12.2)
@@ -313,9 +322,9 @@ GEM
313
322
  rails (>= 6.0.0)
314
323
  tzinfo (1.2.9)
315
324
  thread_safe (~> 0.1)
316
- unicode-display_width (1.7.0)
325
+ unicode-display_width (2.0.0)
317
326
  unicode_utils (1.4.0)
318
- view_component (2.24.0)
327
+ view_component (2.28.0)
319
328
  activesupport (>= 5.0.0, < 7.0)
320
329
  warden (1.2.9)
321
330
  rack (>= 2.0.9)
@@ -332,7 +341,7 @@ GEM
332
341
  addressable (>= 2.3.6)
333
342
  crack (>= 0.3.2)
334
343
  hashdiff (>= 0.4.0, < 2.0.0)
335
- webpacker (5.2.1)
344
+ webpacker (6.0.0.beta.5)
336
345
  activesupport (>= 5.2)
337
346
  rack-proxy (>= 0.6.1)
338
347
  railties (>= 5.2)
@@ -349,6 +358,7 @@ PLATFORMS
349
358
 
350
359
  DEPENDENCIES
351
360
  active_link_to
361
+ addressable
352
362
  avo!
353
363
  bootsnap (>= 1.4.2)
354
364
  bump
@@ -377,7 +387,6 @@ DEPENDENCIES
377
387
  rails (~> 6.0.2, >= 6.0.2.2)
378
388
  rails-controller-testing
379
389
  rspec-rails (~> 4.0.0)
380
- rubocop
381
390
  ruby-debug-ide
382
391
  sass-rails (>= 6)
383
392
  selenium-webdriver
@@ -385,13 +394,14 @@ DEPENDENCIES
385
394
  simplecov-cobertura
386
395
  spring
387
396
  spring-commands-rspec
397
+ standard
388
398
  test-prof
389
399
  tzinfo-data
390
400
  view_component
391
401
  web-console (>= 3.3.0)
392
402
  webdrivers
393
403
  webmock
394
- webpacker (~> 5.x)
404
+ webpacker (= 6.0.0.beta.5)
395
405
  zeitwerk (~> 2.3)
396
406
 
397
407
  BUNDLED WITH
@@ -17,7 +17,7 @@
17
17
  end
18
18
  end
19
19
 
20
- classes = 'whitespace-nowrap rounded-md uppercase px-2 py-1 text-xs font-bold text-black block text-center truncate '
20
+ classes = 'whitespace-nowrap rounded-md uppercase px-2 py-1 text-xs font-bold block text-center truncate '
21
21
 
22
22
  classes += "#{backgrounds[background]} text-white" if backgrounds[background].present?
23
23
  %>
@@ -6,7 +6,7 @@
6
6
  options[:default] = @default if @default.present?
7
7
  options[:size] = @size if @size.present?
8
8
  query = options.map { |key, value| "#{key}=#{value}" }.join('&')
9
- url = URI::HTTP.build(host: "www.gravatar.com", path: "/avatar/#{@md5}", query: query)
9
+ url = URI::HTTPS.build(host: "www.gravatar.com", path: "/avatar/#{@md5}", query: query)
10
10
  classes = @rounded ? 'min-w-10 rounded-full' : 'min-w-10'
11
11
  %>
12
- <%= link_to_if @link_to_resource.present?, image_tag(url.to_s, class: classes), @link %>
12
+ <%= link_to_if @link_to_resource.present?, image_tag(url.to_s, class: classes), @link, title: @title %>
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Avo::Common::GravatarViewerComponent < ViewComponent::Base
4
- def initialize(md5: nil, link: nil, default: nil, size: nil, rounded: false, link_to_resource: false)
4
+ def initialize(md5: nil, link: nil, default: nil, size: nil, rounded: false, link_to_resource: false, title: nil)
5
5
  @md5 = md5
6
6
  @link = link
7
7
  @default = default
8
8
  @size = size
9
9
  @rounded = rounded
10
10
  @link_to_resource = link_to_resource
11
+ @title = title
11
12
  end
12
13
  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 %>"></trix-editor>
3
+ <trix-editor input="<%= trix_id %>" value="<%= @field.id %>" placeholder="<%= @field.placeholder %>"></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))),
@@ -1,4 +1,4 @@
1
- <td class="px-4 py-2 leading-tight whitespace-nowrap h-12 text-blue-gray-800 <%= @classes %>" data-field-id="<%= @field.id %>">
1
+ <td class="px-4 py-2 leading-tight whitespace-nowrap h-12 text-blue-gray-800 <%= @classes %>" data-field-id="<%= @field.id %>" data-field-type="<%= @field.type %>">
2
2
  <% if @field.value.blank? && @dash_if_blank %>
3
3
 
4
4
  <% else %>
@@ -1,7 +1,3 @@
1
1
  <%= index_field_wrapper field: @field do %>
2
- <% if @field.value.present? %>
3
- <%= link_to @field.label, helpers.resource_path(@field.value) %>
4
- <% else %>
5
-
6
- <% end %>
2
+ <%= link_to @field.label, helpers.resource_path(@field.value) %>
7
3
  <% end %>
@@ -1,3 +1,3 @@
1
- <%= index_field_wrapper field: @field do %>
1
+ <%= index_field_wrapper field: @field, dash_if_blank: false do %>
2
2
  <%= render Avo::Common::BooleanGroupComponent.new options: @field.options, value: @field.value %>
3
3
  <% end %>
@@ -5,7 +5,8 @@
5
5
  size: @field.size,
6
6
  rounded: @field.rounded,
7
7
  link_to_resource: @field.link_to_resource,
8
- link: helpers.resource_path(@resource.model)
8
+ link: helpers.resource_path(@resource.model),
9
+ title: t('avo.view_item', { item: @resource.name}).humanize
9
10
  )
10
11
  %>
11
12
  <% end %>
@@ -1,7 +1,3 @@
1
1
  <%= index_field_wrapper field: @field do %>
2
- <% if @field.value.present? %>
3
- <%= link_to @field.label, helpers.resource_path(@field.value) %>
4
- <% else %>
5
-
6
- <% end %>
2
+ <%= link_to @field.label, helpers.resource_path(@field.value) %>
7
3
  <% end %>
@@ -6,5 +6,5 @@
6
6
  path = helpers.resource_path(@resource.model)
7
7
  end
8
8
  %>
9
- <% link_to_if (@field.link_to_resource or Avo.configuration.id_links_to_resource), @field.value, path %>
9
+ <% link_to_if (@field.link_to_resource or Avo.configuration.id_links_to_resource), @field.value, path, title: t('avo.view_item', { item: @resource.name}).humanize %>
10
10
  <% end %>
@@ -5,8 +5,8 @@
5
5
  <%== item_selector_input floating: true, size: :lg %>
6
6
 
7
7
  <% if cover.respond_to? :to_image %>
8
- <%= link_to_if cover.link_to_resource, image_tag(cover.to_image, class: 'absolute h-full w-full object-cover'), helpers.resource_path(@resource.model), class: 'absolute h-full w-full object-cover', title: title.value %>
9
- <% elsif cover.type == 'file_field' %>
8
+ <%= link_to_if cover.link_to_resource, image_tag(cover.to_image, class: 'absolute h-full w-full object-cover'), helpers.resource_path(@resource.model), class: 'absolute h-full w-full object-cover', title: title.value %>
9
+ <% elsif cover.type == 'file' %>
10
10
  <% if cover.value.attached? && cover.value.representable? %>
11
11
  <%= link_to_if cover.link_to_resource, image_tag(cover.variant(resize_to_limit: [480, 480]), class: 'absolute h-full w-full object-cover'), helpers.resource_path(@resource.model), class: 'absolute h-full w-full object-cover', title: title.value %>
12
12
  <% else %>
@@ -12,14 +12,14 @@ class Avo::Index::GridItemComponent < ViewComponent::Base
12
12
 
13
13
  private
14
14
  def cover
15
- @grid_fields[:cover].first
15
+ @grid_fields.cover_field
16
16
  end
17
17
 
18
18
  def title
19
- @grid_fields[:title].first
19
+ @grid_fields.title_field
20
20
  end
21
21
 
22
22
  def body
23
- @grid_fields[:body].first
23
+ @grid_fields.body_field
24
24
  end
25
25
  end
@@ -23,7 +23,9 @@
23
23
  <% end %>
24
24
 
25
25
  <% if can_detach? %>
26
- <%= form_with url: helpers.resource_detach_path(params[:resource_name], params[:id], params[:related_name], @resource.model.id), method: :delete, html: {'data-turbo-frame': params[:turbo_frame]} do |form| %>
26
+ <%= form_with url: helpers.resource_detach_path(params[:resource_name], params[:id], params[:related_name], @resource.model.id), method: :delete, html: {
27
+ 'data-turbo-frame': params[:turbo_frame]
28
+ } do |form| %>
27
29
  <%= form.button helpers.svg('trash-sm', class: 'text-gray-400 h-6 hover:text-gray-600'),
28
30
  title: t('avo.detach_item', { item: @resource.model.model_name.name.downcase }).capitalize,
29
31
  type: :submit,
@@ -34,12 +36,16 @@
34
36
  'tippy': 'tooltip',
35
37
  }
36
38
  %>
37
- <%= hidden_field_tag :referrer, request.fullpath, id: "referrer_detach_#{@resource.model.id}" if params[:via_resource_class] %>
39
+ <%= hidden_field_tag :turbo_frame, params[:turbo_frame], id: "turbo_frame_destroy_#{@resource.model.id}" if params[:turbo_frame] %>
40
+ <%= hidden_field_tag :referrer, request.fullpath, id: "referrer_destroy_#{@resource.model.id}" if params[:turbo_frame] %>
41
+ <%#= hidden_field_tag :referrer, request.fullpath, id: "referrer_detach_#{@resource.model.id}" if params[:via_resource_class] %>
38
42
  <% end %>
39
43
  <% end %>
40
44
 
41
45
  <% if can_delete? %>
42
- <%= form_with url: helpers.resource_path(@resource.model), method: :delete, html: {'data-turbo-frame': params[:turbo_frame]} do |form| %>
46
+ <%= form_with url: helpers.resource_path(@resource.model), method: :delete, html: {
47
+ 'data-turbo-frame': params[:turbo_frame]
48
+ } do |form| %>
43
49
  <%= form.button helpers.svg('trash', class: 'text-gray-400 h-6 hover:text-gray-600'),
44
50
  title: t('avo.delete_item', { item: @resource.model.model_name.name.downcase }).capitalize,
45
51
  type: :submit,
@@ -50,7 +56,9 @@
50
56
  'tippy': 'tooltip',
51
57
  }
52
58
  %>
53
- <%= form.hidden_field :referrer, value: request.fullpath, id: "referrer_destroy_#{@resource.model.id}" if params[:via_resource_class] %>
59
+ <%= form.hidden_field :view_type, value: params[:view_type], id: "turbo_view_type_#{@resource.model.id}" if params[:view_type] %>
60
+ <%= form.hidden_field :turbo_frame, value: params[:turbo_frame], id: "turbo_frame_destroy_#{@resource.model.id}" if params[:turbo_frame] %>
61
+ <%= form.hidden_field :referrer, value: request.fullpath, id: "referrer_destroy_#{@resource.model.id}" if params[:turbo_frame] %>
54
62
  <% end %>
55
63
  <% end %>
56
64
  </div>
@@ -1,4 +1,4 @@
1
- <div class="flex items-start leading-tight <%= @classes %> min-h-16" data-field-id="<%= @field.id %>">
1
+ <div class="flex items-start leading-tight <%= @classes %> min-h-16" data-field-id="<%= @field.id %>" data-field-type="<%= @field.type %>">
2
2
  <div class="h-16 flex self-start items-center text-blue-gray-800">
3
3
  <div class="w-48 md:w-64 px-8" data-slot="label">
4
4
  <%= @field.name %> <% if @field.required %> <span class="text-red-600">*</span> <% end %>
@@ -1,3 +1,3 @@
1
- <%= show_field_wrapper field: @field, index: @index do %>
1
+ <%= show_field_wrapper field: @field, index: @index, dash_if_blank: false do %>
2
2
  <%= render Avo::Common::BooleanGroupComponent.new options: @field.options, value: @field.value %>
3
3
  <% end %>
@@ -1,4 +1,4 @@
1
- <%= show_field_wrapper field: @field, field: @field do %>
1
+ <%= show_field_wrapper field: @field do %>
2
2
  <% if @field.value.present? %>
3
3
  <%= image_tag @field.value, style: 'max-width: 340px;' %>
4
4
  <% end %>
@@ -18,8 +18,20 @@
18
18
  <% end %>
19
19
 
20
20
  <% if @resource.authorization.authorize_action(:destroy, raise_exception: false) %>
21
- <%= a_link destroy_path, color: 'red', variant: 'outlined', method: :delete, data: {confirm: 'Are you sure?'} do %>
22
- <%= svg 'trash' %> <%= t('avo.delete').capitalize %>
21
+ <%= form_with url: helpers.resource_path(@resource.model), method: :delete, html: { 'data-turbo-frame': params[:turbo_frame] } do |form| %>
22
+ <%= a_button title: t('avo.delete_item', { item: @resource.model.model_name.name.downcase }).capitalize,
23
+ color: 'red',
24
+ variant: 'outlined',
25
+ type: :submit,
26
+ data: {
27
+ confirm: t('avo.are_you_sure', { item: @resource.model.model_name.name.downcase }),
28
+ control: :destroy,
29
+ 'resource-id': @resource.model.id,
30
+ 'tippy': 'tooltip',
31
+ } do
32
+ %>
33
+ <%= svg 'trash' %> <%= t('avo.delete').capitalize %>
34
+ <% end %>
23
35
  <% end %>
24
36
  <% end %>
25
37
 
@@ -6,7 +6,9 @@ module Avo
6
6
  before_action :set_resource
7
7
  before_action :set_action, only: [:show, :handle]
8
8
 
9
- def show; end
9
+ def show
10
+ @model = ActionModel.new @action.get_attributes_for_action
11
+ end
10
12
 
11
13
  def handle
12
14
  resource_ids = action_params[:fields][:resource_ids].split(',').map(&:to_i)
@@ -16,7 +18,7 @@ module Avo
16
18
  key != 'resource_ids'
17
19
  end
18
20
 
19
- performed_action = @action.handle_action(request, models, fields)
21
+ performed_action = @action.handle_action(models: models, fields: fields)
20
22
 
21
23
  respond performed_action.response
22
24
  end
@@ -33,8 +35,7 @@ module Avo
33
35
  model = @resource.model_class.find params[:id]
34
36
  end
35
37
 
36
- @action = action_class.new
37
- @action.hydrate(model: model, resource: resource, user: _current_user)
38
+ @action = action_class.new(model: model, resource: resource, user: _current_user)
38
39
  end
39
40
 
40
41
  def respond(response)
@@ -11,7 +11,7 @@ module Avo
11
11
  rescue_from Pundit::NotAuthorizedError, with: :render_unauthorized
12
12
  rescue_from ActiveRecord::RecordInvalid, with: :exception_logger
13
13
 
14
- helper_method :_current_user, :resources_path, :resource_path, :new_resource_path, :edit_resource_path, :resource_attach_path, :resource_detach_path
14
+ helper_method :_current_user, :resources_path, :resource_path, :new_resource_path, :edit_resource_path, :resource_attach_path, :resource_detach_path, :related_resources_path
15
15
  add_flash_types :info, :warning, :success, :error
16
16
 
17
17
  def init_app
@@ -24,7 +24,7 @@ module Avo
24
24
  respond_to do |format|
25
25
  format.html { raise exception }
26
26
  format.json { render json: {
27
- errors: exception.record.present? ? exception.record.errors : [],
27
+ errors: exception.respond_to?(:record) && exception.record.present? ? exception.record.errors : [],
28
28
  message: exception.message,
29
29
  traces: exception.backtrace,
30
30
  }, status: ActionDispatch::ExceptionWrapper.status_code_for_exception(exception.class.name) }
@@ -53,6 +53,22 @@ module Avo
53
53
  send :"resources_#{model.model_name.route_key}_path", **existing_params, **args
54
54
  end
55
55
 
56
+ def related_resources_path(parent_model, model, keep_query_params: false, **args)
57
+ return if model.nil?
58
+
59
+ existing_params = {}
60
+
61
+ begin
62
+ if keep_query_params
63
+ existing_params = Addressable::URI.parse(request.fullpath).query_values.symbolize_keys
64
+ end
65
+ rescue;end
66
+
67
+ Addressable::Template.new("#{Avo.configuration.root_path}/resources/#{@parent_resource.model.model_name.route_key}/#{@parent_resource.model.id}/#{@resource.route_key}{?query*}")
68
+ .expand({query: {**existing_params, **args}})
69
+ .to_str
70
+ end
71
+
56
72
  def resource_path(model = nil, resource_id: nil, keep_query_params: false, **args)
57
73
  existing_params = {}
58
74