avo 1.19.1.pre.3 → 1.19.1.pre.7

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 (200) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -7
  3. data/Gemfile.lock +31 -51
  4. data/README.md +3 -0
  5. data/app/assets/builds/avo.css +8590 -0
  6. data/app/assets/builds/avo.js +87755 -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} +31 -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 +1 -1
  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/edit/field_wrapper_component.html.erb +1 -1
  73. data/app/components/avo/fields/common/files_list_viewer_component.html.erb +1 -1
  74. data/app/components/avo/fields/common/heading_component.html.erb +1 -1
  75. data/app/components/avo/index/field_wrapper_component.html.erb +1 -1
  76. data/app/components/avo/index/table_row_component.html.erb +1 -1
  77. data/app/components/avo/resource_component.rb +0 -4
  78. data/app/components/avo/show/field_wrapper_component.html.erb +1 -1
  79. data/app/components/avo/views/resource_index_component.rb +18 -8
  80. data/app/components/avo/views/resource_new_component.html.erb +1 -1
  81. data/app/controllers/avo/base_controller.rb +39 -9
  82. data/app/helpers/avo/application_helper.rb +4 -16
  83. data/app/{packs/entrypoints/application.js → javascript/avo.js} +15 -18
  84. data/app/{packs → javascript}/js/active-storage.js +0 -0
  85. data/app/javascript/js/application.js +9 -0
  86. data/app/{packs → javascript}/js/controllers/action_controller.js +1 -1
  87. data/app/{packs → javascript}/js/controllers/actions_picker_controller.js +0 -0
  88. data/app/{packs → javascript}/js/controllers/alerts_controller.js +0 -0
  89. data/app/{packs → javascript}/js/controllers/attachments_controller.js +0 -0
  90. data/app/{packs → javascript}/js/controllers/boolean_filter_controller.js +0 -0
  91. data/app/{packs → javascript}/js/controllers/fields/belongs_to_field_controller.js +0 -0
  92. data/app/{packs → javascript}/js/controllers/fields/code_field_controller.js +2 -1
  93. data/app/{packs → javascript}/js/controllers/fields/date_field_controller.js +1 -1
  94. data/app/{packs → javascript}/js/controllers/fields/key_value_controller.js +1 -1
  95. data/app/{packs → javascript}/js/controllers/fields/simple_mde_controller.js +0 -0
  96. data/app/{packs → javascript}/js/controllers/fields/trix_field_controller.js +1 -1
  97. data/app/{packs → javascript}/js/controllers/filter_controller.js +0 -0
  98. data/app/{packs → javascript}/js/controllers/hidden_input_controller.js +0 -0
  99. data/app/{packs → javascript}/js/controllers/item_select_all_controller.js +0 -0
  100. data/app/{packs → javascript}/js/controllers/item_selector_controller.js +0 -0
  101. data/app/{packs → javascript}/js/controllers/loading_button_controller.js +0 -0
  102. data/app/{packs → javascript}/js/controllers/modal_controller.js +0 -0
  103. data/app/{packs → javascript}/js/controllers/multiple_select_filter_controller.js +0 -0
  104. data/app/{packs → javascript}/js/controllers/per_page_controller.js +0 -0
  105. data/app/{packs → javascript}/js/controllers/search_controller.js +1 -1
  106. data/app/{packs → javascript}/js/controllers/select_filter_controller.js +0 -0
  107. data/app/{packs → javascript}/js/controllers/text_filter_controller.js +0 -0
  108. data/app/{packs → javascript}/js/controllers/tippy_controller.js +0 -0
  109. data/app/{packs → javascript}/js/controllers/toggle_panel_controller.js +0 -0
  110. data/app/javascript/js/controllers.js +53 -0
  111. data/app/{packs → javascript}/js/helpers/cast_boolean.js +0 -0
  112. data/app/{packs → javascript}/js/helpers/debounce_promise.js +0 -0
  113. data/app/{packs → javascript}/js/toastr.js +0 -0
  114. data/app/views/avo/actions/show.html.erb +1 -1
  115. data/app/views/avo/base/_actions.html.erb +1 -1
  116. data/app/views/avo/base/_filters.html.erb +3 -3
  117. data/app/views/avo/home/_actions.html.erb +1 -1
  118. data/app/views/avo/home/_filters.html.erb +1 -1
  119. data/app/views/avo/home/_resources.html.erb +2 -2
  120. data/app/views/avo/partials/_footer.html.erb +1 -1
  121. data/app/views/avo/partials/_global_search.html.erb +4 -1
  122. data/app/views/avo/partials/_logo.html.erb +1 -1
  123. data/app/views/avo/partials/_paginator.html.erb +3 -3
  124. data/app/views/avo/partials/_table_header.html.erb +2 -2
  125. data/app/views/layouts/avo/application.html.erb +9 -4
  126. data/avo.gemspec +1 -2
  127. data/bin/dev +9 -0
  128. data/bin/test +2 -1
  129. data/lib/avo/base_resource.rb +4 -3
  130. data/lib/avo/configuration.rb +6 -0
  131. data/lib/avo/engine.rb +2 -16
  132. data/lib/avo/version.rb +1 -1
  133. data/lib/avo.rb +0 -18
  134. data/lib/generators/avo/filter_generator.rb +2 -0
  135. data/lib/generators/avo/templates/filters/text_filter.tt +8 -0
  136. data/lib/generators/avo/templates/initializer/avo.tt +4 -5
  137. data/public/avo-assets/avo.css +8590 -0
  138. data/public/avo-assets/avo.js +87755 -0
  139. data/public/avo-assets/avo.js.map +7 -0
  140. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.eot +0 -0
  141. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.svg +0 -0
  142. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.ttf +0 -0
  143. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.woff +0 -0
  144. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.woff2 +0 -0
  145. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.eot +0 -0
  146. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.svg +0 -0
  147. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.ttf +0 -0
  148. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.woff +0 -0
  149. data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.woff2 +0 -0
  150. metadata +115 -168
  151. data/app/assets/stylesheets/avo/application.css +0 -15
  152. data/app/packs/importmap.json.erb +0 -5
  153. data/app/packs/stylesheets/fonts.css +0 -26
  154. data/bin/webpack +0 -20
  155. data/bin/webpack-dev-server +0 -18
  156. data/config/webpack/aliases.js +0 -10
  157. data/config/webpack/base.js +0 -14
  158. data/config/webpack/development.js +0 -5
  159. data/config/webpack/production.js +0 -5
  160. data/config/webpack/test.js +0 -5
  161. data/config/webpacker.yml +0 -79
  162. data/public/avo-packs/css/application-c3b50b28.css +0 -6329
  163. data/public/avo-packs/css/application-c3b50b28.css.br +0 -0
  164. data/public/avo-packs/css/application-c3b50b28.css.gz +0 -0
  165. data/public/avo-packs/css/application-c3b50b28.css.map +0 -1
  166. data/public/avo-packs/css/application-c3b50b28.css.map.br +0 -0
  167. data/public/avo-packs/css/application-c3b50b28.css.map.gz +0 -0
  168. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js +0 -2
  169. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.br +0 -0
  170. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.gz +0 -0
  171. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.map +0 -1
  172. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.map.br +0 -0
  173. data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.map.gz +0 -0
  174. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js +0 -26
  175. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.LICENSE.txt +0 -77
  176. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.br +0 -0
  177. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.gz +0 -0
  178. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.map +0 -1
  179. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.map.br +0 -0
  180. data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.map.gz +0 -0
  181. data/public/avo-packs/manifest.json +0 -52
  182. data/public/avo-packs/media/images/13ae283c0d7cc04efe7e.svg +0 -380
  183. data/public/avo-packs/media/images/13ae283c0d7cc04efe7e.svg.br +0 -0
  184. data/public/avo-packs/media/images/13ae283c0d7cc04efe7e.svg.gz +0 -0
  185. data/public/avo-packs/media/images/195026a50008c53526ef.svg +0 -388
  186. data/public/avo-packs/media/images/195026a50008c53526ef.svg.br +0 -0
  187. data/public/avo-packs/media/images/195026a50008c53526ef.svg.gz +0 -0
  188. data/public/avo-packs/media/images/1f30e08faa7c60d1f7ac.woff +0 -0
  189. data/public/avo-packs/media/images/1fd17dabf6b7d2b15348.ttf +0 -0
  190. data/public/avo-packs/media/images/1fd17dabf6b7d2b15348.ttf.br +0 -0
  191. data/public/avo-packs/media/images/1fd17dabf6b7d2b15348.ttf.gz +0 -0
  192. data/public/avo-packs/media/images/39a18f443d434999b89b.woff2 +0 -0
  193. data/public/avo-packs/media/images/4ad349571e28bb59c5a5.woff2 +0 -0
  194. data/public/avo-packs/media/images/57a5470848663767abbf.eot +0 -0
  195. data/public/avo-packs/media/images/b2e4cf0fab6c8ca66b7f.ttf +0 -0
  196. data/public/avo-packs/media/images/b2e4cf0fab6c8ca66b7f.ttf.br +0 -0
  197. data/public/avo-packs/media/images/b2e4cf0fab6c8ca66b7f.ttf.gz +0 -0
  198. data/public/avo-packs/media/images/b78d61ab7e046de8c156.eot +0 -0
  199. data/public/avo-packs/media/images/c9ab29becb76ddab01d0.woff +0 -0
  200. data/public/avo-packs/media/images/dadf2db36589607d107d.png +0 -0
