avo 1.19.0 → 1.19.1.pre.4

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 (191) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -7
  3. data/Gemfile.lock +34 -51
  4. data/README.md +3 -0
  5. data/app/assets/builds/avo.css +8477 -0
  6. data/app/assets/builds/avo.js +87744 -0
  7. data/app/assets/builds/avo.js.map +7 -0
  8. data/app/assets/config/avo_manifest.js +2 -1
  9. data/app/{packs/images → assets/images/avo}/logo.png +0 -0
  10. data/app/{packs/entrypoints/application.css → assets/stylesheets/avo.css} +23 -24
  11. data/app/{packs/stylesheets → assets/stylesheets/css}/active-storage.css +0 -0
  12. data/app/{packs/stylesheets → assets/stylesheets/css}/alerts.css +0 -0
  13. data/app/{packs/stylesheets → assets/stylesheets/css}/breadcrumbs.css +0 -0
  14. data/app/{packs/stylesheets → assets/stylesheets/css}/components/code.css +0 -0
  15. data/app/{packs/stylesheets → assets/stylesheets/css}/components/progress.css +0 -0
  16. data/app/{packs/stylesheets → assets/stylesheets/css}/components/status.css +0 -0
  17. data/app/assets/stylesheets/css/fonts.css +26 -0
  18. data/app/{packs/stylesheets → assets/stylesheets/css}/loader.css +0 -0
  19. data/app/{packs/stylesheets → assets/stylesheets/css}/pagination.css +0 -0
  20. data/app/{packs/stylesheets → assets/stylesheets/css}/search.css +0 -0
  21. data/app/{packs/stylesheets → assets/stylesheets/css}/spinner.css +0 -0
  22. data/app/{packs/stylesheets → assets/stylesheets/css}/tailwindcss/base.css +0 -0
  23. data/app/{packs/stylesheets → assets/stylesheets/css}/tailwindcss/components.css +0 -0
  24. data/app/{packs/stylesheets → assets/stylesheets/css}/tailwindcss/utilities.css +0 -0
  25. data/app/{packs/stylesheets → assets/stylesheets/css}/tooltips.css +0 -0
  26. data/app/{packs/stylesheets → assets/stylesheets/css}/typography.css +0 -0
  27. data/app/{packs → assets}/svgs/arrow-circle-right.svg +0 -0
  28. data/app/{packs → assets}/svgs/arrow-left.svg +0 -0
  29. data/app/{packs → assets}/svgs/avocado.svg +0 -0
  30. data/app/{packs → assets}/svgs/badge-check-sm.svg +0 -0
  31. data/app/{packs → assets}/svgs/check-circle-sm.svg +0 -0
  32. data/app/{packs → assets}/svgs/check-circle.svg +0 -0
  33. data/app/{packs → assets}/svgs/chevron-down.svg +0 -0
  34. data/app/{packs → assets}/svgs/chevron-right.svg +0 -0
  35. data/app/{packs → assets}/svgs/chevron-up.svg +0 -0
  36. data/app/{packs → assets}/svgs/code.svg +0 -0
  37. data/app/{packs → assets}/svgs/color-swatch.svg +0 -0
  38. data/app/{packs → assets}/svgs/document-text.svg +0 -0
  39. data/app/{packs → assets}/svgs/download.svg +0 -0
  40. data/app/{packs → assets}/svgs/edit.svg +0 -0
  41. data/app/{packs → assets}/svgs/exclamation-circle-sm.svg +0 -0
  42. data/app/{packs → assets}/svgs/exclamation-sm.svg +0 -0
  43. data/app/{packs → assets}/svgs/exclamation.svg +0 -0
  44. data/app/{packs → assets}/svgs/eye.svg +0 -0
  45. data/app/{packs → assets}/svgs/filter.svg +0 -0
  46. data/app/{packs → assets}/svgs/fire.svg +0 -0
  47. data/app/{packs → assets}/svgs/game-board.svg +0 -0
  48. data/app/{packs → assets}/svgs/globe.svg +0 -0
  49. data/app/{packs → assets}/svgs/information-circle-sm.svg +0 -0
  50. data/app/{packs → assets}/svgs/information-circle.svg +0 -0
  51. data/app/{packs → assets}/svgs/library.svg +0 -0
  52. data/app/{packs → assets}/svgs/photograph.svg +0 -0
  53. data/app/{packs → assets}/svgs/play.svg +0 -0
  54. data/app/{packs → assets}/svgs/plus-circle.svg +0 -0
  55. data/app/{packs → assets}/svgs/plus.svg +0 -0
  56. data/app/{packs → assets}/svgs/question-mark-circle.svg +0 -0
  57. data/app/{packs → assets}/svgs/save.svg +0 -0
  58. data/app/{packs → assets}/svgs/selector.svg +0 -0
  59. data/app/{packs → assets}/svgs/sort-ascending.svg +0 -0
  60. data/app/{packs → assets}/svgs/sort-descending.svg +0 -0
  61. data/app/{packs → assets}/svgs/switch-horizontal.svg +0 -0
  62. data/app/{packs → assets}/svgs/thumbs-down.svg +0 -0
  63. data/app/{packs → assets}/svgs/thumbs-up.svg +0 -0
  64. data/app/{packs → assets}/svgs/times.svg +0 -0
  65. data/app/{packs → assets}/svgs/trash-sm.svg +0 -0
  66. data/app/{packs → assets}/svgs/trash.svg +0 -0
  67. data/app/{packs → assets}/svgs/view-grid-add.svg +0 -0
  68. data/app/{packs → assets}/svgs/view-grid.svg +0 -0
  69. data/app/{packs → assets}/svgs/view-list.svg +0 -0
  70. data/app/{packs → assets}/svgs/x-circle-sm.svg +0 -0
  71. data/app/{packs → assets}/svgs/x-circle.svg +0 -0
  72. data/app/components/avo/resource_component.rb +0 -4
  73. data/app/components/avo/views/resource_edit_component.html.erb +1 -1
  74. data/app/components/avo/views/resource_edit_component.rb +6 -0
  75. data/app/components/avo/views/resource_index_component.html.erb +1 -1
  76. data/app/components/avo/views/resource_index_component.rb +21 -9
  77. data/app/components/avo/views/resource_new_component.html.erb +6 -4
  78. data/app/components/avo/views/resource_new_component.rb +6 -0
  79. data/app/components/avo/views/resource_show_component.html.erb +2 -2
  80. data/app/components/avo/views/resource_show_component.rb +9 -1
  81. data/app/controllers/avo/application_controller.rb +15 -0
  82. data/app/controllers/avo/base_controller.rb +43 -15
  83. data/app/helpers/avo/application_helper.rb +1 -12
  84. data/app/{packs/entrypoints/application.js → javascript/avo.js} +3 -18
  85. data/{public/avo-packs/media/images/dadf2db36589607d107d.png → app/javascript/images/logo.png} +0 -0
  86. data/app/{packs → javascript}/js/active-storage.js +0 -0
  87. data/app/javascript/js/application.js +9 -0
  88. data/app/{packs → javascript}/js/controllers/action_controller.js +1 -1
  89. data/app/{packs → javascript}/js/controllers/actions_picker_controller.js +0 -0
  90. data/app/{packs → javascript}/js/controllers/alerts_controller.js +0 -0
  91. data/app/{packs → javascript}/js/controllers/attachments_controller.js +0 -0
  92. data/app/{packs → javascript}/js/controllers/boolean_filter_controller.js +0 -0
  93. data/app/{packs → javascript}/js/controllers/fields/belongs_to_field_controller.js +0 -0
  94. data/app/{packs → javascript}/js/controllers/fields/code_field_controller.js +2 -1
  95. data/app/{packs → javascript}/js/controllers/fields/date_field_controller.js +1 -1
  96. data/app/{packs → javascript}/js/controllers/fields/key_value_controller.js +1 -1
  97. data/app/{packs → javascript}/js/controllers/fields/simple_mde_controller.js +0 -0
  98. data/app/{packs → javascript}/js/controllers/fields/trix_field_controller.js +1 -1
  99. data/app/{packs → javascript}/js/controllers/filter_controller.js +0 -0
  100. data/app/{packs → javascript}/js/controllers/hidden_input_controller.js +0 -0
  101. data/app/{packs → javascript}/js/controllers/item_select_all_controller.js +0 -0
  102. data/app/{packs → javascript}/js/controllers/item_selector_controller.js +0 -0
  103. data/app/{packs → javascript}/js/controllers/loading_button_controller.js +0 -0
  104. data/app/{packs → javascript}/js/controllers/modal_controller.js +0 -0
  105. data/app/{packs → javascript}/js/controllers/multiple_select_filter_controller.js +0 -0
  106. data/app/{packs → javascript}/js/controllers/per_page_controller.js +0 -0
  107. data/app/{packs → javascript}/js/controllers/search_controller.js +1 -1
  108. data/app/{packs → javascript}/js/controllers/select_filter_controller.js +0 -0
  109. data/app/{packs → javascript}/js/controllers/text_filter_controller.js +0 -0
  110. data/app/{packs → javascript}/js/controllers/tippy_controller.js +0 -0
  111. data/app/{packs → javascript}/js/controllers/toggle_panel_controller.js +0 -0
  112. data/app/javascript/js/controllers.js +53 -0
  113. data/app/{packs → javascript}/js/helpers/cast_boolean.js +0 -0
  114. data/app/{packs → javascript}/js/helpers/debounce_promise.js +0 -0
  115. data/app/{packs → javascript}/js/toastr.js +0 -0
  116. data/app/views/avo/partials/_logo.html.erb +1 -1
  117. data/app/views/layouts/avo/application.html.erb +7 -2
  118. data/avo.gemspec +1 -2
  119. data/bin/dev +9 -0
  120. data/bin/test +2 -1
  121. data/lib/avo/base_resource.rb +4 -3
  122. data/lib/avo/engine.rb +2 -16
  123. data/lib/avo/fields/base_field.rb +7 -2
  124. data/lib/avo/fields/key_value_field.rb +4 -4
  125. data/lib/avo/version.rb +1 -1
  126. data/lib/avo.rb +0 -18
  127. data/lib/generators/avo/templates/locales/avo.en.yml +10 -3
  128. data/lib/generators/avo/templates/locales/avo.ro.yml +7 -0
  129. data/public/avo-assets/avo.css +8477 -0
  130. data/public/avo-assets/avo.js +87744 -0
  131. data/public/avo-assets/avo.js.map +7 -0
  132. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.eot +0 -0
  133. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.svg +0 -0
  134. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.ttf +0 -0
  135. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.woff +0 -0
  136. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.woff2 +0 -0
  137. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.eot +0 -0
  138. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.svg +0 -0
  139. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.ttf +0 -0
  140. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.woff +0 -0
  141. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.woff2 +0 -0
  142. metadata +117 -170
  143. data/app/assets/stylesheets/avo/application.css +0 -15
  144. data/app/packs/importmap.json.erb +0 -5
  145. data/app/packs/stylesheets/fonts.css +0 -26
  146. data/bin/webpack +0 -20
  147. data/bin/webpack-dev-server +0 -18
  148. data/config/webpack/aliases.js +0 -10
  149. data/config/webpack/base.js +0 -14
  150. data/config/webpack/development.js +0 -5
  151. data/config/webpack/production.js +0 -5
  152. data/config/webpack/test.js +0 -5
  153. data/config/webpacker.yml +0 -79
  154. data/public/avo-packs/css/application-c3b50b28.css +0 -6329
  155. data/public/avo-packs/css/application-c3b50b28.css.br +0 -0
  156. data/public/avo-packs/css/application-c3b50b28.css.gz +0 -0
  157. data/public/avo-packs/css/application-c3b50b28.css.map +0 -1
  158. data/public/avo-packs/css/application-c3b50b28.css.map.br +0 -0
  159. data/public/avo-packs/css/application-c3b50b28.css.map.gz +0 -0
  160. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js +0 -2
  161. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.br +0 -0
  162. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.gz +0 -0
  163. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.map +0 -1
  164. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.map.br +0 -0
  165. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.map.gz +0 -0
  166. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js +0 -26
  167. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.LICENSE.txt +0 -77
  168. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.br +0 -0
  169. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.gz +0 -0
  170. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.map +0 -1
  171. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.map.br +0 -0
  172. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.map.gz +0 -0
  173. data/public/avo-packs/manifest.json +0 -52
  174. data/public/avo-packs/media/images/13ae283c0d7cc04efe7e.svg +0 -380
  175. data/public/avo-packs/media/images/13ae283c0d7cc04efe7e.svg.br +0 -0
  176. data/public/avo-packs/media/images/13ae283c0d7cc04efe7e.svg.gz +0 -0
  177. data/public/avo-packs/media/images/195026a50008c53526ef.svg +0 -388
  178. data/public/avo-packs/media/images/195026a50008c53526ef.svg.br +0 -0
  179. data/public/avo-packs/media/images/195026a50008c53526ef.svg.gz +0 -0
  180. data/public/avo-packs/media/images/1f30e08faa7c60d1f7ac.woff +0 -0
  181. data/public/avo-packs/media/images/1fd17dabf6b7d2b15348.ttf +0 -0
  182. data/public/avo-packs/media/images/1fd17dabf6b7d2b15348.ttf.br +0 -0
  183. data/public/avo-packs/media/images/1fd17dabf6b7d2b15348.ttf.gz +0 -0
  184. data/public/avo-packs/media/images/39a18f443d434999b89b.woff2 +0 -0
  185. data/public/avo-packs/media/images/4ad349571e28bb59c5a5.woff2 +0 -0
  186. data/public/avo-packs/media/images/57a5470848663767abbf.eot +0 -0
  187. data/public/avo-packs/media/images/b2e4cf0fab6c8ca66b7f.ttf +0 -0
  188. data/public/avo-packs/media/images/b2e4cf0fab6c8ca66b7f.ttf.br +0 -0
  189. data/public/avo-packs/media/images/b2e4cf0fab6c8ca66b7f.ttf.gz +0 -0
  190. data/public/avo-packs/media/images/b78d61ab7e046de8c156.eot +0 -0
  191. data/public/avo-packs/media/images/c9ab29becb76ddab01d0.woff +0 -0
