avo 0.5.0.beta7 → 0.5.0.beta12

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 (276) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +48 -47
  3. data/Gemfile.lock +28 -18
  4. data/Rakefile +14 -14
  5. data/app/components/avo/common/badge_viewer_component.html.erb +1 -1
  6. data/app/components/avo/common/gravatar_viewer_component.html.erb +2 -2
  7. data/app/components/avo/common/gravatar_viewer_component.rb +2 -1
  8. data/app/components/avo/common/multiple_file_viewer_component.rb +1 -1
  9. data/app/components/avo/common/single_file_viewer_component.rb +1 -1
  10. data/app/components/avo/edit/field_wrapper_component.rb +3 -3
  11. data/app/components/avo/edit/fields/trix_field_component.html.erb +1 -1
  12. data/app/components/avo/index/field_wrapper_component.html.erb +1 -1
  13. data/app/components/avo/index/field_wrapper_component.rb +1 -1
  14. data/app/components/avo/index/fields/belongs_to_field_component.html.erb +1 -5
  15. data/app/components/avo/index/fields/boolean_group_field_component.html.erb +1 -1
  16. data/app/components/avo/index/fields/gravatar_field_component.html.erb +2 -1
  17. data/app/components/avo/index/fields/has_one_field_component.html.erb +1 -5
  18. data/app/components/avo/index/fields/id_field_component.html.erb +1 -1
  19. data/app/components/avo/index/grid_item_component.html.erb +2 -2
  20. data/app/components/avo/index/grid_item_component.rb +10 -9
  21. data/app/components/avo/index/resource_controls_component.html.erb +12 -4
  22. data/app/components/avo/index/resource_controls_component.rb +2 -2
  23. data/app/components/avo/panel_component.rb +7 -6
  24. data/app/components/avo/resource_component.rb +4 -3
  25. data/app/components/avo/show/field_wrapper_component.html.erb +1 -1
  26. data/app/components/avo/show/field_wrapper_component.rb +3 -3
  27. data/app/components/avo/show/fields/boolean_group_field_component.html.erb +1 -1
  28. data/app/components/avo/show/fields/external_image_field_component.html.erb +1 -1
  29. data/app/components/avo/views/resource_edit_component.rb +4 -3
  30. data/app/components/avo/views/resource_index_component.rb +8 -7
  31. data/app/components/avo/views/resource_new_component.rb +4 -3
  32. data/app/components/avo/views/resource_show_component.html.erb +14 -2
  33. data/app/components/avo/views/resource_show_component.rb +21 -21
  34. data/app/controllers/avo/actions_controller.rb +34 -32
  35. data/app/controllers/avo/application_controller.rb +122 -119
  36. data/app/controllers/avo/attachments_controller.rb +3 -3
  37. data/app/controllers/avo/base_controller.rb +80 -82
  38. data/app/controllers/avo/home_controller.rb +2 -2
  39. data/app/controllers/avo/relations_controller.rb +29 -28
  40. data/app/controllers/avo/resources_controller.rb +1 -1
  41. data/app/controllers/avo/search_controller.rb +20 -19
  42. data/app/helpers/avo/application_helper.rb +49 -43
  43. data/app/helpers/avo/resources_helper.rb +11 -11
  44. data/app/mailers/avo/application_mailer.rb +2 -2
  45. data/app/{frontend/css → packs/entrypoints}/application.css +12 -11
  46. data/app/{frontend/packs → packs/entrypoints}/application.js +9 -3
  47. data/app/{frontend → packs}/fonts/nunito-v16-latin-700.eot +0 -0
  48. data/app/{frontend → packs}/fonts/nunito-v16-latin-700.svg +0 -0
  49. data/app/{frontend → packs}/fonts/nunito-v16-latin-700.ttf +0 -0
  50. data/app/{frontend → packs}/fonts/nunito-v16-latin-700.woff +0 -0
  51. data/app/{frontend → packs}/fonts/nunito-v16-latin-700.woff2 +0 -0
  52. data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.eot +0 -0
  53. data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.svg +0 -0
  54. data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.ttf +0 -0
  55. data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.woff +0 -0
  56. data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.woff2 +0 -0
  57. data/app/{frontend → packs}/images/logo.png +0 -0
  58. data/app/{frontend → packs}/importmap.json.erb +0 -0
  59. data/app/{frontend → packs}/js/controllers/action_controller.js +0 -0
  60. data/app/{frontend → packs}/js/controllers/actions_picker_controller.js +0 -0
  61. data/app/{frontend → packs}/js/controllers/alerts_controller.js +0 -0
  62. data/app/{frontend → packs}/js/controllers/attachments_controller.js +0 -0
  63. data/app/{frontend → packs}/js/controllers/boolean_filter_controller.js +0 -0
  64. data/app/{frontend → packs}/js/controllers/fields/code_field_controller.js +14 -14
  65. data/app/{frontend → packs}/js/controllers/fields/date_field_controller.js +0 -0
  66. data/app/{frontend → packs}/js/controllers/fields/simple_mde_controller.js +0 -0
  67. data/app/{frontend → packs}/js/controllers/filter_controller.js +20 -3
  68. data/app/{frontend → packs}/js/controllers/hidden_input_controller.js +0 -0
  69. data/app/{frontend → packs}/js/controllers/item_selector_controller.js +0 -0
  70. data/app/{frontend → packs}/js/controllers/modal_controller.js +0 -0
  71. data/app/{frontend → packs}/js/controllers/per_page_controller.js +5 -1
  72. data/app/{frontend → packs}/js/controllers/select_filter_controller.js +0 -0
  73. data/app/{frontend → packs}/js/controllers/tippy_controller.js +0 -0
  74. data/app/{frontend → packs}/js/controllers/toggle_panel_controller.js +0 -0
  75. data/app/{frontend → packs}/js/helpers/cast_boolean.js +0 -0
  76. data/app/{frontend → packs}/js/toastr.js +1 -0
  77. data/app/{frontend/css → packs/stylesheets}/alerts.css +0 -0
  78. data/app/packs/stylesheets/components/code.css +11 -0
  79. data/app/{frontend/css → packs/stylesheets}/components/status.css +0 -0
  80. data/app/{frontend/css → packs/stylesheets}/fonts.css +0 -0
  81. data/app/{frontend/css → packs/stylesheets}/loader.css +0 -0
  82. data/app/{frontend/css → packs/stylesheets}/pagination.css +0 -0
  83. data/app/{frontend/css → packs/stylesheets}/tailwindcss/base.css +0 -0
  84. data/app/{frontend/css → packs/stylesheets}/tailwindcss/components.css +0 -0
  85. data/app/{frontend/css → packs/stylesheets}/tailwindcss/utilities.css +0 -0
  86. data/app/{frontend/css → packs/stylesheets}/tooltips.css +0 -0
  87. data/app/{frontend/css → packs/stylesheets}/typography.css +0 -0
  88. data/app/{frontend → packs}/svgs/arrow-circle-right.svg +0 -0
  89. data/app/{frontend → packs}/svgs/arrow-left.svg +0 -0
  90. data/app/{frontend → packs}/svgs/avocado.svg +0 -0
  91. data/app/{frontend → packs}/svgs/badge-check-sm.svg +0 -0
  92. data/app/{frontend → packs}/svgs/check-circle.svg +0 -0
  93. data/app/{frontend → packs}/svgs/chevron-down.svg +0 -0
  94. data/app/{frontend → packs}/svgs/chevron-up.svg +0 -0
  95. data/app/{frontend → packs}/svgs/code.svg +0 -0
  96. data/app/{frontend → packs}/svgs/color-swatch.svg +0 -0
  97. data/app/{frontend → packs}/svgs/document-text.svg +0 -0
  98. data/app/{frontend → packs}/svgs/download.svg +0 -0
  99. data/app/{frontend → packs}/svgs/edit.svg +0 -0
  100. data/app/{frontend → packs}/svgs/exclamation-circle-sm.svg +0 -0
  101. data/app/{frontend → packs}/svgs/exclamation-sm.svg +0 -0
  102. data/app/{frontend → packs}/svgs/exclamation.svg +0 -0
  103. data/app/{frontend → packs}/svgs/eye.svg +0 -0
  104. data/app/{frontend → packs}/svgs/filter.svg +0 -0
  105. data/app/{frontend → packs}/svgs/fire.svg +0 -0
  106. data/app/{frontend → packs}/svgs/game-board.svg +0 -0
  107. data/app/{frontend → packs}/svgs/globe.svg +0 -0
  108. data/app/{frontend → packs}/svgs/information-circle-sm.svg +0 -0
  109. data/app/{frontend → packs}/svgs/information-circle.svg +0 -0
  110. data/app/{frontend → packs}/svgs/library.svg +0 -0
  111. data/app/{frontend → packs}/svgs/photograph.svg +0 -0
  112. data/app/{frontend → packs}/svgs/play.svg +0 -0
  113. data/app/{frontend → packs}/svgs/plus-circle.svg +0 -0
  114. data/app/{frontend → packs}/svgs/plus.svg +0 -0
  115. data/app/{frontend → packs}/svgs/question-mark-circle.svg +0 -0
  116. data/app/{frontend → packs}/svgs/save.svg +0 -0
  117. data/app/{frontend → packs}/svgs/selector.svg +0 -0
  118. data/app/{frontend → packs}/svgs/sort-ascending.svg +0 -0
  119. data/app/{frontend → packs}/svgs/sort-descending.svg +0 -0
  120. data/app/{frontend → packs}/svgs/switch-horizontal.svg +0 -0
  121. data/app/{frontend → packs}/svgs/thumbs-down.svg +0 -0
  122. data/app/{frontend → packs}/svgs/thumbs-up.svg +0 -0
  123. data/app/{frontend → packs}/svgs/times.svg +0 -0
  124. data/app/{frontend → packs}/svgs/trash-sm.svg +0 -0
  125. data/app/{frontend → packs}/svgs/trash.svg +0 -0
  126. data/app/{frontend → packs}/svgs/view-grid-add.svg +0 -0
  127. data/app/{frontend → packs}/svgs/view-grid.svg +0 -0
  128. data/app/{frontend → packs}/svgs/view-list.svg +0 -0
  129. data/app/{frontend → packs}/svgs/x-circle.svg +0 -0
  130. data/app/views/avo/actions/show.html.erb +3 -39
  131. data/app/views/avo/attachments/show.html.erb +8 -1
  132. data/app/views/avo/base/_boolean_filter.html.erb +1 -0
  133. data/app/views/avo/base/_filters.html.erb +1 -0
  134. data/app/views/avo/base/_select_filter.html.erb +1 -0
  135. data/app/views/avo/partials/_paginator.html.erb +24 -5
  136. data/app/views/avo/relations/new.html.erb +5 -1
  137. data/app/views/layouts/avo/application.html.erb +0 -5
  138. data/avo.gemspec +31 -30
  139. data/bin/helpers.rb +0 -0
  140. data/bin/rspec +1 -0
  141. data/bin/webpack +3 -1
  142. data/config/initializers/inline_svg.rb +1 -1
  143. data/config/initializers/pagy.rb +1 -1
  144. data/config/routes.rb +12 -12
  145. data/config/spring.rb +5 -5
  146. data/config/webpack/aliases.js +1 -1
  147. data/config/webpack/base.js +14 -0
  148. data/config/webpack/development.js +2 -2
  149. data/config/webpack/production.js +2 -2
  150. data/config/webpack/test.js +2 -2
  151. data/config/webpacker.yml +5 -44
  152. data/db/factories.rb +4 -5
  153. data/lib/avo.rb +6 -6
  154. data/lib/avo/action_model.rb +20 -0
  155. data/lib/avo/app.rb +18 -60
  156. data/lib/avo/base_action.rb +55 -52
  157. data/lib/avo/base_resource.rb +66 -95
  158. data/lib/avo/configuration.rb +16 -22
  159. data/lib/avo/engine.rb +30 -14
  160. data/lib/avo/fields/badge_field.rb +2 -2
  161. data/lib/avo/fields/base_field.rb +38 -29
  162. data/lib/avo/fields/belongs_to_field.rb +13 -12
  163. data/lib/avo/fields/boolean_field.rb +4 -4
  164. data/lib/avo/fields/boolean_group_field.rb +3 -3
  165. data/lib/avo/fields/code_field.rb +4 -4
  166. data/lib/avo/fields/country_field.rb +2 -2
  167. data/lib/avo/fields/currency_field.rb +3 -3
  168. data/lib/avo/fields/date_field.rb +3 -3
  169. data/lib/avo/fields/date_time_field.rb +2 -2
  170. data/lib/avo/fields/external_image_field.rb +2 -2
  171. data/lib/avo/fields/field_extensions/has_field_name.rb +2 -9
  172. data/lib/avo/fields/field_extensions/visible_in_different_views.rb +34 -33
  173. data/lib/avo/fields/file_field.rb +1 -1
  174. data/lib/avo/fields/files_field.rb +2 -2
  175. data/lib/avo/fields/gravatar_field.rb +10 -10
  176. data/lib/avo/fields/has_and_belongs_to_many_field.rb +1 -1
  177. data/lib/avo/fields/has_many_field.rb +1 -1
  178. data/lib/avo/fields/has_one_field.rb +2 -2
  179. data/lib/avo/fields/heading_field.rb +2 -2
  180. data/lib/avo/fields/hidden_field.rb +1 -1
  181. data/lib/avo/fields/id_field.rb +3 -3
  182. data/lib/avo/fields/key_value_field.rb +12 -12
  183. data/lib/avo/fields/markdown_field.rb +2 -2
  184. data/lib/avo/fields/number_field.rb +3 -3
  185. data/lib/avo/fields/password_field.rb +1 -1
  186. data/lib/avo/fields/select_field.rb +8 -12
  187. data/lib/avo/fields/status_field.rb +4 -4
  188. data/lib/avo/fields/text_field.rb +2 -2
  189. data/lib/avo/fields/textarea_field.rb +2 -2
  190. data/lib/avo/fields/trix_field.rb +1 -1
  191. data/lib/avo/fields_collector.rb +30 -0
  192. data/lib/avo/filters/base_filter.rb +6 -6
  193. data/lib/avo/filters/boolean_filter.rb +1 -1
  194. data/lib/avo/filters/select_filter.rb +1 -1
  195. data/lib/avo/grid_collector.rb +39 -0
  196. data/lib/avo/has_context.rb +7 -0
  197. data/lib/avo/licensing/h_q.rb +56 -55
  198. data/lib/avo/licensing/license.rb +5 -5
  199. data/lib/avo/licensing/license_manager.rb +4 -4
  200. data/lib/avo/licensing/null_license.rb +2 -2
  201. data/lib/avo/licensing/pro_license.rb +1 -1
  202. data/lib/avo/loaders/fields_loader.rb +4 -4
  203. data/lib/avo/services/authorization_service.rb +2 -2
  204. data/lib/avo/services/panel_service.rb +4 -4
  205. data/lib/avo/version.rb +1 -1
  206. data/lib/generators/avo/action_generator.rb +4 -4
  207. data/lib/generators/avo/controller_generator.rb +4 -4
  208. data/lib/generators/avo/filter_generator.rb +5 -5
  209. data/lib/generators/avo/install_generator.rb +8 -8
  210. data/lib/generators/avo/locales_generator.rb +5 -5
  211. data/lib/generators/avo/partials_generator.rb +4 -4
  212. data/lib/generators/avo/resource_generator.rb +5 -5
  213. data/lib/generators/avo/templates/action.tt +1 -5
  214. data/lib/generators/avo/templates/resource/resource.tt +3 -13
  215. data/lib/tasks/avo_tasks.rake +0 -60
  216. data/public/avo-packs/css/application-4e16d6a6.css +5975 -0
  217. data/public/avo-packs/css/application-4e16d6a6.css.br +0 -0
  218. data/public/avo-packs/css/application-4e16d6a6.css.gz +0 -0
  219. data/public/avo-packs/css/application-4e16d6a6.css.map +1 -0
  220. data/public/avo-packs/css/application-4e16d6a6.css.map.br +0 -0
  221. data/public/avo-packs/css/application-4e16d6a6.css.map.gz +0 -0
  222. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js +2 -0
  223. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.br +0 -0
  224. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.gz +0 -0
  225. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.map +1 -0
  226. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.map.br +0 -0
  227. data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.map.gz +0 -0
  228. data/public/avo-packs/js/application-8eb130a4688f2c667703.js +26 -0
  229. data/public/avo-packs/js/{application-8849c6e2c8f75d55c666.js.LICENSE.txt → application-8eb130a4688f2c667703.js.LICENSE.txt} +17 -17
  230. data/public/avo-packs/js/application-8eb130a4688f2c667703.js.br +0 -0
  231. data/public/avo-packs/js/application-8eb130a4688f2c667703.js.gz +0 -0
  232. data/public/avo-packs/js/application-8eb130a4688f2c667703.js.map +1 -0
  233. data/public/avo-packs/js/application-8eb130a4688f2c667703.js.map.br +0 -0
  234. data/public/avo-packs/js/application-8eb130a4688f2c667703.js.map.gz +0 -0
  235. data/public/avo-packs/manifest.json +46 -23
  236. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg → images/13ae283c0d7cc04efe7e.svg} +0 -0
  237. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg.br → images/13ae283c0d7cc04efe7e.svg.br} +0 -0
  238. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg.gz → images/13ae283c0d7cc04efe7e.svg.gz} +0 -0
  239. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg → images/195026a50008c53526ef.svg} +0 -0
  240. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg.br → images/195026a50008c53526ef.svg.br} +0 -0
  241. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg.gz → images/195026a50008c53526ef.svg.gz} +0 -0
  242. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-cb632c9fe211ba2c2bf1564c9a9295cc.woff → images/1f30e08faa7c60d1f7ac.woff} +0 -0
  243. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf → images/1fd17dabf6b7d2b15348.ttf} +0 -0
  244. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf.br → images/1fd17dabf6b7d2b15348.ttf.br} +0 -0
  245. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf.gz → images/1fd17dabf6b7d2b15348.ttf.gz} +0 -0
  246. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-bcf84d6cb8a0ac214c8c14ba9af834f3.woff2 → images/39a18f443d434999b89b.woff2} +0 -0
  247. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-412073df419ad5f6f8f2ea76eb4aced9.woff2 → images/4ad349571e28bb59c5a5.woff2} +0 -0
  248. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-2fae1e2418251b68fe5d0505ab93dd5c.eot → images/57a5470848663767abbf.eot} +0 -0
  249. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf → images/b2e4cf0fab6c8ca66b7f.ttf} +0 -0
  250. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf.br → images/b2e4cf0fab6c8ca66b7f.ttf.br} +0 -0
  251. data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf.gz → images/b2e4cf0fab6c8ca66b7f.ttf.gz} +0 -0
  252. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-df7e79af617f98cd3b95d320e8b2a1af.eot → images/b78d61ab7e046de8c156.eot} +0 -0
  253. data/public/avo-packs/media/{fonts/nunito-v16-latin-700-7c472b19cb573f537bad8ef62ca917ac.woff → images/c9ab29becb76ddab01d0.woff} +0 -0
  254. data/public/avo-packs/media/images/{logo-edf8d8d0d263e0c1f73bb32a222d9991.png → f1b4befac91a3336db9a.png} +0 -0
  255. metadata +144 -127
  256. data/app/frontend/css/components/code.css +0 -27
  257. data/app/views/layouts/avo/application_vue.html.erb +0 -61
  258. data/config/webpack/environment.js +0 -18
  259. data/db/migrate/20210305082639_add_url_to_teams.rb +0 -5
  260. data/public/avo-packs/css/application-c75ac28c.css +0 -6
  261. data/public/avo-packs/css/application-c75ac28c.css.br +0 -0
  262. data/public/avo-packs/css/application-c75ac28c.css.gz +0 -0
  263. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js +0 -2
  264. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.br +0 -0
  265. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.gz +0 -0
  266. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.map +0 -1
  267. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.map.br +0 -0
  268. data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.map.gz +0 -0
  269. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js +0 -26
  270. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.br +0 -0
  271. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.gz +0 -0
  272. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.map +0 -1
  273. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.map.br +0 -0
  274. data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.map.gz +0 -0
  275. data/public/avo-packs/manifest.json.br +0 -0
  276. data/public/avo-packs/manifest.json.gz +0 -0