@@ -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
@@ -5,7 +5,7 @@
5
5
  data-action-target="controllerDiv"
6
6
  data-resource-name="<%= @resource.model_key %>"
7
7
  data-resource-id="<%= params[:id] %>"
8
- class="hidden text-blue-gray-800"
8
+ class="hidden text-slate-800"
9
9
  >
10
10
  <%= form_with model: @model, scope: 'fields', url: "#{@resource.records_path}/actions/#{@action.param_id}", data: {'turbo-frame': '_top', 'action-target': 'form'} do |form| %>
11
11
  <%= render Avo::ModalComponent.new do |c| %>
@@ -1,7 +1,7 @@
1
1
  <% if @actions.count > 0 %>
2
2
  <div class="relative z-40 js-actions-dropdown" data-controller="toggle-panel actions-picker">
3
3
  <%= a_button class: "focus:outline-none",
4
- color: 'light-blue',
4
+ color: 'sky',
5
5
  'data-action': "click->toggle-panel#togglePanel",
6
6
  'data-actions-dropdown-button': @resource.model_key do
7
7
  %>
@@ -1,7 +1,7 @@
1
1
  <div data-controller="toggle-panel">
2
2
  <div class="relative w-full flex justify-between z-30">
3
3
  <%= a_button class: 'focus:outline-none',