@@ -4,15 +4,14 @@ import 'core-js/stable'
4
4
  import 'regenerator-runtime/runtime'
5
5
  import * as ActiveStorage from '@rails/activestorage'
6
6
  import * as Mousetrap from 'mousetrap'
7
- import { Application } from 'stimulus'
8
7
  import { Turbo } from '@hotwired/turbo-rails'
9
- import { definitionsFromContext } from 'stimulus/webpack-helpers'
10
8
  import Rails from '@rails/ujs'
11
9
  import tippy from 'tippy.js'
12
10
 
13
11
  // Toastr alerts
14
- import '../js/active-storage'
15
- import '../js/toastr'
12
+ import './js/active-storage'
13
+ import './js/controllers'
14
+ import './js/toastr'
16
15
 
17
16
  Rails.start()
18
17
 
@@ -33,15 +32,8 @@ function initTippy() {
33
32
  }
34
33
  window.initTippy = initTippy
35
34
 
36
- const application = Application.start()
37
35
  ActiveStorage.start()
38
36
 
39
- const context = require.context('./../js/controllers', true, /\.js$/)
40
- application.load(definitionsFromContext(context))
41
-
42
- const fieldsContext = require.context('./../js/controllers/fields', true, /\.js$/)
43
- application.load(definitionsFromContext(fieldsContext))
44
-
45
37
  document.addEventListener('turbo:load', () => {
46
38
  document.body.classList.remove('turbo-loading')
47
39
  initTippy()
@@ -58,10 +50,3 @@ document.addEventListener('turbo:submit-start', () => document.body.classList.ad
58
50
  document.addEventListener('turbo:before-cache', () => {
59
51
  document.querySelectorAll('[data-turbo-remove-before-cache]').forEach((element) => element.remove())
60
52
  })
61
-
62
- // Uncomment to copy all static images under ../images to the output folder and reference
63
- // them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
64
- // or the `imagePath` JavaScript helper below.
65
- //
66
- const images = require.context('../images', true)
67
- const imagePath = (name) => images(name, true)
File without changes
@@ -0,0 +1,9 @@
1
+ import { Application } from 'stimulus'
2
+
3
+ const application = Application.start()
4
+
5
+ // Configure Stimulus development experience
6
+ application.debug = false
7
+ window.Stimulus = application
8
+
9
+ export { application }
@@ -1,5 +1,5 @@
1
1
  import { Controller } from 'stimulus'
2
- import { castBoolean } from '@/js/helpers/cast_boolean'
2
+ import { castBoolean } from '../helpers/cast_boolean'
3
3
 
4
4
  export default class extends Controller {
5
5
  static targets = ['controllerDiv', 'resourceIds', 'form']
@@ -15,9 +15,10 @@ import 'codemirror/mode/xml/xml'
15
15
  import 'codemirror/mode/yaml/yaml'
16
16
 
17
17
  import { Controller } from 'stimulus'
18
- import { castBoolean } from '@/js/helpers/cast_boolean'
19
18
  import CodeMirror from 'codemirror'
20
19
 
20
+ import { castBoolean } from '../../helpers/cast_boolean'
21
+
21
22
  export default class extends Controller {
22
23
  static targets = ['element']
23
24
 
@@ -1,6 +1,6 @@
1
1
  import { Controller } from 'stimulus'
2
2
  import { DateTime } from 'luxon'
3
- import { castBoolean } from '@/js/helpers/cast_boolean'
3
+ import { castBoolean } from '../../helpers/cast_boolean'
4
4
  import flatpickr from 'flatpickr'
5
5
 
6
6
  export default class extends Controller {
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable max-len */
2
2
  import { Controller } from 'stimulus'
3
- import { castBoolean } from '@/js/helpers/cast_boolean'
3
+ import { castBoolean } from '../../helpers/cast_boolean'
4
4
 
5
5
  export default class extends Controller {
6
6
  static targets = ['input', 'controller', 'rows']
@@ -1,6 +1,6 @@
1
1
  import 'trix'
2
2
  import { Controller } from 'stimulus'
3
- import { castBoolean } from '@/js/helpers/cast_boolean'
3
+ import { castBoolean } from '../../helpers/cast_boolean'
4
4
 
5
5
  export default class extends Controller {
6
6
  static targets = ['editor', 'controller']
@@ -3,7 +3,7 @@ import * as Mousetrap from 'mousetrap'
3
3
  import { Controller } from 'stimulus'
4
4
  import { Turbo } from '@hotwired/turbo-rails'
5
5
  import { autocomplete } from '@algolia/autocomplete-js'
6
- import debouncePromise from '@/js/helpers/debounce_promise'
6
+ import debouncePromise from '../helpers/debounce_promise'
7
7
 
8
8
  export default class extends Controller {
9
9
  static targets = ['autocomplete', 'button']
@@ -0,0 +1,53 @@
1
+ import { application } from './application'
2
+
3
+ import ActionController from './controllers/action_controller'
4
+ import ActionsPickerController from './controllers/actions_picker_controller'
5
+ import AlertsController from './controllers/alerts_controller'
6
+ import AttachmentsController from './controllers/attachments_controller'
7
+ import BelongsToFieldController from './controllers/fields/belongs_to_field_controller'
8
+ import BooleanFilterController from './controllers/boolean_filter_controller'
9
+ import CodeFieldController from './controllers/fields/code_field_controller'
10
+ import DateFieldController from './controllers/fields/date_field_controller'
11
+ import FilterController from './controllers/filter_controller'
12
+ import HiddenInputController from './controllers/hidden_input_controller'
13
+ import ItemSelectAllController from './controllers/item_select_all_controller'
14
+ import ItemSelectorController from './controllers/item_selector_controller'
15
+ import KeyValueController from './controllers/fields/key_value_controller'
16
+ import LoadingButtonController from './controllers/loading_button_controller'
17
+ import ModalController from './controllers/modal_controller'
18
+ import MultipleSelectFilterController from './controllers/multiple_select_filter_controller'
19
+ import PerPageController from './controllers/per_page_controller'
20
+ import SearchController from './controllers/search_controller'
21
+ import SelectFilterController from './controllers/select_filter_controller'
22
+ import SimpleMdeController from './controllers/fields/simple_mde_controller'
23
+ import TextFilterController from './controllers/text_filter_controller'
24
+ import TippyController from './controllers/tippy_controller'
25
+ import TogglePanelController from './controllers/toggle_panel_controller'
26
+ import TrixFieldController from './controllers/fields/trix_field_controller'
27
+
28
+ application.register('action', ActionController)
29
+ application.register('actions-picker', ActionsPickerController)
30
+ application.register('alerts', AlertsController)
31
+ application.register('attachments', AttachmentsController)
32
+ application.register('boolean-filter', BooleanFilterController)
33
+ application.register('filter', FilterController)
34
+ application.register('hidden-input', HiddenInputController)
35
+ application.register('item-select-all', ItemSelectAllController)
36
+ application.register('item-selector', ItemSelectorController)
37
+ application.register('loading-button', LoadingButtonController)
38
+ application.register('modal', ModalController)
39
+ application.register('multiple-select-filter', MultipleSelectFilterController)
40
+ application.register('per-page', PerPageController)
41
+ application.register('search', SearchController)
42
+ application.register('select-filter', SelectFilterController)
43
+ application.register('text-filter', TextFilterController)
44
+ application.register('tippy', TippyController)
45
+ application.register('toggle-panel', TogglePanelController)
46
+
47
+ // Field controllers
48
+ application.register('belongs-to-field', BelongsToFieldController)
49
+ application.register('code-field', CodeFieldController)
50
+ application.register('date-field', DateFieldController)
51
+ application.register('key-value', KeyValueController)
52
+ application.register('simple-mde', SimpleMdeController)
53
+ application.register('trix-field', TrixFieldController)
File without changes
@@ -1 +1 @@
1
- <%= image_manifest_tag 'logo.png', class: 'h-full', title: 'Avo' %>
1
+ <%= image_tag 'avo/logo.png', class: 'h-full', title: 'Avo' %>
@@ -9,8 +9,13 @@
9
9
  <%= render partial: 'avo/partials/javascript' %>
10
10
  <%= render partial: 'avo/partials/head' %>
11
11
 
12
- <%= javascript_manifest_tag 'application' %>
13
- <%= stylesheet_manifest_tag 'application', media: 'all' %>
12
+ <% if Avo::PACKED %>
13
+ <%= javascript_include_tag "/avo-assets/avo", "data-turbo-track": "reload", defer: true %>
14
+ <%= stylesheet_link_tag "/avo-assets/avo", "data-turbo-track": "reload", defer: true %>
15
+ <% else %>
16
+ <%= javascript_include_tag "avo", "data-turbo-track": "reload", defer: true %>
17
+ <%= stylesheet_link_tag "avo", "data-turbo-track": "reload", defer: true %>
18
+ <% end %>
14
19
  </head>
15
20
  <body class="bg-blue-gray-200">
16
21
 
data/avo.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  "public gem pushes."
28
28
  end
29
29
 
30
- spec.post_install_message = "Thank you for using Avo! Docs are available at https://docs.avohq.io"
30
+ spec.post_install_message = "Thank you for using Avo 💪 Docs are available at https://docs.avohq.io"
31
31
 
32
32
  spec.files = Dir["{bin,app,config,db,lib,public}/**/*", "MIT-LICENSE", "Rakefile", "README.md", "avo.gemspec", "Gemfile", "Gemfile.lock"]
33
33
 
@@ -44,5 +44,4 @@ Gem::Specification.new do |spec|
44
44
  spec.add_dependency "addressable"
45
45
  spec.add_dependency "meta-tags"
46
46
  spec.add_dependency "breadcrumbs_on_rails"
47
- spec.add_dependency "manifester"
48
47
  end
data/bin/dev ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ if ! command -v foreman &> /dev/null
4
+ then
5
+ echo "Installing foreman..."
6
+ gem install foreman
7
+ fi
8
+
9
+ foreman start -f Procfile.dev
data/bin/test CHANGED
@@ -11,7 +11,8 @@ fi;
11
11
 
12
12
  # Run system tests
13
13
  if [[ -z "$1" ]] || [[ "$1" == "system" ]]; then
14
- bin/webpack
14
+ yarn build
15
+ yarn build:css
15
16
  bundle exec rspec ./spec --tag type:system
16
17
  fi;
17
18
 
@@ -343,8 +343,9 @@ module Avo
343
343
 
344
344
  reflection = @model._reflections[@params[:via_relation]]
345
345
 
346
- if field.polymorphic_as.present? && field.types.map(&:to_s).include?(@params["via_relation_class"])
347
- value = @params["via_relation_class"].safe_constantize.find(@params[:via_resource_id])
346
+ if field.polymorphic_as.present? && field.types.map(&:to_s).include?(@params[:via_relation_class])
347
+ # set the value to the actual record
348
+ value = @params[:via_relation_class].safe_constantize.find(@params[:via_resource_id])
348
349
  elsif reflection.present? && reflection.foreign_key.present? && field.id.to_s == @params[:via_relation].to_s
349
350
  value = @params[:via_resource_id]
350
351
  end
@@ -441,7 +442,7 @@ module Avo
441
442
  end
442
443
 
443
444
  def form_scope
444
- model.class.base_class.to_s.downcase
445
+ model.class.base_class.to_s.underscore.downcase
445
446
  end
446
447
  end
447
448
  end
data/lib/avo/engine.rb CHANGED
@@ -55,28 +55,14 @@ module Avo
55
55
  end
56
56
  end
57
57
 
58
- initializer "webpacker.proxy" do |app|
58
+ initializer "debug_exception_response_format" do |app|
59
59
  app.config.debug_exception_response_format = :api
60
60
  # app.config.logger = ::Logger.new(STDOUT)
61
-
62
- insert_middleware = begin
63
- Avo.webpacker.config.dev_server.present?
64
- rescue
65
- nil
66
- end
67
-
68
- if insert_middleware
69
- app.middleware.insert_before(
70
- 0, Webpacker::DevServerProxy,
71
- ssl_verify_none: true,
72
- webpacker: Avo.webpacker
73
- )
74
- end
75
61
  end
76
62
 
77
63
  config.app_middleware.use(
78
64
  Rack::Static,
79
- urls: ["/avo-packs"],
65
+ urls: ["/avo-assets"],
80
66
  root: Avo::Engine.root.join("public")
81
67
  )
82
68
 
@@ -19,7 +19,6 @@ module Avo
19
19
  attr_reader :nullable
20
20
  attr_reader :null_values
21
21
  attr_reader :format_using
22
- attr_reader :placeholder
23
22
  attr_reader :help
24
23
  attr_reader :default
25
24
  attr_reader :visible
@@ -57,7 +56,7 @@ module Avo
57
56
  @nullable = args[:nullable] || false
58
57
  @null_values = args[:null_values] || [nil, ""]
59
58
  @format_using = args[:format_using] || nil
60
- @placeholder = args[:placeholder] || id.to_s.humanize(keep_id_suffix: true)
59
+ @placeholder = args[:placeholder]
61
60
  @help = args[:help] || nil
62
61
  @default = args[:default] || nil
63
62
  @visible = args[:visible] || true
@@ -103,6 +102,12 @@ module Avo
103
102
  @id.to_s.humanize(keep_id_suffix: true)
104
103
  end
105
104
 
105
+ def placeholder
106
+ return @placeholder if @placeholder.present?
107
+
108
+ name
109
+ end
110
+
106
111
  def visible?
107
112
  if visible.present? && visible.respond_to?(:call)
108
113
  visible.call resource: @resource
@@ -15,10 +15,10 @@ module Avo
15
15
 
16
16
  hide_on :index
17
17
 
18
- @key_label = args[:key_label].present? ? args[:key_label].to_s : "Key"
19
- @value_label = args[:value_label].present? ? args[:value_label].to_s : "Value"
20
- @action_text = args[:action_text].present? ? args[:action_text].to_s : "Add row"
21
- @delete_text = args[:delete_text].present? ? args[:delete_text].to_s : "Delete row"
18
+ @key_label = args[:key_label].present? ? args[:key_label].to_s : I18n.translate('avo.key_value_field.key')
19
+ @value_label = args[:value_label].present? ? args[:value_label].to_s : I18n.translate('avo.key_value_field.value')
20
+ @action_text = args[:action_text].present? ? args[:action_text].to_s : I18n.translate('avo.key_value_field.add_row')
21
+ @delete_text = args[:delete_text].present? ? args[:delete_text].to_s : I18n.translate('avo.key_value_field.delete_row')
22
22
 
23
23
  @disable_editing_keys = args[:disable_editing_keys].present? ? args[:disable_editing_keys] : false
24
24
  # disabling editing keys also disables adding rows (doesn't take into account the value of disable_adding_rows)
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "1.19.0"
2
+ VERSION = "1.19.1.pre.4"
3
3
  end
data/lib/avo.rb CHANGED
@@ -13,24 +13,6 @@ module Avo
13
13
  class LicenseVerificationTemperedError < StandardError; end
14
14
 
15
15
  class LicenseInvalidError < StandardError; end
16
-
17
- class << self
18
- def webpacker
19
- @webpacker ||= ::Webpacker::Instance.new(
20
- root_path: ROOT_PATH,
21
- config_path: ROOT_PATH.join("config/webpacker.yml")
22
- )
23
- end
24
-
25
- def manifester
26
- @manifester ||= ::Manifester::Instance.new(
27
- root_path: ROOT_PATH,
28
- public_output_dir: "avo-packs",
29
- cache_manifest: Rails.env.production?,
30
- fallback_to_webpacker: -> { Avo::IN_DEVELOPMENT }
31
- )
32
- end
33
- end
34
16
  end
35
17
 
36
18
  loader.eager_load
@@ -8,7 +8,7 @@ en:
8
8
  run: 'Run'
9
9
  cancel: 'Cancel'
10
10
  action_ran_successfully: 'Action ran successfully!'
11
- resource_details: "%{item} details: %{title}"
11
+ resource_details: '%{item} details: %{title}'
12
12
  update_item: 'update %{item}: %{title}'
13
13
  unauthorized: 'Unauthorized'
14
14
  attachment_class_attached: '%{attachment_class} attached.'
@@ -16,8 +16,8 @@ en:
16
16
  resource_updated: 'Resource updated'
17
17
  resource_created: 'Resource created'
18
18
  resource_destroyed: 'Resource destroyed'
19
- switch_to_view: "Switch to %{view_type} view"
20
- click_to_reveal_filters: "Click to reveal filters"
19
+ switch_to_view: 'Switch to %{view_type} view'
20
+ click_to_reveal_filters: 'Click to reveal filters'
21
21
  attachment_destroyed: 'Attachment destroyed'
22
22
  failed_to_find_attachment: 'Failed to find attachment'
23
23
  you_missed_something_check_form: 'You might have missed something. Please check the form.'
@@ -86,3 +86,10 @@ en:
86
86
  sign_out: 'Sign out'
87
87
  failed: 'Failed'
88
88
  failed_to_load: 'Failed to load'
89
+ key_value_field:
90
+ key: 'Key'
91
+ value: 'Value'
92
+ add_row: 'Add row'
93
+ delete_row: 'Delete row'
94
+ was_successfully_created: 'was successfully created'
95
+ was_successfully_updated: 'was successfully updated'
@@ -71,3 +71,10 @@ ro:
71
71
  placeholder: 'Cauta'
72
72
  cancel_button: 'Anulare'
73
73
  sign_out: 'Delogare'
74
+ key_value_field:
75
+ key: 'Cheie'
76
+ value: 'Valoare'
77
+ add_row: 'Adauga rand'
78
+ delete_row: 'Sterge rand'
79
+ was_successfully_created: 'a fost creat'
80
+ was_successfully_updated: 'a fost actualizat'