@@ -19,6 +19,7 @@
19
19
  <label class="flex items-center text-gray-700 text-sm">
20
20
  <%= check_box_tag filter.id, value, set_value[value.to_s],
21
21
  class: 'mr-2 text-lg h-4 w-4',
22
+ id: "avo_filters_#{filter.id.parameterize.underscore}",
22
23
  'data-filter-class': filter.class,
23
24
  'data-boolean-filter-target': 'option',
24
25
  'data-action': 'input->boolean-filter#changeFilter'
@@ -3,6 +3,7 @@
3
3
  <%= a_button class: 'focus:outline-none',
4
4
  color: 'blue-gray',
5
5
  title: t('avo.click_to_reveal_filters'),
6
+ 'data-button': 'resource-filters',
6
7
  'data-action': 'click->toggle-panel#togglePanel',
7
8
  'data-tippy': 'tooltip' do
8
9
  %>
@@ -11,6 +11,7 @@
11
11
  <%= select_tag filter.id, options_for_select(filter.options.invert, set_value),
12
12
  class: input_classes('w-full mb-0'),
13
13
  include_blank: '—',
14
+ id: "avo_filters_#{filter.id.parameterize.underscore}",
14
15
  'data-filter-class': filter.class,
15
16
  'data-select-filter-target': 'selector',