4
- color: 'blue-gray',
4
+ color: 'slate',
5
5
  title: t('avo.click_to_reveal_filters'),
6
6
  'data-button': 'resource-filters',
7
7
  'data-action': 'click->toggle-panel#togglePanel',
@@ -24,9 +24,9 @@
24
24
 
25
25
  <div class="p-4 border-gray-300 border-t">
26
26
  <% if params[:filters].present? %>
27
- <%= a_link t('avo.reset_filters'), resources_path(resource: @resource, filters: nil, keep_query_params: true), color: 'blue-gray', class: 'w-full justify-center' %>
27
+ <%= a_link t('avo.reset_filters'), resources_path(resource: @resource, filters: nil, keep_query_params: true), color: 'slate', class: 'w-full justify-center' %>
28
28
  <% else %>
29
- <%= a_button t('avo.reset_filters'), color: 'blue-gray', class: 'w-full justify-center', disabled: true %>
29
+ <%= a_button t('avo.reset_filters'), color: 'slate', class: 'w-full justify-center', disabled: true %>
30
30
  <% end %>
31
31
  </div>
32
32
  </div>
@@ -7,7 +7,7 @@
7
7
  <div class="mt-2">
8
8
  <code class="text-lg">Toggle published</code>
9
9
  <div class="mt-1">
10
- <code class="p-1 rounded bg-light-blue-500 text-white">bin/rails generate avo:action toggle_published</code>
10
+ <code class="p-1 rounded bg-sky-500 text-white">bin/rails generate avo:action toggle_published</code>
11
11
  </div>
12
12
  </div>
13
13
 
@@ -7,7 +7,7 @@
7
7
  <div class="mt-2">
8
8
  <code class="text-lg">Published filter</code>
9
9
  <div class="mt-1">
10
- <code class="p-1 rounded bg-light-blue-500 text-white">bin/rails generate avo:filter published_filter</code>
10
+ <code class="p-1 rounded bg-sky-500 text-white">bin/rails generate avo:filter published_filter</code>
11
11
  </div>
12
12
  </div>
13
13
 
@@ -20,7 +20,7 @@
20
20
  <% models.each do |model| %>
