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.
- checksums.yaml +4 -4
- data/Gemfile +3 -7
- data/Gemfile.lock +34 -51
- data/README.md +3 -0
- data/app/assets/builds/avo.css +8477 -0
- data/app/assets/builds/avo.js +87744 -0
- data/app/assets/builds/avo.js.map +7 -0
- data/app/assets/config/avo_manifest.js +2 -1
- data/app/{packs/images → assets/images/avo}/logo.png +0 -0
- data/app/{packs/entrypoints/application.css → assets/stylesheets/avo.css} +23 -24
- data/app/{packs/stylesheets → assets/stylesheets/css}/active-storage.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/alerts.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/breadcrumbs.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/components/code.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/components/progress.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/components/status.css +0 -0
- data/app/assets/stylesheets/css/fonts.css +26 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/loader.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/pagination.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/search.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/spinner.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/tailwindcss/base.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/tailwindcss/components.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/tailwindcss/utilities.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/tooltips.css +0 -0
- data/app/{packs/stylesheets → assets/stylesheets/css}/typography.css +0 -0
- data/app/{packs → assets}/svgs/arrow-circle-right.svg +0 -0
- data/app/{packs → assets}/svgs/arrow-left.svg +0 -0
- data/app/{packs → assets}/svgs/avocado.svg +0 -0
- data/app/{packs → assets}/svgs/badge-check-sm.svg +0 -0
- data/app/{packs → assets}/svgs/check-circle-sm.svg +0 -0
- data/app/{packs → assets}/svgs/check-circle.svg +0 -0
- data/app/{packs → assets}/svgs/chevron-down.svg +0 -0
- data/app/{packs → assets}/svgs/chevron-right.svg +0 -0
- data/app/{packs → assets}/svgs/chevron-up.svg +0 -0
- data/app/{packs → assets}/svgs/code.svg +0 -0
- data/app/{packs → assets}/svgs/color-swatch.svg +0 -0
- data/app/{packs → assets}/svgs/document-text.svg +0 -0
- data/app/{packs → assets}/svgs/download.svg +0 -0
- data/app/{packs → assets}/svgs/edit.svg +0 -0
- data/app/{packs → assets}/svgs/exclamation-circle-sm.svg +0 -0
- data/app/{packs → assets}/svgs/exclamation-sm.svg +0 -0
- data/app/{packs → assets}/svgs/exclamation.svg +0 -0
- data/app/{packs → assets}/svgs/eye.svg +0 -0
- data/app/{packs → assets}/svgs/filter.svg +0 -0
- data/app/{packs → assets}/svgs/fire.svg +0 -0
- data/app/{packs → assets}/svgs/game-board.svg +0 -0
- data/app/{packs → assets}/svgs/globe.svg +0 -0
- data/app/{packs → assets}/svgs/information-circle-sm.svg +0 -0
- data/app/{packs → assets}/svgs/information-circle.svg +0 -0
- data/app/{packs → assets}/svgs/library.svg +0 -0
- data/app/{packs → assets}/svgs/photograph.svg +0 -0
- data/app/{packs → assets}/svgs/play.svg +0 -0
- data/app/{packs → assets}/svgs/plus-circle.svg +0 -0
- data/app/{packs → assets}/svgs/plus.svg +0 -0
- data/app/{packs → assets}/svgs/question-mark-circle.svg +0 -0
- data/app/{packs → assets}/svgs/save.svg +0 -0
- data/app/{packs → assets}/svgs/selector.svg +0 -0
- data/app/{packs → assets}/svgs/sort-ascending.svg +0 -0
- data/app/{packs → assets}/svgs/sort-descending.svg +0 -0
- data/app/{packs → assets}/svgs/switch-horizontal.svg +0 -0
- data/app/{packs → assets}/svgs/thumbs-down.svg +0 -0
- data/app/{packs → assets}/svgs/thumbs-up.svg +0 -0
- data/app/{packs → assets}/svgs/times.svg +0 -0
- data/app/{packs → assets}/svgs/trash-sm.svg +0 -0
- data/app/{packs → assets}/svgs/trash.svg +0 -0
- data/app/{packs → assets}/svgs/view-grid-add.svg +0 -0
- data/app/{packs → assets}/svgs/view-grid.svg +0 -0
- data/app/{packs → assets}/svgs/view-list.svg +0 -0
- data/app/{packs → assets}/svgs/x-circle-sm.svg +0 -0
- data/app/{packs → assets}/svgs/x-circle.svg +0 -0
- data/app/components/avo/resource_component.rb +0 -4
- data/app/components/avo/views/resource_edit_component.html.erb +1 -1
- data/app/components/avo/views/resource_edit_component.rb +6 -0
- data/app/components/avo/views/resource_index_component.html.erb +1 -1
- data/app/components/avo/views/resource_index_component.rb +21 -9
- data/app/components/avo/views/resource_new_component.html.erb +6 -4
- data/app/components/avo/views/resource_new_component.rb +6 -0
- data/app/components/avo/views/resource_show_component.html.erb +2 -2
- data/app/components/avo/views/resource_show_component.rb +9 -1
- data/app/controllers/avo/application_controller.rb +15 -0
- data/app/controllers/avo/base_controller.rb +43 -15
- data/app/helpers/avo/application_helper.rb +1 -12
- data/app/{packs/entrypoints/application.js → javascript/avo.js} +3 -18
- data/{public/avo-packs/media/images/dadf2db36589607d107d.png → app/javascript/images/logo.png} +0 -0
- data/app/{packs → javascript}/js/active-storage.js +0 -0
- data/app/javascript/js/application.js +9 -0
- data/app/{packs → javascript}/js/controllers/action_controller.js +1 -1
- data/app/{packs → javascript}/js/controllers/actions_picker_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/alerts_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/attachments_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/boolean_filter_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/fields/belongs_to_field_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/fields/code_field_controller.js +2 -1
- data/app/{packs → javascript}/js/controllers/fields/date_field_controller.js +1 -1
- data/app/{packs → javascript}/js/controllers/fields/key_value_controller.js +1 -1
- data/app/{packs → javascript}/js/controllers/fields/simple_mde_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/fields/trix_field_controller.js +1 -1
- data/app/{packs → javascript}/js/controllers/filter_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/hidden_input_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/item_select_all_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/item_selector_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/loading_button_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/modal_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/multiple_select_filter_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/per_page_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/search_controller.js +1 -1
- data/app/{packs → javascript}/js/controllers/select_filter_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/text_filter_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/tippy_controller.js +0 -0
- data/app/{packs → javascript}/js/controllers/toggle_panel_controller.js +0 -0
- data/app/javascript/js/controllers.js +53 -0
- data/app/{packs → javascript}/js/helpers/cast_boolean.js +0 -0
- data/app/{packs → javascript}/js/helpers/debounce_promise.js +0 -0
- data/app/{packs → javascript}/js/toastr.js +0 -0
- data/app/views/avo/partials/_logo.html.erb +1 -1
- data/app/views/layouts/avo/application.html.erb +7 -2
- data/avo.gemspec +1 -2
- data/bin/dev +9 -0
- data/bin/test +2 -1
- data/lib/avo/base_resource.rb +4 -3
- data/lib/avo/engine.rb +2 -16
- data/lib/avo/fields/base_field.rb +7 -2
- data/lib/avo/fields/key_value_field.rb +4 -4
- data/lib/avo/version.rb +1 -1
- data/lib/avo.rb +0 -18
- data/lib/generators/avo/templates/locales/avo.en.yml +10 -3
- data/lib/generators/avo/templates/locales/avo.ro.yml +7 -0
- data/public/avo-assets/avo.css +8477 -0
- data/public/avo-assets/avo.js +87744 -0
- data/public/avo-assets/avo.js.map +7 -0
- data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.eot +0 -0
- data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.svg +0 -0
- data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.ttf +0 -0
- data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.woff +0 -0
- data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-700.woff2 +0 -0
- data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.eot +0 -0
- data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.svg +0 -0
- data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.ttf +0 -0
- data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.woff +0 -0
- data/{app/packs → public/avo-assets}/fonts/nunito-v16-latin-regular.woff2 +0 -0
- metadata +117 -170
- data/app/assets/stylesheets/avo/application.css +0 -15
- data/app/packs/importmap.json.erb +0 -5
- data/app/packs/stylesheets/fonts.css +0 -26
- data/bin/webpack +0 -20
- data/bin/webpack-dev-server +0 -18
- data/config/webpack/aliases.js +0 -10
- data/config/webpack/base.js +0 -14
- data/config/webpack/development.js +0 -5
- data/config/webpack/production.js +0 -5
- data/config/webpack/test.js +0 -5
- data/config/webpacker.yml +0 -79
- data/public/avo-packs/css/application-c3b50b28.css +0 -6329
- data/public/avo-packs/css/application-c3b50b28.css.br +0 -0
- data/public/avo-packs/css/application-c3b50b28.css.gz +0 -0
- data/public/avo-packs/css/application-c3b50b28.css.map +0 -1
- data/public/avo-packs/css/application-c3b50b28.css.map.br +0 -0
- data/public/avo-packs/css/application-c3b50b28.css.map.gz +0 -0
- data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js +0 -2
- data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.br +0 -0
- data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.gz +0 -0
- data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.map +0 -1
- data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.map.br +0 -0
- data/public/avo-packs/js/actioncable-7119dbc1a908641fb263.chunk.js.map.gz +0 -0
- data/public/avo-packs/js/application-6fc968cfa52976c4582b.js +0 -26
- data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.LICENSE.txt +0 -77
- data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.br +0 -0
- data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.gz +0 -0
- data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.map +0 -1
- data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.map.br +0 -0
- data/public/avo-packs/js/application-6fc968cfa52976c4582b.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +0 -52
- data/public/avo-packs/media/images/13ae283c0d7cc04efe7e.svg +0 -380
- data/public/avo-packs/media/images/13ae283c0d7cc04efe7e.svg.br +0 -0
- data/public/avo-packs/media/images/13ae283c0d7cc04efe7e.svg.gz +0 -0
- data/public/avo-packs/media/images/195026a50008c53526ef.svg +0 -388
- data/public/avo-packs/media/images/195026a50008c53526ef.svg.br +0 -0
- data/public/avo-packs/media/images/195026a50008c53526ef.svg.gz +0 -0
- data/public/avo-packs/media/images/1f30e08faa7c60d1f7ac.woff +0 -0
- data/public/avo-packs/media/images/1fd17dabf6b7d2b15348.ttf +0 -0
- data/public/avo-packs/media/images/1fd17dabf6b7d2b15348.ttf.br +0 -0
- data/public/avo-packs/media/images/1fd17dabf6b7d2b15348.ttf.gz +0 -0
- data/public/avo-packs/media/images/39a18f443d434999b89b.woff2 +0 -0
- data/public/avo-packs/media/images/4ad349571e28bb59c5a5.woff2 +0 -0
- data/public/avo-packs/media/images/57a5470848663767abbf.eot +0 -0
- data/public/avo-packs/media/images/b2e4cf0fab6c8ca66b7f.ttf +0 -0
- data/public/avo-packs/media/images/b2e4cf0fab6c8ca66b7f.ttf.br +0 -0
- data/public/avo-packs/media/images/b2e4cf0fab6c8ca66b7f.ttf.gz +0 -0
- data/public/avo-packs/media/images/b78d61ab7e046de8c156.eot +0 -0
- 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 '
|
15
|
-
import '
|
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)
|
data/{public/avo-packs/media/images/dadf2db36589607d107d.png → app/javascript/images/logo.png}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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 '
|
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 '
|
3
|
+
import { castBoolean } from '../../helpers/cast_boolean'
|
4
4
|
|
5
5
|
export default class extends Controller {
|
6
6
|
static targets = ['input', 'controller', 'rows']
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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 '
|
6
|
+
import debouncePromise from '../helpers/debounce_promise'
|
7
7
|
|
8
8
|
export default class extends Controller {
|
9
9
|
static targets = ['autocomplete', 'button']
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -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
|
File without changes
|
File without changes
|
@@ -1 +1 @@
|
|
1
|
-
<%=
|
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
|
-
|
13
|
-
|
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
|
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
data/bin/test
CHANGED
data/lib/avo/base_resource.rb
CHANGED
@@ -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[
|
347
|
-
value
|
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 "
|
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-
|
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]
|
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 :
|
19
|
-
@value_label = args[:value_label].present? ? args[:value_label].to_s :
|
20
|
-
@action_text = args[:action_text].present? ? args[:action_text].to_s :
|
21
|
-
@delete_text = args[:delete_text].present? ? args[:delete_text].to_s :
|
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
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:
|
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:
|
20
|
-
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'
|