16
17
  'data-action': "change->select-filter#changeFilter"
@@ -1,6 +1,11 @@
1
1
  <%
2
- # @todo: add avo styling to paginator
3
- per_page_options = [*Avo.configuration.per_page_steps, Avo.configuration.per_page.to_i, @index_params[:per_page].to_i].sort.uniq
2
+ per_page_options = [*Avo.configuration.per_page_steps, Avo.configuration.per_page.to_i, @index_params[:per_page].to_i]
3
+
4
+ if @parent_resource.present?
5
+ per_page_options.prepend Avo.configuration.via_per_page
6
+ end
7
+
8
+ per_page_options = per_page_options.sort.uniq
4
9
  %>
5
10
 
6
11
  <div class="bg-white px-4 flex items-center justify-between aborder-t aborder-blue-gray-200 sm:px-6 rounded-xl">
@@ -11,11 +16,23 @@
11
16
 
12
17
  <div data-controller="per-page">
13
18
  <div class="flex items-center">
14
- <%= select_tag 'per_page', options_for_select(per_page_options, @index_params[:per_page]), class: 'appearance-none inline-flex bg-blue-gray-100 disabled:bg-blue-gray-400 disabled:cursor-not-allowed focus:bg-white text-blue-gray-700 disabled:text-blue-gray-600 rounded-md py-1 px-2 leading-tight border border-blue-gray-300 outline-none focus:border-blue-gray-400 outline w-16 mr-1 text-sm', 'data-per-page-target': 'selector', 'data-action': 'change->per-page#reload' %> <%= t('avo.per_page').downcase %>
19
+ <%= select_tag 'per_page',
20
+ options_for_select(per_page_options, @index_params[:per_page]),
21
+ class: 'appearance-none inline-flex bg-blue-gray-100 disabled:bg-blue-gray-400 disabled:cursor-not-allowed focus:bg-white text-blue-gray-700 disabled:text-blue-gray-600 rounded-md py-1 px-2 leading-tight border border-blue-gray-300 outline-none focus:border-blue-gray-400 outline w-16 mr-1 text-sm',
22
+ data: {
23
+ 'turbo-frame': turbo_frame,
24
+ 'per-page-target': 'selector',
25
+ action: 'change->per-page#reload'
26
+ }
27
+ %> <%= t('avo.per_page').downcase %>
15
28
  </div>