21
21
  <code class="text-lg"><%= model.to_s %></code>
22
22
  <div>
23
- <code class="p-1 rounded bg-light-blue-500 text-white">bin/rails generate avo:resource <%= model.to_s %></code>
23
+ <code class="p-1 rounded bg-sky-500 text-white">bin/rails generate avo:resource <%= model.to_s %></code>
24
24
  </div>
25
25
  <% end %>
26
26
  </div>
@@ -30,7 +30,7 @@
30
30
  You may generate a resource using the following command:
31
31
  <br>
32
32
 
33
- <code class="p-1 rounded bg-light-blue-500 text-white">bin/rails generate avo:resource post</code>
33
+ <code class="p-1 rounded bg-sky-500 text-white">bin/rails generate avo:resource post</code>
34
34
  </div>
35
35
  <% end %>
36
36
 
@@ -1,3 +1,3 @@
1
1
  <div class="text-center text-sm text-gray-700">
2
- <a href="https://avohq.io/" target="_blank">Avo</a> · &copy; <%= Date.today.year %> AvoHQ · v<%= Avo::VERSION %>
2
+ <a href="https://avohq.io/" target="_blank">Avo</a> · &copy; <%= Date.today.year %> AvoHQ · <span title="<%= Avo::App.license.valid ? 'valid' : 'invalid'%> <%= Avo::App.license.id %> license">v<%= Avo::VERSION %></span>
3
3
  </div>
@@ -10,7 +10,10 @@
10
10
  data-search-target="button"
11
11
  >
12
12
  <span class="sr-only">Press </span>
13
- <kbd class="font-sans"><abbr title="Command" class="no-underline">⌘</abbr></kbd>
13
+ <kbd class="font-sans">
14
+ <abbr title="Command" class="no-underline pc:hidden">⌘</abbr>
15
+ <abbr title="CTRL" class="no-underline mac:hidden">CTRL +&nbsp; </abbr>
16
+ </kbd>
14
17
  <span class="sr-only"> and </span>
15
18
  <kbd class="font-sans">K</kbd><span class="sr-only"> to search</span>
16
19
  </div>
@@ -1 +1 @@
1
- <%= image_manifest_tag 'logo.png', class: 'h-full', title: 'Avo' %>
1
+ <%= image_tag '/avo-assets/logo.png', class: 'h-full', title: 'Avo' %>
@@ -8,17 +8,17 @@
8
8
  per_page_options = per_page_options.sort.uniq
9
9
  %>
10
10
 
11
- <div class="bg-white px-4 flex items-center justify-between aborder-t aborder-blue-gray-200 sm:px-6 rounded-xl">
11
+ <div class="bg-white px-4 flex items-center justify-between aborder-t aborder-slate-200 sm:px-6 rounded-xl">
12
12
  <div class="hidden sm:flex-2 sm:flex sm:items-center sm:justify-between">
13
13
  <div>
14
- <div class="text-sm leading-5 text-blue-gray-600 flex items-center">
14
+ <div class="text-sm leading-5 text-slate-600 flex items-center">
15
15
  <div class="mr-2"><%== pagy_info @pagy %></div>
16
16
 
17
17
  <div data-controller="per-page">
18
18
  <div class="flex items-center">
19
19
  <%= select_tag 'per_page',