16
29
 
17
30
  <% per_page_options.each do |option| %>
18
- <%= link_to "Change to #{option} items per page", resources_path(@resource.model_class, per_page: option, keep_query_params: true), class: 'hidden', 'data-per-page-option': option, 'data-turbo-frame': turbo_frame %>
31
+ <% if @parent_resource.present? %>
32
+ <%= link_to "Change to #{option} items per page", related_resources_path(@parent_resource.model, @resource.model_class, per_page: option, keep_query_params: true), class: 'hidden', 'data-per-page-option': option, 'data-turbo-frame': turbo_frame %>
33
+ <% else %>
34
+ <%= link_to "Change to #{option} items per page", resources_path(@resource.model_class, per_page: option, keep_query_params: true), class: 'hidden', 'data-per-page-option': option, 'data-turbo-frame': turbo_frame %>
35
+ <% end %>
19
36
  <% end %>
20
37
  </div>
21
38
  </div>
@@ -24,7 +41,9 @@
24
41
  <div class="flex">
25
42
  <div class="flex-2 sm:flex sm:items-center sm:justify-between">
26
43
  <%# @todo: add first & last page. make the first and last buttons rounded %>
27
- <%== pagy_nav @pagy %>
44
+ <% if @pagy.pages > 1 %>
45
+ <%== pagy_nav @pagy %>
46
+ <% end %>
28
47
  </div>