20
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',
21
+ class: 'appearance-none inline-flex bg-slate-100 disabled:bg-slate-400 disabled:cursor-not-allowed focus:bg-white text-slate-700 disabled:text-slate-600 rounded-md py-1 px-2 leading-tight border border-slate-300 outline-none focus:border-slate-400 outline w-16 mr-1 text-sm',
22
22
  data: {
23
23
  'turbo-frame': turbo_frame,
24
24
  'per-page-target': 'selector',
@@ -1,5 +1,5 @@
1
1
 
2
- <thead class="bg-blue-gray-100 border-t border-b border-gray-300 pb-1">
2
+ <thead class="bg-slate-100 border-t border-b border-gray-300 pb-1">
3
3
  <th>
4
4
  <%== item_select_all_input %>
5
5
  </th>
@@ -28,7 +28,7 @@
28
28
  sort_by = field.id
29
29
  sort_direction = 'desc'
30
30
  end
31
- classes = "text-blue-gray-600 tracking-tight leading-tight text-xs font-semibold"
31
+ classes = "text-slate-600 tracking-tight leading-tight text-xs font-semibold"
32
32
  %>
33
33
  <th class="text-left uppercase px-3 py-2 whitespace-nowrap">
34
34
  <% if field.sortable %>
@@ -9,10 +9,15 @@
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
- <body class="bg-blue-gray-200">
20
+ <body class="bg-slate-200 os-mac">
16
21
 
17
22
  <div id="app" class="flex min-h-screen flex-row h-full">
18
23
  <div class="flex flex-1 w-full">
@@ -24,7 +29,7 @@
24
29
  <%= render partial: "avo/partials/header" %>
25
30
  </div>
26
31
  <div class="flex-1 flex ml-4 pl-4">
27
- <%= render partial: "avo/partials/global_search" if ::Avo::App.license.has_with_trial(:global_search) %>
32
+ <%= render partial: "avo/partials/global_search" if ::Avo::App.license.has_with_trial(:global_search) && ::Avo.configuration.feature_enabled?(:global_search) %>
28
33
  </div>
29
34
  <div class="align-end">
30
35
  <%= render partial: "avo/partials/profile_dropdown" %>
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:js
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
@@ -27,6 +27,7 @@ module Avo
27
27
  attr_accessor :display_license_request_timeout_error
28
28
  attr_accessor :current_user_resource_name
29
29
  attr_accessor :raise_error_on_missing_policy
30
+ attr_accessor :disabled_features
30
31
 
31
32
  def initialize
32
33
  @root_path = "/avo"
@@ -66,6 +67,7 @@ module Avo
66
67
  @display_license_request_timeout_error = true
67
68
  @current_user_resource_name = "user"
68
69
  @raise_error_on_missing_policy = false
70
+ @disabled_features = []
69
71
  end
70
72
 
71
73
  def locale_tag
@@ -115,6 +117,10 @@ module Avo
115
117
  def computed_root_path
116
118
  Avo::App.root_path
117
119
  end
120
+
121
+ def feature_enabled?(feature)
122
+ !@disabled_features.map(&:to_sym).include?(feature.to_sym)
123
+ end
118
124
  end
119
125
 
120
126
  def self.configuration
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
 
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "1.19.1.pre.3"
2
+ VERSION = "1.19.1.pre.7"
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
@@ -5,6 +5,7 @@ module Generators
5
5
  class FilterGenerator < ::Rails::Generators::NamedBase
6
6
  source_root File.expand_path("templates", __dir__)
7
7
  class_option :select, type: :boolean
8
+ class_option :text, type: :boolean
8
9
 
9
10
  namespace "avo:filter"
10
11
 
@@ -12,6 +13,7 @@ module Generators
12
13
  type = "boolean"
13
14
 
14
15
  type = "select" if options[:select]
16
+ type = "text" if options[:text]
15
17
 
16
18
  template "filters/#{type}_filter.tt", "app/avo/filters/#{singular_name}.rb"
17
19
  end
@@ -0,0 +1,8 @@
1
+ class <%= class_name.camelize %> < Avo::Filters::TextFilter
2
+ self.name = '<%= name.underscore.humanize %>'
3
+ self.button_label = 'Filter by <%= class_name.underscore.humanize.downcase.gsub(' filter', '') %>'
4
+
5
+ def apply(request, query, value)
6
+ query
7
+ end
8
+ end
@@ -1,9 +1,10 @@
1
+ # For more information regaring these settings check out our docs https://docs.avohq.io
1
2
  Avo.configure do |config|
2
3
  ## == Routing ==
3
4
  config.root_path = '/<%= options[:path] %>'
4
5
 
5
6
  ## == Licensing ==
6
- config.license = 'community'
7
+ config.license = 'community' # change this to 'pro' when you add the license key
7
8
  # config.license_key = ENV['AVO_LICENSE_KEY']
8
9
 
9
10
  ## == Set the context ==
@@ -12,10 +13,8 @@ Avo.configure do |config|
12
13
  end
13
14
 
14
15
  ## == Authentication ==
15
- # config.current_user_method = :current_user
16
- # config.authenticate_with do
17
- # warden.authenticate! scope: :user
18
- # end
16
+ # config.current_user_method = {}
17
+ # config.authenticate_with = {}
19
18
 
20
19
  ## == Authorization ==
21
20
  # config.authorization_methods = {