29
48
  </div>
30
49
  </div>
@@ -1,5 +1,9 @@
1
1
  <%= turbo_frame_tag 'attach_modal' do %>
2
- <%= form_with scope: 'fields', url: "/avo/resources/#{params[:resource_name]}/#{params[:id]}/#{params[:related_name]}/", data: {'turbo-frame': '_top'} do |form| %>
2
+ <%= form_with scope: 'fields',
3
+ url: "/avo/resources/#{params[:resource_name]}/#{params[:id]}/#{params[:related_name]}/",
4
+ data: {
5
+ 'turbo-frame': '_top'
6
+ } do |form| %>
3
7
  <%= render Avo::ModalComponent.new do |c| %>
4
8
  <% c.with :heading do %>
5
9
  <%= t('avo.choose_item', { item: params[:related_name].downcase }) %>
@@ -8,11 +8,6 @@
8
8
 
9
9
  <%= render partial: 'avo/partials/javascript' %>
10
10
 
11
- <%# if Avo::PACKED %>
12
- <%#= stylesheet_link_tag 'application', media: 'all', "data-turbo-track": "reload" %>
13
- <%#= javascript_include_tag 'avo-packs/application', "data-turbo-track": "reload" %>
14
- <%# else %>
15
- <%# end %>
16
11
  <%= javascript_pack_tag 'application' %>
17
12
  <%= stylesheet_pack_tag 'application', media: 'all' %>
18
13
  </head>
data/avo.gemspec CHANGED
@@ -1,46 +1,47 @@
1
- $:.push File.expand_path('lib', __dir__)
1
+ $:.push File.expand_path("lib", __dir__)
2
2
 
3
3
  # Maintain your gem's version:
4
- require 'avo/version'
4
+ require "avo/version"
5
5
 
6
6
  # Describe your gem and declare its dependencies:
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'avo'
9
- spec.version = Avo::VERSION
10
- spec.authors = ['Adrian Marin', 'Mihai Marin']
11
- spec.email = ['avo@avohq.io']
12
- spec.homepage = 'https://avohq.io'
13
- spec.summary = 'Configuration-based, no-maintenance, extendable Ruby on Rails admin.'
14
- spec.description = 'Avo is a beautiful next-generation framework that empowers you, the developer, to create fantastic admin panels for your Ruby on Rails apps with the flexibility to fit your needs as you grow.'
15
- spec.license = 'Commercial'
8
+ spec.name = "avo"
9
+ spec.version = Avo::VERSION
10
+ spec.authors = ["Adrian Marin", "Mihai Marin"]
11
+ spec.email = ["avo@avohq.io"]
12
+ spec.homepage = "https://avohq.io"
13
+ spec.summary = "Configuration-based, no-maintenance, extendable Ruby on Rails admin."
14
+ spec.description = "Avo is a beautiful next-generation framework that empowers you, the developer, to create fantastic admin panels for your Ruby on Rails apps with the flexibility to fit your needs as you grow."
15
+ spec.license = "Commercial"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
18
  # to allow pushing to a single host or delete this section to allow pushing to any host.
19
19
  if spec.respond_to?(:metadata)
20
- spec.metadata['bug_tracker_uri'] = 'https://github.com/avo-hq/avo/issues'
21
- spec.metadata['changelog_uri'] = 'https://avohq.io/releases'
22
- spec.metadata['documentation_uri'] = 'https://docs.avohq.io'
23
- spec.metadata['homepage_uri'] = 'https://avohq.io'
24
- spec.metadata['source_code_uri'] = 'https://github.com/avo-hq/avo'
20
+ spec.metadata["bug_tracker_uri"] = "https://github.com/avo-hq/avo/issues"
21
+ spec.metadata["changelog_uri"] = "https://avohq.io/releases"
22
+ spec.metadata["documentation_uri"] = "https://docs.avohq.io"
23
+ spec.metadata["homepage_uri"] = "https://avohq.io"
24
+ spec.metadata["source_code_uri"] = "https://github.com/avo-hq/avo"
25
25
  else
26
- raise 'RubyGems 2.0 or newer is required to protect against ' \
27
- 'public gem pushes.'
26
+ raise "RubyGems 2.0 or newer is required to protect against " \
27
+ "public gem pushes."
28
28
  end
29
29
 
30
30
  spec.post_install_message = "Thank you for using Avo! Docs are available at https://docs.avohq.io"
31
31
 
32
- spec.files = Dir['{bin,app,config,db,lib,public}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md', 'avo.gemspec', 'Gemfile', 'Gemfile.lock']
32
+ spec.files = Dir["{bin,app,config,db,lib,public}/**/*", "MIT-LICENSE", "Rakefile", "README.md", "avo.gemspec", "Gemfile", "Gemfile.lock"]
33
33
 
34
- spec.add_dependency 'rails', '>= 6.0'
35
- spec.add_dependency 'pagy'
36
- spec.add_dependency 'zeitwerk'
37
- spec.add_dependency 'inline_svg'
38
- spec.add_dependency 'webpacker'
39
- spec.add_dependency 'countries'
40
- spec.add_dependency 'pundit'
41
- spec.add_dependency 'httparty'
42
- spec.add_dependency 'active_link_to'
43
- spec.add_dependency 'image_processing'
44
- spec.add_dependency 'view_component'
45
- spec.add_dependency 'hotwire-rails'
34
+ spec.add_dependency "rails", ">= 6.0"
35
+ spec.add_dependency "pagy"
36
+ spec.add_dependency "zeitwerk"
37
+ spec.add_dependency "inline_svg"
38
+ spec.add_dependency "webpacker"
39
+ spec.add_dependency "countries"
40
+ spec.add_dependency "pundit"
41
+ spec.add_dependency "httparty"
42
+ spec.add_dependency "active_link_to"
43
+ spec.add_dependency "image_processing"
44
+ spec.add_dependency "view_component"
45
+ spec.add_dependency "hotwire-rails"
46
+ spec.add_dependency "addressable"
46
47
  end
data/bin/helpers.rb CHANGED
File without changes
data/bin/rspec CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  begin
3
4
  load File.expand_path('../spring', __FILE__)
4
5
  rescue LoadError => e
data/bin/webpack CHANGED
@@ -2,9 +2,11 @@
2
2
 
3
3
  ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] || 'development'
4
4
  ENV['NODE_ENV'] ||= 'development'
5
+ ENV['TAILWIND_MODE'] ||= 'build'
5
6
 
6
7
  require 'pathname'
7
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath)
8
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
9
+ Pathname.new(__FILE__).realpath)
8
10
 
9
11
  require 'rubygems'
10
12
  require 'bundler/setup'
@@ -25,7 +25,7 @@ module InlineSvg
25
25
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
26
26
 
27
27
  http.request(Net::HTTP::Get.new(file_path)).body
28
- rescue StandardError => e
28
+ rescue => e
29
29
  Rails.logger.error "[inline_svg] Error fetching #{@filename} from webpack-dev-server: #{e}"
30
30
  raise
31
31
  end
@@ -1 +1 @@
1
- require 'pagy/extras/trim'
1
+ require "pagy/extras/trim"
data/config/routes.rb CHANGED
@@ -1,27 +1,27 @@
1
1
  Avo::Engine.routes.draw do
2
- root 'home#index'
2
+ root "home#index"
3
3
 
4
- get 'resources', to: redirect('/avo')
4
+ get "resources", to: redirect("/avo")
5
5
 
6
- scope 'resources', as: 'resources' do
6
+ scope "resources", as: "resources" do
7
7
  # Attachments
8
- get '/:resource_name/:id/active_storage_attachments/:attachment_name/:signed_attachment_id', to: 'attachments#show'
9
- delete '/:resource_name/:id/active_storage_attachments/:attachment_name/:signed_attachment_id', to: 'attachments#destroy'
8
+ get "/:resource_name/:id/active_storage_attachments/:attachment_name/:signed_attachment_id", to: "attachments#show"
9
+ delete "/:resource_name/:id/active_storage_attachments/:attachment_name/:signed_attachment_id", to: "attachments#destroy"
10
10
 
11
11
  # Actions
12
- get '/:resource_name(/:id)/actions/:action_id', to: 'actions#show'
13
- post '/:resource_name(/:id)/actions/:action_id', to: 'actions#handle'
12
+ get "/:resource_name(/:id)/actions/:action_id", to: "actions#show"
13
+ post "/:resource_name(/:id)/actions/:action_id", to: "actions#handle"
14
14
 
15
15
  # Generate resource routes as below:
16
16
  # resources :posts
17
17
  instance_eval(&Avo::App.draw_routes)
18
18
 
19
19
  # Relations
20
- get '/:resource_name/:id/:related_name/new', to: 'relations#new'
21
- get '/:resource_name/:id/:related_name/', to: 'relations#index'
22
- get '/:resource_name/:id/:related_name/:related_id', to: 'relations#show'
23
- post '/:resource_name/:id/:related_name', to: 'relations#create'
24
- delete '/:resource_name/:id/:related_name/:related_id', to: 'relations#destroy'
20
+ get "/:resource_name/:id/:related_name/new", to: "relations#new"
21
+ get "/:resource_name/:id/:related_name/", to: "relations#index"
22
+ get "/:resource_name/:id/:related_name/:related_id", to: "relations#show"
23
+ post "/:resource_name/:id/:related_name", to: "relations#create"
24
+ delete "/:resource_name/:id/:related_name/:related_id", to: "relations#destroy"
25
25
  end
26
26
 
27
27
  # get '/avo-api/search', to: 'search#index'
data/config/spring.rb CHANGED
@@ -1,7 +1,7 @@
1
- Spring.application_root = './spec/dummy'
1
+ Spring.application_root = "./spec/dummy"
2
2
  Spring.watch(
3
- '.ruby-version',
4
- '.rbenv-vars',
5
- 'tmp/restart.txt',
6
- 'tmp/caching-dev.txt'
3
+ ".ruby-version",
4
+ ".rbenv-vars",
5
+ "tmp/restart.txt",
6
+ "tmp/caching-dev.txt"
7
7
  )
@@ -3,7 +3,7 @@ const path = require('path')
3
3
  module.exports = {
4
4
  resolve: {
5
5
  alias: {
6
- '@': path.resolve(__dirname, '..', '..', 'app/frontend'),
6
+ '@': path.resolve(__dirname, '..', '..', 'app/packs'),
7
7
  '~': path.resolve(__dirname, '..', '..', 'node_modules'),
8
8
  },
9
9
  },
@@ -0,0 +1,14 @@
1
+ const { webpackConfig, merge } = require('@rails/webpacker')
2
+ const aliases = require('./aliases')
3
+
4
+ const customConfig = {
5
+ resolve: {
6
+ extensions: ['.css'],
7
+ },
8
+ }
9
+
10
+ const config = merge(webpackConfig, aliases, customConfig)
11
+
12
+ delete config.optimization
13
+
14
+ module.exports = config
@@ -1,5 +1,5 @@
1
1
  process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2
2
 
3
- const environment = require('./environment')
3
+ const webpackConfig = require('./base')
4
4
 
5
- module.exports = environment.toWebpackConfig()
5
+ module.exports = webpackConfig
@@ -1,5 +1,5 @@
1
1
  process.env.NODE_ENV = process.env.NODE_ENV || 'production'
2
2
 
3
- const environment = require('./environment')
3
+ const webpackConfig = require('./base')
4
4
 
5
- module.exports = environment.toWebpackConfig()
5
+ module.exports = webpackConfig
@@ -1,5 +1,5 @@
1
1
  process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2
2
 
3
- const environment = require('./environment')
3
+ const webpackConfig = require('./base')
4
4
 
5
- module.exports = environment.toWebpackConfig()
5
+ module.exports = webpackConfig
data/config/webpacker.yml CHANGED
@@ -1,66 +1,30 @@
1
1
  # Note: You must restart bin/webpack-dev-server for changes to take effect
2
2
 
3
3
  default: &default
4
- source_path: app/frontend
5
- source_entry_path: packs
4
+ source_path: app/packs
5
+ source_entry_path: entrypoints
6
6
  public_root_path: public
7
7
  cache_path: tmp/cache/webpacker
8
8
  check_yarn_integrity: false
9
9
  # use a different sub-folder name
10
10
  public_output_path: avo-packs
11
11
  webpack_compile_output: true
12
+ extract_css: true
12
13
 
13
14
  # Additional paths webpack should lookup modules
14
15
  # ['app/assets', 'engine/foo/app/assets']
15
- resolved_paths: []
16
+ additional_paths_paths: []
16
17
 
17
18
  # Reload manifest.json on all requests so we reload latest compiled packs
18
19
  cache_manifest: false
19
20
 
20
- # Extract and emit a css file
21
- extract_css: true
22
-
23
- static_assets_extensions:
24
- - .jpg
25
- - .jpeg
26
- - .png
27
- - .gif
28
- - .tiff
29
- - .ico
30
- - .svg
31
- - .eot
32
- - .otf
33
- - .ttf
34
- - .woff
35
- - .woff2
36
-
37
- extensions:
38
- - .ts
39
- - .vue
40
- - .mjs
41
- - .js
42
- - .sass
43
- - .scss
44
- - .css
45
- - .module.sass
46
- - .module.scss
47
- - .module.css
48
- - .png
49
- - .svg
50
- - .gif
51
- - .jpeg
52
- - .jpg
53
-
54
21
  # We override the development env. when packed.
55
22
  # Avo needs to be packed and compiled for when the dev uses it in his development env.
56
23
  development:
57
24
  <<: *default
58
25
 
59
26
  # Production depends on precompilation of packs prior to booting for performance.
60
- compile: false
61
-
62
- # Extract and emit a css file
63
- extract_css: true
27
+ compile: true
64
28
 
65
29
  # Cache manifest.json for performance
66
30
  cache_manifest: true
@@ -79,8 +43,5 @@ production:
79
43
  # Production depends on precompilation of packs prior to booting for performance.
80
44
  compile: false
81
45
 
82
- # Extract and emit a css file
83
- extract_css: true
84
-
85
46
  # Cache manifest.json for performance
86
47
  cache_manifest: true
data/db/factories.rb CHANGED
@@ -4,7 +4,7 @@ FactoryBot.define do
4
4
  last_name { Faker::Name.last_name }
5
5
  email { Faker::Internet.email }
6
6
  password { Faker::Internet.password }
7
- roles { { admin: false, manager: [true, false].sample, writer: [true, false].sample } }
7
+ roles { {admin: false, manager: [true, false].sample, writer: [true, false].sample} }
8
8
  birthday { Faker::Date.birthday(min_age: 18, max_age: 65) }
9
9
  custom_css { ".header {\n color: red;\n}" }
10
10
  end
@@ -12,6 +12,7 @@ FactoryBot.define do
12
12
  factory :team do
13
13
  name { Faker::Company.name }
14
14
  description { Faker::Lorem.paragraph(sentence_count: 4) }
15
+ url { Faker::Internet.url }
15
16
  end
16
17
 
17
18
  factory :post do
@@ -21,8 +22,6 @@ FactoryBot.define do
21
22
  published_at do
22
23
  if [false, true].sample
23
24
  Time.now - rand(10...365).days
24
- else
25
- nil
26
25
  end
27
26
  end
28
27
  end
@@ -30,12 +29,12 @@ FactoryBot.define do
30
29
  factory :project do
31
30
  name { Faker::App.name }
32
31
  status { [:closed, :rejected, :failed, :loading, :running, :waiting].sample }
33
- stage { ['Discovery', 'Idea', 'Done', 'On hold', 'Cancelled'].sample }
32
+ stage { ["Discovery", "Idea", "Done", "On hold", "Cancelled"].sample }
34
33
  budget { Faker::Number.decimal(l_digits: 4) }
35
34
  country { Faker::Address.country_code }
36
35
  description { Faker::Markdown.sandwich(sentences: 5) }
37
36
  users_required { Faker::Number.between(from: 10, to: 100) }
38
37
  started_at { Time.now - rand(10...365).days }
39
- meta { [{ foo: 'bar', hey: 'hi' }, { bar: 'baz' }, { hoho: 'hohoho' }].sample }
38
+ meta { [{foo: "bar", hey: "hi"}, {bar: "baz"}, {hoho: "hohoho"}].sample }
40
39
  end
41
40
  end