avo 0.4.10 → 0.5.0.beta5
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 +37 -9
- data/Gemfile.lock +108 -85
- data/README.md +8 -0
- data/app/components/avo/common/badge_viewer_component.html.erb +24 -0
- data/app/components/avo/common/badge_viewer_component.rb +8 -0
- data/app/components/avo/common/boolean_check_component.html.erb +12 -0
- data/app/components/avo/common/boolean_check_component.rb +7 -0
- data/app/components/avo/common/boolean_group_component.html.erb +16 -0
- data/app/components/avo/common/boolean_group_component.rb +8 -0
- data/app/components/avo/common/files_list_viewer_component.html.erb +5 -0
- data/app/components/avo/common/files_list_viewer_component.rb +8 -0
- data/app/components/avo/common/gravatar_viewer_component.html.erb +12 -0
- data/app/components/avo/common/gravatar_viewer_component.rb +12 -0
- data/app/components/avo/common/heading_component.html.erb +13 -0
- data/app/components/avo/common/heading_component.rb +8 -0
- data/app/components/avo/common/multiple_file_viewer_component.html.erb +26 -0
- data/app/components/avo/common/multiple_file_viewer_component.rb +13 -0
- data/app/components/avo/common/single_file_viewer_component.html.erb +28 -0
- data/app/components/avo/common/single_file_viewer_component.rb +13 -0
- data/app/components/avo/common/status_viewer_component.html.erb +10 -0
- data/app/components/avo/common/status_viewer_component.rb +8 -0
- data/app/components/avo/edit/field_wrapper_component.html.erb +20 -0
- data/app/components/avo/edit/field_wrapper_component.rb +19 -0
- data/app/components/avo/edit/fields/belongs_to_field_component.html.erb +19 -0
- data/app/components/avo/edit/fields/belongs_to_field_component.rb +4 -0
- data/app/components/avo/edit/fields/boolean_field_component.html.erb +9 -0
- data/app/components/avo/edit/fields/boolean_field_component.rb +4 -0
- data/app/components/avo/edit/fields/boolean_group_field_component.html.erb +25 -0
- data/app/components/avo/edit/fields/boolean_group_field_component.rb +4 -0
- data/app/components/avo/edit/fields/code_field_component.html.erb +19 -0
- data/app/components/avo/edit/fields/code_field_component.rb +4 -0
- data/app/components/avo/edit/fields/country_field_component.html.erb +7 -0
- data/app/components/avo/edit/fields/country_field_component.rb +4 -0
- data/app/components/avo/edit/fields/date_field_component.html.erb +18 -0
- data/app/components/avo/edit/fields/date_field_component.rb +4 -0
- data/app/components/avo/edit/fields/date_time_field_component.html.erb +20 -0
- data/app/components/avo/edit/fields/date_time_field_component.rb +4 -0
- data/app/components/avo/edit/fields/external_image_field_component.html.erb +6 -0
- data/app/components/avo/edit/fields/external_image_field_component.rb +4 -0
- data/app/components/avo/edit/fields/field_component.rb +13 -0
- data/app/components/avo/edit/fields/file_field_component.html.erb +9 -0
- data/app/components/avo/edit/fields/file_field_component.rb +4 -0
- data/app/components/avo/edit/fields/files_field_component.html.erb +5 -0
- data/app/components/avo/edit/fields/files_field_component.rb +4 -0
- data/app/components/avo/edit/fields/heading_field_component.html.erb +3 -0
- data/app/components/avo/edit/fields/heading_field_component.rb +4 -0
- data/app/components/avo/edit/fields/hidden_field_component.html.erb +1 -0
- data/app/components/avo/edit/fields/hidden_field_component.rb +4 -0
- data/app/components/avo/edit/fields/id_field_component.html.erb +3 -0
- data/app/components/avo/edit/fields/id_field_component.rb +4 -0
- data/app/components/avo/edit/fields/markdown_field_component.html.erb +11 -0
- data/app/components/avo/edit/fields/markdown_field_component.rb +4 -0
- data/app/components/avo/edit/fields/number_field_component.html.erb +9 -0
- data/app/components/avo/edit/fields/number_field_component.rb +4 -0
- data/app/components/avo/edit/fields/password_field_component.html.erb +7 -0
- data/app/components/avo/edit/fields/password_field_component.rb +4 -0
- data/app/components/avo/edit/fields/select_field_component.html.erb +6 -0
- data/app/components/avo/edit/fields/select_field_component.rb +4 -0
- data/app/components/avo/edit/fields/status_field_component.html.erb +7 -0
- data/app/components/avo/edit/fields/status_field_component.rb +4 -0
- data/app/components/avo/edit/fields/text_field_component.html.erb +6 -0
- data/app/components/avo/edit/fields/text_field_component.rb +4 -0
- data/app/components/avo/edit/fields/textarea_field_component.html.erb +7 -0
- data/app/components/avo/edit/fields/textarea_field_component.rb +4 -0
- data/app/components/avo/edit/fields/trix_field_component.html.erb +11 -0
- data/app/components/avo/edit/fields/trix_field_component.rb +4 -0
- data/app/components/avo/index/field_wrapper_component.html.erb +7 -0
- data/app/components/avo/index/field_wrapper_component.rb +10 -0
- data/app/components/avo/index/fields/badge_field_component.html.erb +3 -0
- data/app/components/avo/index/fields/badge_field_component.rb +4 -0
- data/app/components/avo/index/fields/belongs_to_field_component.html.erb +7 -0
- data/app/components/avo/index/fields/belongs_to_field_component.rb +4 -0
- data/app/components/avo/index/fields/boolean_field_component.html.erb +3 -0
- data/app/components/avo/index/fields/boolean_field_component.rb +4 -0
- data/app/components/avo/index/fields/boolean_group_field_component.html.erb +3 -0
- data/app/components/avo/index/fields/boolean_group_field_component.rb +4 -0
- data/app/components/avo/index/fields/country_field_component.html.erb +7 -0
- data/app/components/avo/index/fields/country_field_component.rb +4 -0
- data/app/components/avo/index/fields/date_field_component.html.erb +3 -0
- data/app/components/avo/index/fields/date_field_component.rb +4 -0
- data/app/components/avo/index/fields/date_time_field_component.html.erb +3 -0
- data/app/components/avo/index/fields/date_time_field_component.rb +4 -0
- data/app/components/avo/index/fields/external_image_field_component.html.erb +9 -0
- data/app/components/avo/index/fields/external_image_field_component.rb +4 -0
- data/app/components/avo/index/fields/field_component.html.erb +1 -0
- data/app/components/avo/index/fields/field_component.rb +11 -0
- data/app/components/avo/index/fields/file_field_component.html.erb +11 -0
- data/app/components/avo/index/fields/file_field_component.rb +4 -0
- data/app/components/avo/index/fields/files_field_component.html.erb +3 -0
- data/app/components/avo/index/fields/files_field_component.rb +4 -0
- data/app/components/avo/index/fields/gravatar_field_component.html.erb +11 -0
- data/app/components/avo/index/fields/gravatar_field_component.rb +4 -0
- data/app/components/avo/index/fields/has_one_field_component.html.erb +7 -0
- data/app/components/avo/index/fields/has_one_field_component.rb +4 -0
- data/app/components/avo/index/fields/id_field_component.html.erb +10 -0
- data/app/components/avo/index/fields/id_field_component.rb +4 -0
- data/app/components/avo/index/fields/number_field_component.html.erb +3 -0
- data/app/components/avo/index/fields/number_field_component.rb +4 -0
- data/app/components/avo/index/fields/select_field_component.html.erb +3 -0
- data/app/components/avo/index/fields/select_field_component.rb +4 -0
- data/app/components/avo/index/fields/status_field_component.html.erb +3 -0
- data/app/components/avo/index/fields/status_field_component.rb +4 -0
- data/app/components/avo/index/fields/text_field_component.html.erb +3 -0
- data/app/components/avo/index/fields/text_field_component.rb +4 -0
- data/app/components/avo/index/grid_item_component.html.erb +41 -0
- data/app/components/avo/index/grid_item_component.rb +25 -0
- data/app/components/avo/index/resource_controls_component.html.erb +56 -0
- data/app/components/avo/index/resource_controls_component.rb +39 -0
- data/app/components/avo/index/resource_grid_component.html.erb +13 -0
- data/app/components/avo/index/resource_grid_component.rb +10 -0
- data/app/components/avo/index/resource_table_component.html.erb +16 -0
- data/app/components/avo/index/resource_table_component.rb +10 -0
- data/app/components/avo/index/table_row_component.html.erb +18 -0
- data/app/components/avo/index/table_row_component.rb +11 -0
- data/app/components/avo/loading_component.html.erb +10 -0
- data/app/components/avo/loading_component.rb +7 -0
- data/app/components/avo/modal_component.html.erb +20 -0
- data/app/components/avo/modal_component.rb +5 -0
- data/app/components/avo/navigation_heading_component.html.erb +3 -0
- data/app/components/avo/navigation_heading_component.rb +7 -0
- data/app/components/avo/navigation_link_component.html.erb +3 -0
- data/app/components/avo/navigation_link_component.rb +10 -0
- data/app/components/avo/panel_component.html.erb +27 -0
- data/app/components/avo/panel_component.rb +20 -0
- data/app/components/avo/resource_component.rb +14 -0
- data/app/components/avo/show/field_wrapper_component.html.erb +16 -0
- data/app/components/avo/show/field_wrapper_component.rb +15 -0
- data/app/components/avo/show/fields/badge_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/badge_field_component.rb +4 -0
- data/app/components/avo/show/fields/belongs_to_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/belongs_to_field_component.rb +4 -0
- data/app/components/avo/show/fields/boolean_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/boolean_field_component.rb +4 -0
- data/app/components/avo/show/fields/boolean_group_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/boolean_group_field_component.rb +4 -0
- data/app/components/avo/show/fields/code_field_component.html.erb +19 -0
- data/app/components/avo/show/fields/code_field_component.rb +4 -0
- data/app/components/avo/show/fields/country_field_component.html.erb +7 -0
- data/app/components/avo/show/fields/country_field_component.rb +4 -0
- data/app/components/avo/show/fields/date_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/date_field_component.rb +4 -0
- data/app/components/avo/show/fields/date_time_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/date_time_field_component.rb +4 -0
- data/app/components/avo/show/fields/external_image_field_component.html.erb +5 -0
- data/app/components/avo/show/fields/external_image_field_component.rb +4 -0
- data/app/components/avo/show/fields/field_component.rb +11 -0
- data/app/components/avo/show/fields/file_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/file_field_component.rb +4 -0
- data/app/components/avo/show/fields/files_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/files_field_component.rb +4 -0
- data/app/components/avo/show/fields/gravatar_field_component.html.erb +7 -0
- data/app/components/avo/show/fields/gravatar_field_component.rb +4 -0
- data/app/components/avo/show/fields/has_many_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/has_many_field_component.rb +4 -0
- data/app/components/avo/show/fields/has_one_field_component.html.erb +19 -0
- data/app/components/avo/show/fields/has_one_field_component.rb +5 -0
- data/app/components/avo/show/fields/heading_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/heading_field_component.rb +4 -0
- data/app/components/avo/show/fields/id_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/id_field_component.rb +4 -0
- data/app/components/avo/show/fields/markdown_field_component.html.erb +10 -0
- data/app/components/avo/show/fields/markdown_field_component.rb +4 -0
- data/app/components/avo/show/fields/number_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/number_field_component.rb +4 -0
- data/app/components/avo/show/fields/select_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/select_field_component.rb +4 -0
- data/app/components/avo/show/fields/status_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/status_field_component.rb +4 -0
- data/app/components/avo/show/fields/text_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/text_field_component.rb +4 -0
- data/app/components/avo/show/fields/textarea_field_component.html.erb +3 -0
- data/app/components/avo/show/fields/textarea_field_component.rb +4 -0
- data/app/components/avo/show/fields/trix_field_component.html.erb +14 -0
- data/app/components/avo/show/fields/trix_field_component.rb +4 -0
- data/app/components/avo/views/resource_edit_component.html.erb +29 -0
- data/app/components/avo/views/resource_edit_component.rb +23 -0
- data/app/components/avo/views/resource_index_component.html.erb +62 -0
- data/app/components/avo/views/resource_index_component.rb +93 -0
- data/app/components/avo/views/resource_new_component.html.erb +25 -0
- data/app/components/avo/views/resource_new_component.rb +27 -0
- data/app/components/avo/views/resource_show_component.html.erb +64 -0
- data/app/components/avo/views/resource_show_component.rb +66 -0
- data/app/controllers/avo/actions_controller.rb +51 -22
- data/app/controllers/avo/application_controller.rb +189 -27
- data/app/controllers/avo/attachments_controller.rb +25 -0
- data/app/controllers/avo/base_controller.rb +226 -0
- data/app/controllers/avo/home_controller.rb +3 -0
- data/app/controllers/avo/relations_controller.rb +88 -19
- data/app/controllers/avo/resources_controller.rb +2 -259
- data/app/controllers/avo/search_controller.rb +8 -7
- data/app/frontend/css/alerts.css +35 -0
- data/app/frontend/css/application.css +73 -0
- data/app/frontend/css/components/code.css +27 -0
- data/app/frontend/css/components/status.css +30 -0
- data/app/frontend/css/fonts.css +26 -0
- data/app/frontend/css/loader.css +134 -0
- data/app/frontend/css/pagination.css +67 -0
- data/app/frontend/css/tailwindcss/base.css +1 -0
- data/app/frontend/css/tailwindcss/components.css +1 -0
- data/app/frontend/css/tailwindcss/utilities.css +1 -0
- data/app/frontend/css/tooltips.css +105 -0
- data/app/frontend/css/typography.css +23 -0
- data/app/frontend/fonts/nunito-v16-latin-700.eot +0 -0
- data/app/frontend/fonts/nunito-v16-latin-700.svg +388 -0
- data/app/frontend/fonts/nunito-v16-latin-700.ttf +0 -0
- data/app/frontend/fonts/nunito-v16-latin-700.woff +0 -0
- data/app/frontend/fonts/nunito-v16-latin-700.woff2 +0 -0
- data/app/frontend/fonts/nunito-v16-latin-regular.eot +0 -0
- data/app/frontend/fonts/nunito-v16-latin-regular.svg +380 -0
- data/app/frontend/fonts/nunito-v16-latin-regular.ttf +0 -0
- data/app/frontend/fonts/nunito-v16-latin-regular.woff +0 -0
- data/app/frontend/fonts/nunito-v16-latin-regular.woff2 +0 -0
- data/app/frontend/images/logo.png +0 -0
- data/app/frontend/importmap.json.erb +5 -0
- data/app/frontend/js/controllers/action_controller.js +32 -0
- data/app/frontend/js/controllers/actions_picker_controller.js +44 -0
- data/app/frontend/js/controllers/alerts_controller.js +26 -0
- data/app/frontend/js/controllers/attachments_controller.js +9 -0
- data/app/frontend/js/controllers/boolean_filter_controller.js +21 -0
- data/app/frontend/js/controllers/fields/code_field_controller.js +35 -0
- data/app/frontend/js/controllers/fields/date_field_controller.js +53 -0
- data/app/frontend/js/controllers/fields/simple_mde_controller.js +26 -0
- data/app/frontend/js/controllers/filter_controller.js +52 -0
- data/app/frontend/js/controllers/hidden_input_controller.js +10 -0
- data/app/frontend/js/controllers/item_selector_controller.js +68 -0
- data/app/frontend/js/controllers/modal_controller.js +11 -0
- data/app/frontend/js/controllers/per_page_controller.js +9 -0
- data/app/frontend/js/controllers/select_filter_controller.js +15 -0
- data/app/frontend/js/controllers/tippy_controller.js +14 -0
- data/app/frontend/js/controllers/toggle_panel_controller.js +18 -0
- data/app/frontend/js/helpers/cast_boolean.js +2 -0
- data/app/frontend/js/toastr.js +9 -0
- data/app/frontend/packs/application.js +45 -0
- data/{public/avo-packs/media/svgs/arrow-circle-right-1ad1e15ec9a7aa54b67d126566a5aa2d.svg → app/frontend/svgs/arrow-circle-right.svg} +0 -0
- data/{public/avo-packs/media/svgs/arrow-left-0e8e808ff771a62a348d0232c8ccf539.svg → app/frontend/svgs/arrow-left.svg} +0 -0
- data/{public/avo-packs/media/svgs/avocado-bca389be7cf81162df902dfbd09b8adb.svg → app/frontend/svgs/avocado.svg} +0 -0
- data/app/frontend/svgs/badge-check-sm.svg +3 -0
- data/{public/avo-packs/media/svgs/check-circle-be9e4dcbd25467ae9a3d3c6c5c7a09fa.svg → app/frontend/svgs/check-circle.svg} +0 -0
- data/{public/avo-packs/media/svgs/chevron-down-01208b17a1f70a1bb8d82bba131da4f4.svg → app/frontend/svgs/chevron-down.svg} +0 -0
- data/{public/avo-packs/media/svgs/chevron-up-25ecf340dd76966d5ed63c85c025befc.svg → app/frontend/svgs/chevron-up.svg} +0 -0
- data/{public/avo-packs/media/svgs/code-69010c6ddb6ad50be8677f16468c51f8.svg → app/frontend/svgs/code.svg} +0 -0
- data/{public/avo-packs/media/svgs/color-swatch-60cf90fb6b5386e38f3b003f34e7ecbe.svg → app/frontend/svgs/color-swatch.svg} +0 -0
- data/app/frontend/svgs/document-text.svg +3 -0
- data/{public/avo-packs/media/svgs/download-c6ae3f12364a467c28cbf41dc90afbdd.svg → app/frontend/svgs/download.svg} +0 -0
- data/{public/avo-packs/media/svgs/edit-46c6dbef52ba6ddfc9afbc37186dfa2b.svg → app/frontend/svgs/edit.svg} +0 -0
- data/app/frontend/svgs/exclamation-circle-sm.svg +3 -0
- data/app/frontend/svgs/exclamation-sm.svg +3 -0
- data/{public/avo-packs/media/svgs/exclamation-8d1c0baa390a8df9bb52176011eb5892.svg → app/frontend/svgs/exclamation.svg} +0 -0
- data/{public/avo-packs/media/svgs/eye-cc6f85c70ebed6929712a5c7d51f102d.svg → app/frontend/svgs/eye.svg} +0 -0
- data/{public/avo-packs/media/svgs/filter-0007cddbc85cfe207f9876d4d184444a.svg → app/frontend/svgs/filter.svg} +0 -0
- data/{public/avo-packs/media/svgs/fire-782f08df79993311b6d907e12d9ebe9f.svg → app/frontend/svgs/fire.svg} +0 -0
- data/{public/avo-packs/media/svgs/game-board-6c59fe04181ac9954356c9f1f4d28053.svg → app/frontend/svgs/game-board.svg} +0 -0
- data/{public/avo-packs/media/svgs/globe-dfd9977c9d65814d2fc576904406dd08.svg → app/frontend/svgs/globe.svg} +0 -0
- data/app/frontend/svgs/information-circle-sm.svg +3 -0
- data/app/frontend/svgs/information-circle.svg +1 -0
- data/{public/avo-packs/media/svgs/library-7d391192a15da64fbb527908c9e035c7.svg → app/frontend/svgs/library.svg} +0 -0
- data/{public/avo-packs/media/svgs/photograph-9f37f1f5e6a48e68ce3b7d9cbe7b6fad.svg → app/frontend/svgs/photograph.svg} +0 -0
- data/app/frontend/svgs/play.svg +1 -0
- data/{public/avo-packs/media/svgs/plus-circle-b379b2a2aa803511ae5945b6fd323204.svg → app/frontend/svgs/plus-circle.svg} +0 -0
- data/{public/avo-packs/media/svgs/plus-530f0af27b9f1a4552454233c2f9a641.svg → app/frontend/svgs/plus.svg} +0 -0
- data/{public/avo-packs/media/svgs/question-mark-circle-3ece1d61091827910cdd097db711062b.svg → app/frontend/svgs/question-mark-circle.svg} +0 -0
- data/{public/avo-packs/media/svgs/save-e54acd7ac9646053e36382776f822756.svg → app/frontend/svgs/save.svg} +0 -0
- data/{public/avo-packs/media/svgs/selector-b43b3957d7cc121d06be14312613c218.svg → app/frontend/svgs/selector.svg} +0 -0
- data/{public/avo-packs/media/svgs/sort-ascending-f5bc0761702809cab20b0ea3065cb88a.svg → app/frontend/svgs/sort-ascending.svg} +0 -0
- data/{public/avo-packs/media/svgs/sort-descending-1c8ddc56c72be6781e59d808f9d06203.svg → app/frontend/svgs/sort-descending.svg} +0 -0
- data/{public/avo-packs/media/svgs/switch-horizontal-d23337f0fb533a86d14b746d25ad48ae.svg → app/frontend/svgs/switch-horizontal.svg} +0 -0
- data/{public/avo-packs/media/svgs/thumbs-down-44f83eacbf5b8fe0f2f085da75866ce0.svg → app/frontend/svgs/thumbs-down.svg} +0 -0
- data/{public/avo-packs/media/svgs/thumbs-up-b866900017db179b50d6b19a1424ed25.svg → app/frontend/svgs/thumbs-up.svg} +0 -0
- data/app/frontend/svgs/times.svg +3 -0
- data/app/frontend/svgs/trash-sm.svg +3 -0
- data/{public/avo-packs/media/svgs/trash-a61412a066e358bcc24494a5080b7255.svg → app/frontend/svgs/trash.svg} +0 -0
- data/{public/avo-packs/media/svgs/view-grid-add-d0ee477a044e5d46c0c62af66cb6de77.svg → app/frontend/svgs/view-grid-add.svg} +0 -0
- data/{public/avo-packs/media/svgs/view-grid-393669034db69f59497616d5416ae411.svg → app/frontend/svgs/view-grid.svg} +0 -0
- data/{public/avo-packs/media/svgs/view-list-8a7a159ca5d892f72cf8c6744a2074e2.svg → app/frontend/svgs/view-list.svg} +0 -0
- data/{public/avo-packs/media/svgs/x-circle-c540f9ccfe937ad9b4f662e0b65e47e2.svg → app/frontend/svgs/x-circle.svg} +0 -0
- data/app/helpers/avo/actions_helper.rb +4 -0
- data/app/helpers/avo/application_helper.rb +156 -3
- data/app/helpers/avo/attachments_helper.rb +4 -0
- data/app/helpers/avo/resources_helper.rb +101 -0
- data/app/views/avo/actions/show.html.erb +71 -0
- data/app/views/avo/attachments/show.html.erb +7 -0
- data/app/views/avo/base/_actions.html.erb +30 -0
- data/app/views/avo/base/_boolean_filter.html.erb +33 -0
- data/app/views/avo/base/_filters.html.erb +29 -0
- data/app/views/avo/base/_select_filter.html.erb +20 -0
- data/app/views/avo/base/edit.html.erb +1 -0
- data/app/views/avo/base/index.html.erb +15 -0
- data/app/views/avo/base/new.html.erb +1 -0
- data/app/views/avo/base/show.html.erb +3 -0
- data/app/views/avo/home/_actions.html.erb +16 -0
- data/app/views/avo/home/_docs.html.erb +9 -0
- data/app/views/avo/home/_filters.html.erb +16 -0
- data/app/views/avo/home/_resources.html.erb +28 -0
- data/app/views/avo/home/index.html.erb +54 -3
- data/app/views/avo/partials/_a_button.html.erb +7 -0
- data/app/views/avo/partials/_a_link.html.erb +7 -0
- data/app/views/avo/partials/_alert.html.erb +1 -0
- data/app/views/avo/partials/_alerts.html.erb +3 -0
- data/app/views/avo/partials/_empty_state.html.erb +17 -0
- data/app/views/{partials → avo/partials}/_footer.html.erb +0 -0
- data/app/views/{partials → avo/partials}/_header.html.erb +0 -0
- data/app/views/avo/partials/_javascript.html.erb +3 -0
- data/app/views/{partials → avo/partials}/_logo.html.erb +0 -0
- data/app/views/avo/partials/_paginator.html.erb +30 -0
- data/app/views/avo/partials/_sortable_component.html.erb +14 -0
- data/app/views/avo/partials/_table_header.html.erb +50 -0
- data/app/views/avo/partials/_view_toggle_button.html.erb +17 -0
- data/app/views/avo/relations/new.html.erb +29 -0
- data/app/views/avo/sidebar/_license_warning.html.erb +12 -0
- data/app/views/avo/sidebar/_license_warnings.html.erb +6 -0
- data/app/views/avo/sidebar/_sidebar.html.erb +23 -0
- data/app/views/kaminari/_first_page.html.erb +3 -0
- data/app/views/kaminari/_last_page.html.erb +3 -0
- data/app/views/kaminari/_next_page.html.erb +9 -0
- data/app/views/kaminari/_page.html.erb +12 -0
- data/app/views/kaminari/_prev_page.html.erb +9 -0
- data/app/views/layouts/avo/_filter_wrapper.html.erb +8 -0
- data/app/views/layouts/avo/application.html.erb +33 -40
- data/app/views/layouts/avo/application_vue.html.erb +61 -0
- data/avo.gemspec +5 -3
- data/bin/helpers.rb +34 -0
- data/bin/init +35 -0
- data/bin/rspec +8 -0
- data/bin/spring +17 -0
- data/bin/test +21 -0
- data/bin/webpack +9 -10
- data/bin/webpack-dev-server +9 -10
- data/config/cable.yml +11 -0
- data/config/initializers/inline_svg.rb +33 -0
- data/config/initializers/pagy.rb +1 -0
- data/config/routes.rb +22 -18
- data/config/spring.rb +7 -0
- data/config/webpack/environment.js +14 -10
- data/config/webpacker.yml +14 -26
- data/db/factories.rb +10 -3
- data/db/migrate/20210305082639_add_url_to_teams.rb +5 -0
- data/lib/avo.rb +5 -13
- data/lib/avo/app.rb +190 -0
- data/lib/avo/base_action.rb +115 -0
- data/lib/avo/base_resource.rb +321 -0
- data/lib/avo/configuration.rb +14 -0
- data/lib/avo/engine.rb +15 -31
- data/lib/avo/fields/badge_field.rb +18 -0
- data/lib/avo/fields/base_field.rb +184 -0
- data/lib/avo/fields/belongs_to_field.rb +65 -0
- data/lib/avo/{app/fields → fields}/boolean_field.rb +9 -11
- data/lib/avo/fields/boolean_group_field.rb +40 -0
- data/lib/avo/fields/code_field.rb +29 -0
- data/lib/avo/fields/country_field.rb +32 -0
- data/lib/avo/{app/fields → fields}/currency_field.rb +2 -3
- data/lib/avo/{app/fields → fields}/date_field.rb +16 -13
- data/lib/avo/fields/date_time_field.rb +36 -0
- data/lib/avo/fields/external_image_field.rb +24 -0
- data/lib/avo/{app/fields → fields}/field_extensions/has_field_name.rb +0 -0
- data/lib/avo/{app/fields → fields}/field_extensions/visible_in_different_views.rb +6 -6
- data/lib/avo/fields/file_field.rb +29 -0
- data/lib/avo/fields/files_field.rb +33 -0
- data/lib/avo/{app/fields → fields}/gravatar_field.rb +19 -14
- data/lib/avo/fields/has_and_belongs_to_many_field.rb +37 -0
- data/lib/avo/fields/has_many_field.rb +38 -0
- data/lib/avo/fields/has_one_field.rb +63 -0
- data/lib/avo/{app/fields → fields}/heading_field.rb +3 -9
- data/lib/avo/{app/fields → fields}/hidden_field.rb +2 -4
- data/lib/avo/{app/fields → fields}/id_field.rb +3 -9
- data/lib/avo/{app/fields → fields}/key_value_field.rb +6 -3
- data/lib/avo/{app/fields → fields}/markdown_field.rb +2 -4
- data/lib/avo/fields/number_field.rb +20 -0
- data/lib/avo/{app/fields → fields}/password_field.rb +1 -3
- data/lib/avo/fields/select_field.rb +51 -0
- data/lib/avo/{app/fields → fields}/status_field.rb +10 -8
- data/lib/avo/{app/fields → fields}/text_field.rb +2 -9
- data/lib/avo/fields/textarea_field.rb +18 -0
- data/lib/avo/{app/fields → fields}/trix_field.rb +4 -10
- data/lib/avo/filters/base_filter.rb +20 -0
- data/lib/avo/filters/boolean_filter.rb +7 -0
- data/lib/avo/filters/select_filter.rb +7 -0
- data/lib/avo/{app/grid_fields → grid_fields}/body_field.rb +0 -2
- data/lib/avo/{app/grid_fields → grid_fields}/grid_field.rb +0 -0
- data/lib/avo/{app/grid_fields → grid_fields}/preview_field.rb +0 -2
- data/lib/avo/{app/grid_fields → grid_fields}/title_field.rb +0 -2
- data/lib/avo/licensing/community_license.rb +6 -0
- data/lib/avo/licensing/h_q.rb +88 -0
- data/lib/avo/licensing/license.rb +50 -0
- data/lib/avo/licensing/license_manager.rb +22 -0
- data/lib/avo/licensing/null_license.rb +14 -0
- data/lib/avo/licensing/pro_license.rb +11 -0
- data/lib/avo/loaders/actions_loader.rb +6 -0
- data/lib/avo/loaders/fields_loader.rb +27 -0
- data/lib/avo/loaders/filters_loader.rb +6 -0
- data/lib/avo/loaders/loader.rb +15 -0
- data/lib/avo/services/authorization_service.rb +93 -0
- data/lib/avo/services/panel_service.rb +27 -0
- data/lib/avo/{app/tools_manager.rb → tools_manager.rb} +0 -0
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/action_generator.rb +11 -5
- data/lib/generators/avo/controller_generator.rb +19 -0
- data/lib/generators/avo/filter_generator.rb +14 -8
- data/lib/generators/avo/install_generator.rb +14 -10
- data/lib/generators/avo/locales_generator.rb +16 -0
- data/lib/generators/avo/partials_generator.rb +14 -0
- data/lib/generators/avo/resource_generator.rb +37 -5
- data/lib/generators/avo/templates/{action.rb → action.tt} +2 -4
- data/lib/generators/avo/templates/filters/boolean_filter.tt +11 -0
- data/lib/generators/avo/templates/filters/select_filter.tt +11 -0
- data/lib/generators/avo/templates/initializer/{avo.rb → avo.tt} +9 -4
- data/lib/generators/avo/templates/locales/avo.en.yml +22 -1
- data/lib/generators/avo/templates/partials/_footer.html.erb +3 -0
- data/lib/generators/avo/templates/partials/_header.html.erb +1 -0
- data/lib/generators/avo/templates/{views → partials}/_logo.html.erb +0 -0
- data/lib/generators/avo/templates/{views → partials}/_scripts.html.erb +0 -0
- data/lib/generators/avo/templates/resource/controller.tt +2 -0
- data/lib/generators/avo/templates/resource/resource.tt +17 -0
- data/public/avo-packs/css/application-c75ac28c.css +6 -0
- data/public/avo-packs/css/application-c75ac28c.css.br +0 -0
- data/public/avo-packs/css/application-c75ac28c.css.gz +0 -0
- data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js +2 -0
- data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.br +0 -0
- data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.gz +0 -0
- data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.map +1 -0
- data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.map.br +0 -0
- data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js.map.gz +0 -0
- data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js +26 -0
- data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.LICENSE.txt +77 -0
- data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.br +0 -0
- data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.gz +0 -0
- data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.map +1 -0
- data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.map.br +0 -0
- data/public/avo-packs/js/application-8849c6e2c8f75d55c666.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +17 -46
- data/public/avo-packs/manifest.json.br +0 -0
- data/public/avo-packs/manifest.json.gz +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf.br +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf.gz +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg +388 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg.br +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg.gz +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-700-412073df419ad5f6f8f2ea76eb4aced9.woff2 +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-700-7c472b19cb573f537bad8ef62ca917ac.woff +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-700-df7e79af617f98cd3b95d320e8b2a1af.eot +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg +380 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg.br +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg.gz +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-regular-2fae1e2418251b68fe5d0505ab93dd5c.eot +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-regular-bcf84d6cb8a0ac214c8c14ba9af834f3.woff2 +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-regular-cb632c9fe211ba2c2bf1564c9a9295cc.woff +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf.br +0 -0
- data/public/avo-packs/media/fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf.gz +0 -0
- metadata +466 -194
- data/app/controllers/avo/filters_controller.rb +0 -19
- data/app/controllers/avo/resource_overview_controller.rb +0 -24
- data/app/views/avo/home/router.html.erb +0 -8
- data/app/views/layouts/avo/_javascript.html.erb +0 -8
- data/app/views/layouts/avo/_translations.html.erb +0 -5
- data/config/webpack/loaders/vue-post-css.js +0 -20
- data/config/webpack/loaders/vue-svg.js +0 -21
- data/config/webpack/loaders/vue.js +0 -6
- data/lib/avo/app/action.rb +0 -156
- data/lib/avo/app/app.rb +0 -169
- data/lib/avo/app/fields/badge_field.rb +0 -45
- data/lib/avo/app/fields/belongs_to.rb +0 -77
- data/lib/avo/app/fields/boolean_group_field.rb +0 -38
- data/lib/avo/app/fields/code_field.rb +0 -27
- data/lib/avo/app/fields/country_field.rb +0 -41
- data/lib/avo/app/fields/datetime_field.rb +0 -34
- data/lib/avo/app/fields/field.rb +0 -196
- data/lib/avo/app/fields/file_field.rb +0 -36
- data/lib/avo/app/fields/files_field.rb +0 -42
- data/lib/avo/app/fields/has_and_belongs_to_many.rb +0 -48
- data/lib/avo/app/fields/has_many.rb +0 -51
- data/lib/avo/app/fields/has_one.rb +0 -70
- data/lib/avo/app/fields/number_field.rb +0 -29
- data/lib/avo/app/fields/select_field.rb +0 -28
- data/lib/avo/app/fields/textarea_field.rb +0 -27
- data/lib/avo/app/filter.rb +0 -34
- data/lib/avo/app/filters/boolean_filter.rb +0 -13
- data/lib/avo/app/filters/select_filter.rb +0 -13
- data/lib/avo/app/licensing/community_license.rb +0 -4
- data/lib/avo/app/licensing/hq.rb +0 -86
- data/lib/avo/app/licensing/license.rb +0 -48
- data/lib/avo/app/licensing/license_manager.rb +0 -25
- data/lib/avo/app/licensing/null_license.rb +0 -12
- data/lib/avo/app/licensing/pro_license.rb +0 -9
- data/lib/avo/app/resource.rb +0 -233
- data/lib/avo/app/resource_actions.rb +0 -18
- data/lib/avo/app/resource_fields.rb +0 -26
- data/lib/avo/app/resource_filters.rb +0 -18
- data/lib/avo/app/resource_grid_fields.rb +0 -30
- data/lib/avo/app/services/authorization_service.rb +0 -48
- data/lib/avo/app/tool.rb +0 -5
- data/lib/generators/avo/templates/filters/boolean_filter.rb +0 -17
- data/lib/generators/avo/templates/filters/select_filter.rb +0 -17
- data/lib/generators/avo/templates/resource.rb +0 -14
- data/lib/generators/avo/templates/views/_footer.html.erb +0 -3
- data/lib/generators/avo/templates/views/_header.html.erb +0 -1
- data/lib/generators/avo/views_generator.rb +0 -8
- data/public/avo-packs/css/application-c9595d99.css +0 -3
- data/public/avo-packs/css/application-c9595d99.css.br +0 -0
- data/public/avo-packs/css/application-c9595d99.css.gz +0 -0
- data/public/avo-packs/js/application-78fe71b4e59ebc7141f4.js +0 -3
- data/public/avo-packs/js/application-78fe71b4e59ebc7141f4.js.LICENSE.txt +0 -767
- data/public/avo-packs/js/application-78fe71b4e59ebc7141f4.js.br +0 -0
- data/public/avo-packs/js/application-78fe71b4e59ebc7141f4.js.gz +0 -0
- data/public/avo-packs/js/application-78fe71b4e59ebc7141f4.js.map +0 -1
- data/public/avo-packs/js/application-78fe71b4e59ebc7141f4.js.map.br +0 -0
- data/public/avo-packs/js/application-78fe71b4e59ebc7141f4.js.map.gz +0 -0
- data/public/avo-packs/media/font/fontello-068ca2b3.ttf +0 -0
- data/public/avo-packs/media/font/fontello-068ca2b3.ttf.br +0 -0
- data/public/avo-packs/media/font/fontello-068ca2b3.ttf.gz +0 -0
- data/public/avo-packs/media/font/fontello-8d4a4e6f.woff2 +0 -0
- data/public/avo-packs/media/font/fontello-9354499c.svg +0 -72
- data/public/avo-packs/media/font/fontello-9354499c.svg.br +0 -0
- data/public/avo-packs/media/font/fontello-9354499c.svg.gz +0 -0
- data/public/avo-packs/media/font/fontello-a782baa8.woff +0 -0
- data/public/avo-packs/media/font/fontello-e73a0647.eot +0 -0
- data/public/avo-packs/media/font/fontello-e73a0647.eot.br +0 -0
- data/public/avo-packs/media/font/fontello-e73a0647.eot.gz +0 -0
- data/public/avo-packs/media/svgs/arrow-circle-right-1ad1e15ec9a7aa54b67d126566a5aa2d.svg.br +0 -0
- data/public/avo-packs/media/svgs/arrow-circle-right-1ad1e15ec9a7aa54b67d126566a5aa2d.svg.gz +0 -0
- data/public/avo-packs/media/svgs/arrow-left-0e8e808ff771a62a348d0232c8ccf539.svg.br +0 -0
- data/public/avo-packs/media/svgs/avocado-bca389be7cf81162df902dfbd09b8adb.svg.br +0 -0
- data/public/avo-packs/media/svgs/avocado-bca389be7cf81162df902dfbd09b8adb.svg.gz +0 -0
- data/public/avo-packs/media/svgs/check-circle-be9e4dcbd25467ae9a3d3c6c5c7a09fa.svg.br +0 -0
- data/public/avo-packs/media/svgs/chevron-down-01208b17a1f70a1bb8d82bba131da4f4.svg.br +0 -0
- data/public/avo-packs/media/svgs/chevron-down-01208b17a1f70a1bb8d82bba131da4f4.svg.gz +0 -0
- data/public/avo-packs/media/svgs/chevron-up-25ecf340dd76966d5ed63c85c025befc.svg.br +0 -0
- data/public/avo-packs/media/svgs/chevron-up-25ecf340dd76966d5ed63c85c025befc.svg.gz +0 -0
- data/public/avo-packs/media/svgs/code-69010c6ddb6ad50be8677f16468c51f8.svg.br +0 -0
- data/public/avo-packs/media/svgs/color-swatch-60cf90fb6b5386e38f3b003f34e7ecbe.svg.br +0 -0
- data/public/avo-packs/media/svgs/color-swatch-60cf90fb6b5386e38f3b003f34e7ecbe.svg.gz +0 -0
- data/public/avo-packs/media/svgs/download-c6ae3f12364a467c28cbf41dc90afbdd.svg.br +0 -0
- data/public/avo-packs/media/svgs/download-c6ae3f12364a467c28cbf41dc90afbdd.svg.gz +0 -0
- data/public/avo-packs/media/svgs/edit-46c6dbef52ba6ddfc9afbc37186dfa2b.svg.br +0 -0
- data/public/avo-packs/media/svgs/edit-46c6dbef52ba6ddfc9afbc37186dfa2b.svg.gz +0 -0
- data/public/avo-packs/media/svgs/exclamation-8d1c0baa390a8df9bb52176011eb5892.svg.br +0 -0
- data/public/avo-packs/media/svgs/exclamation-8d1c0baa390a8df9bb52176011eb5892.svg.gz +0 -0
- data/public/avo-packs/media/svgs/eye-cc6f85c70ebed6929712a5c7d51f102d.svg.br +0 -1
- data/public/avo-packs/media/svgs/eye-cc6f85c70ebed6929712a5c7d51f102d.svg.gz +0 -0
- data/public/avo-packs/media/svgs/filter-0007cddbc85cfe207f9876d4d184444a.svg.br +0 -0
- data/public/avo-packs/media/svgs/filter-0007cddbc85cfe207f9876d4d184444a.svg.gz +0 -0
- data/public/avo-packs/media/svgs/fire-782f08df79993311b6d907e12d9ebe9f.svg.br +0 -0
- data/public/avo-packs/media/svgs/fire-782f08df79993311b6d907e12d9ebe9f.svg.gz +0 -0
- data/public/avo-packs/media/svgs/game-board-6c59fe04181ac9954356c9f1f4d28053.svg.br +0 -0
- data/public/avo-packs/media/svgs/game-board-6c59fe04181ac9954356c9f1f4d28053.svg.gz +0 -0
- data/public/avo-packs/media/svgs/globe-dfd9977c9d65814d2fc576904406dd08.svg.br +0 -0
- data/public/avo-packs/media/svgs/globe-dfd9977c9d65814d2fc576904406dd08.svg.gz +0 -0
- data/public/avo-packs/media/svgs/library-7d391192a15da64fbb527908c9e035c7.svg.br +0 -0
- data/public/avo-packs/media/svgs/photograph-9f37f1f5e6a48e68ce3b7d9cbe7b6fad.svg.br +0 -2
- data/public/avo-packs/media/svgs/photograph-9f37f1f5e6a48e68ce3b7d9cbe7b6fad.svg.gz +0 -0
- data/public/avo-packs/media/svgs/plus-530f0af27b9f1a4552454233c2f9a641.svg.br +0 -0
- data/public/avo-packs/media/svgs/plus-circle-b379b2a2aa803511ae5945b6fd323204.svg.br +0 -0
- data/public/avo-packs/media/svgs/question-mark-circle-3ece1d61091827910cdd097db711062b.svg.br +0 -0
- data/public/avo-packs/media/svgs/question-mark-circle-3ece1d61091827910cdd097db711062b.svg.gz +0 -0
- data/public/avo-packs/media/svgs/save-e54acd7ac9646053e36382776f822756.svg.br +0 -0
- data/public/avo-packs/media/svgs/save-e54acd7ac9646053e36382776f822756.svg.gz +0 -0
- data/public/avo-packs/media/svgs/selector-b43b3957d7cc121d06be14312613c218.svg.br +0 -0
- data/public/avo-packs/media/svgs/sort-ascending-f5bc0761702809cab20b0ea3065cb88a.svg.br +0 -0
- data/public/avo-packs/media/svgs/sort-descending-1c8ddc56c72be6781e59d808f9d06203.svg.br +0 -0
- data/public/avo-packs/media/svgs/switch-horizontal-d23337f0fb533a86d14b746d25ad48ae.svg.br +0 -2
- data/public/avo-packs/media/svgs/switch-horizontal-d23337f0fb533a86d14b746d25ad48ae.svg.gz +0 -0
- data/public/avo-packs/media/svgs/thumbs-down-44f83eacbf5b8fe0f2f085da75866ce0.svg.br +0 -0
- data/public/avo-packs/media/svgs/thumbs-down-44f83eacbf5b8fe0f2f085da75866ce0.svg.gz +0 -0
- data/public/avo-packs/media/svgs/thumbs-up-b866900017db179b50d6b19a1424ed25.svg.br +0 -4
- data/public/avo-packs/media/svgs/thumbs-up-b866900017db179b50d6b19a1424ed25.svg.gz +0 -0
- data/public/avo-packs/media/svgs/times-539256e95a00360c3bbc6160c6b695cd.svg +0 -1
- data/public/avo-packs/media/svgs/times-539256e95a00360c3bbc6160c6b695cd.svg.br +0 -0
- data/public/avo-packs/media/svgs/times-539256e95a00360c3bbc6160c6b695cd.svg.gz +0 -0
- data/public/avo-packs/media/svgs/trash-a61412a066e358bcc24494a5080b7255.svg.br +0 -0
- data/public/avo-packs/media/svgs/trash-a61412a066e358bcc24494a5080b7255.svg.gz +0 -0
- data/public/avo-packs/media/svgs/view-grid-393669034db69f59497616d5416ae411.svg.br +0 -1
- data/public/avo-packs/media/svgs/view-grid-393669034db69f59497616d5416ae411.svg.gz +0 -0
- data/public/avo-packs/media/svgs/view-grid-add-d0ee477a044e5d46c0c62af66cb6de77.svg.br +0 -0
- data/public/avo-packs/media/svgs/view-grid-add-d0ee477a044e5d46c0c62af66cb6de77.svg.gz +0 -0
- data/public/avo-packs/media/svgs/view-list-8a7a159ca5d892f72cf8c6744a2074e2.svg.br +0 -3
- data/public/avo-packs/media/svgs/view-list-8a7a159ca5d892f72cf8c6744a2074e2.svg.gz +0 -0
- data/public/avo-packs/media/svgs/x-circle-c540f9ccfe937ad9b4f662e0b65e47e2.svg.br +0 -0
- data/public/avo-packs/media/svgs/x-circle-c540f9ccfe937ad9b4f662e0b65e47e2.svg.gz +0 -0
data/bin/rspec
ADDED
data/bin/spring
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file loads Spring without using Bundler, in order to be fast.
|
4
|
+
# It gets overwritten when you run the `spring binstub` command.
|
5
|
+
|
6
|
+
unless defined?(Spring)
|
7
|
+
require 'rubygems'
|
8
|
+
require 'bundler'
|
9
|
+
|
10
|
+
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
|
11
|
+
spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
|
12
|
+
if spring
|
13
|
+
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
14
|
+
gem 'spring', spring.version
|
15
|
+
require 'spring/binstub'
|
16
|
+
end
|
17
|
+
end
|
data/bin/test
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/bin/bash -e
|
2
|
+
|
3
|
+
export RAILS_ENV="test"
|
4
|
+
export NODE_ENV="test"
|
5
|
+
|
6
|
+
# Run unit tests
|
7
|
+
if [[ -z "$1" ]] || [[ "$1" == "unit" ]]; then
|
8
|
+
bundle exec rspec ./spec --tag type:feature
|
9
|
+
bundle exec rspec ./spec --tag type:controller
|
10
|
+
fi;
|
11
|
+
|
12
|
+
# Run system tests
|
13
|
+
if [[ -z "$1" ]] || [[ "$1" == "system" ]]; then
|
14
|
+
bin/webpack
|
15
|
+
bundle exec rspec ./spec --tag type:system
|
16
|
+
fi;
|
17
|
+
|
18
|
+
# Run open-ended test paths
|
19
|
+
if [[ "$@" ]] && [[ "$1" != "unit" ]] && [[ "$1" != "system" ]]; then
|
20
|
+
bundle exec rspec $@
|
21
|
+
fi;
|
data/bin/webpack
CHANGED
@@ -1,19 +1,18 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
ENV[
|
4
|
-
ENV[
|
3
|
+
ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] || 'development'
|
4
|
+
ENV['NODE_ENV'] ||= 'development'
|
5
5
|
|
6
|
-
require
|
7
|
-
ENV[
|
8
|
-
Pathname.new(__FILE__).realpath)
|
6
|
+
require 'pathname'
|
7
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath)
|
9
8
|
|
10
|
-
require
|
11
|
-
require
|
9
|
+
require 'rubygems'
|
10
|
+
require 'bundler/setup'
|
12
11
|
|
13
|
-
require
|
14
|
-
require
|
12
|
+
require 'webpacker'
|
13
|
+
require 'webpacker/webpack_runner'
|
15
14
|
|
16
|
-
APP_ROOT = File.expand_path(
|
15
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
17
16
|
Dir.chdir(APP_ROOT) do
|
18
17
|
Webpacker::WebpackRunner.run(ARGV)
|
19
18
|
end
|
data/bin/webpack-dev-server
CHANGED
@@ -1,19 +1,18 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
ENV[
|
4
|
-
ENV[
|
3
|
+
ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] || 'development'
|
4
|
+
ENV['NODE_ENV'] ||= 'development'
|
5
5
|
|
6
|
-
require
|
7
|
-
ENV[
|
8
|
-
Pathname.new(__FILE__).realpath)
|
6
|
+
require 'pathname'
|
7
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath)
|
9
8
|
|
10
|
-
require
|
11
|
-
require
|
9
|
+
require 'rubygems'
|
10
|
+
require 'bundler/setup'
|
12
11
|
|
13
|
-
require
|
14
|
-
require
|
12
|
+
require 'webpacker'
|
13
|
+
require 'webpacker/dev_server_runner'
|
15
14
|
|
16
|
-
APP_ROOT = File.expand_path(
|
15
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
17
16
|
Dir.chdir(APP_ROOT) do
|
18
17
|
Webpacker::DevServerRunner.run(ARGV)
|
19
18
|
end
|
data/config/cable.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Overriding the 1.7.1 version of WebpackAssetFinder to add custom webpacker instance
|
2
|
+
module InlineSvg
|
3
|
+
class WebpackAssetFinder
|
4
|
+
def initialize(filename)
|
5
|
+
@filename = filename
|
6
|
+
@webpacker = Avo.webpacker
|
7
|
+
@asset_path = @webpacker.manifest.lookup(@filename)
|
8
|
+
end
|
9
|
+
|
10
|
+
def pathname
|
11
|
+
return if @asset_path.blank?
|
12
|
+
|
13
|
+
if @webpacker.dev_server.running?
|
14
|
+
dev_server_asset(@asset_path)
|
15
|
+
elsif @webpacker.config.public_path.present?
|
16
|
+
File.join(@webpacker.config.public_path, @asset_path)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def fetch_from_dev_server(file_path)
|
23
|
+
http = Net::HTTP.new(@webpacker.dev_server.host, @webpacker.dev_server.port)
|
24
|
+
http.use_ssl = @webpacker.dev_server.https?
|
25
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
26
|
+
|
27
|
+
http.request(Net::HTTP::Get.new(file_path)).body
|
28
|
+
rescue StandardError => e
|
29
|
+
Rails.logger.error "[inline_svg] Error fetching #{@filename} from webpack-dev-server: #{e}"
|
30
|
+
raise
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'pagy/extras/trim'
|
data/config/routes.rb
CHANGED
@@ -1,28 +1,32 @@
|
|
1
1
|
Avo::Engine.routes.draw do
|
2
2
|
root 'home#index'
|
3
3
|
|
4
|
-
get '
|
4
|
+
get 'resources', to: redirect('/avo')
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
scope 'resources', as: 'resources' do
|
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
10
|
|
9
|
-
|
10
|
-
|
11
|
+
# Actions
|
12
|
+
get '/:resource_name(/:id)/actions/:action_id', to: 'actions#show'
|
13
|
+
post '/:resource_name(/:id)/actions/:action_id', to: 'actions#handle'
|
11
14
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
get '/avo-api/:resource_name/:id', to: 'resources#show'
|
16
|
-
get '/avo-api/:resource_name/:id/edit', to: 'resources#edit'
|
17
|
-
put '/avo-api/:resource_name/:id', to: 'resources#update'
|
18
|
-
delete '/avo-api/:resource_name/:id', to: 'resources#destroy'
|
15
|
+
# Generate resource routes as below:
|
16
|
+
# resources :posts
|
17
|
+
instance_eval(&Avo::App.draw_routes)
|
19
18
|
|
20
|
-
|
21
|
-
|
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'
|
25
|
+
end
|
22
26
|
|
23
|
-
#
|
24
|
-
get '/avo-
|
27
|
+
# get '/avo-api/search', to: 'search#index'
|
28
|
+
# get '/avo-api/:resource_name/search', to: 'search#resource'
|
25
29
|
|
26
|
-
#
|
27
|
-
get '
|
30
|
+
# Tools
|
31
|
+
# get '/avo-tools/resource-overview', to: 'resource_overview#index'
|
28
32
|
end
|
data/config/spring.rb
ADDED
@@ -1,14 +1,18 @@
|
|
1
1
|
const { environment } = require('@rails/webpacker')
|
2
|
-
const { VueLoaderPlugin } = require('vue-loader')
|
3
|
-
|
4
2
|
const aliases = require('./aliases')
|
5
|
-
|
6
|
-
const vueSvg = require('./loaders/vue-svg')
|
7
|
-
// const vueCss = require('./loaders/vue-post-css')
|
8
|
-
|
9
|
-
environment.loaders.append('vueSvg', vueSvg)
|
10
|
-
environment.plugins.append('VueLoaderPlugin', new VueLoaderPlugin())
|
11
|
-
environment.loaders.append('vue', vue)
|
12
|
-
// environment.loaders.append('vueCss', vueCss)
|
3
|
+
|
13
4
|
environment.config.merge(aliases)
|
5
|
+
|
6
|
+
// Fix the post-css loader config format
|
7
|
+
environment.loaders.keys().forEach(loaderName => {
|
8
|
+
let loader = environment.loaders.get(loaderName);
|
9
|
+
loader.use.forEach(loaderConfig => {
|
10
|
+
if (loaderConfig.options && loaderConfig.options.config) {
|
11
|
+
loaderConfig.options.postcssOptions = loaderConfig.options.config;
|
12
|
+
delete loaderConfig.options.config;
|
13
|
+
}
|
14
|
+
});
|
15
|
+
});
|
16
|
+
|
17
|
+
|
14
18
|
module.exports = environment
|
data/config/webpacker.yml
CHANGED
@@ -3,13 +3,12 @@
|
|
3
3
|
default: &default
|
4
4
|
source_path: app/frontend
|
5
5
|
source_entry_path: packs
|
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
|
-
webpack_compile_output:
|
12
|
-
public_root_path: public
|
11
|
+
webpack_compile_output: true
|
13
12
|
|
14
13
|
# Additional paths webpack should lookup modules
|
15
14
|
# ['app/assets', 'engine/foo/app/assets']
|
@@ -52,33 +51,19 @@ default: &default
|
|
52
51
|
- .jpeg
|
53
52
|
- .jpg
|
54
53
|
|
54
|
+
# We override the development env. when packed.
|
55
|
+
# Avo needs to be packed and compiled for when the dev uses it in his development env.
|
55
56
|
development:
|
56
57
|
<<: *default
|
57
|
-
compile: true
|
58
58
|
|
59
|
-
#
|
60
|
-
|
61
|
-
|
62
|
-
# Reference: https://webpack.js.org/configuration/dev-server/
|
63
|
-
dev_server:
|
64
|
-
https: false
|
65
|
-
host: localhost
|
66
|
-
port: 3039
|
67
|
-
public: localhost:3039
|
68
|
-
hmr: true
|
69
|
-
# Inline should be set to true if using HMR
|
70
|
-
inline: true
|
71
|
-
overlay: true
|
72
|
-
compress: true
|
73
|
-
disable_host_check: true
|
74
|
-
use_local_ip: false
|
75
|
-
quiet: false
|
76
|
-
headers:
|
77
|
-
'Access-Control-Allow-Origin': '*'
|
78
|
-
watch_options:
|
79
|
-
ignored: '**/node_modules/**'
|
80
|
-
env_prefix: "AVO_WEBPACKER_DEV_SERVER"
|
59
|
+
# Production depends on precompilation of packs prior to booting for performance.
|
60
|
+
compile: false
|
81
61
|
|
62
|
+
# Extract and emit a css file
|
63
|
+
extract_css: true
|
64
|
+
|
65
|
+
# Cache manifest.json for performance
|
66
|
+
cache_manifest: true
|
82
67
|
|
83
68
|
test:
|
84
69
|
<<: *default
|
@@ -94,5 +79,8 @@ production:
|
|
94
79
|
# Production depends on precompilation of packs prior to booting for performance.
|
95
80
|
compile: false
|
96
81
|
|
82
|
+
# Extract and emit a css file
|
83
|
+
extract_css: true
|
84
|
+
|
97
85
|
# Cache manifest.json for performance
|
98
86
|
cache_manifest: true
|
data/db/factories.rb
CHANGED
@@ -18,15 +18,22 @@ FactoryBot.define do
|
|
18
18
|
name { Faker::Quote.famous_last_words }
|
19
19
|
body { Faker::Lorem.paragraphs(number: rand(4...10)).join("\n") }
|
20
20
|
is_featured { [true, false].sample }
|
21
|
-
published_at
|
21
|
+
published_at do
|
22
|
+
if [false, true].sample
|
23
|
+
Time.now - rand(10...365).days
|
24
|
+
else
|
25
|
+
nil
|
26
|
+
end
|
27
|
+
end
|
22
28
|
end
|
23
29
|
|
24
30
|
factory :project do
|
25
|
-
name { Faker::
|
31
|
+
name { Faker::App.name }
|
26
32
|
status { [:closed, :rejected, :failed, :loading, :running, :waiting].sample }
|
27
|
-
stage { ['Discovery', '
|
33
|
+
stage { ['Discovery', 'Idea', 'Done', 'On hold', 'Cancelled'].sample }
|
28
34
|
budget { Faker::Number.decimal(l_digits: 4) }
|
29
35
|
country { Faker::Address.country_code }
|
36
|
+
description { Faker::Markdown.sandwich(sentences: 5) }
|
30
37
|
users_required { Faker::Number.between(from: 10, to: 100) }
|
31
38
|
started_at { Time.now - rand(10...365).days }
|
32
39
|
meta { [{ foo: 'bar', hey: 'hi' }, { bar: 'baz' }, { hoho: 'hohoho' }].sample }
|
data/lib/avo.rb
CHANGED
@@ -1,17 +1,9 @@
|
|
1
|
-
|
1
|
+
require 'zeitwerk'
|
2
2
|
require_relative 'avo/version'
|
3
|
+
require_relative 'avo/engine' if defined?(Rails)
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
require_relative 'avo/app/action'
|
7
|
-
|
8
|
-
require_relative 'avo/app/filter'
|
9
|
-
require_relative 'avo/app/filters/boolean_filter'
|
10
|
-
require_relative 'avo/app/filters/select_filter'
|
11
|
-
|
12
|
-
require_relative 'avo/app/resource'
|
13
|
-
|
14
|
-
require_relative 'avo/app/licensing/license_manager'
|
5
|
+
loader = Zeitwerk::Loader.for_gem
|
6
|
+
loader.setup
|
15
7
|
|
16
8
|
module Avo
|
17
9
|
ROOT_PATH = Pathname.new(File.join(__dir__, '..'))
|
@@ -28,4 +20,4 @@ module Avo
|
|
28
20
|
end
|
29
21
|
end
|
30
22
|
|
31
|
-
|
23
|
+
loader.eager_load
|
data/lib/avo/app.rb
ADDED
@@ -0,0 +1,190 @@
|
|
1
|
+
module Avo
|
2
|
+
class App
|
3
|
+
class_attribute :app, default: {
|
4
|
+
resources: [],
|
5
|
+
cache_store: nil
|
6
|
+
}
|
7
|
+
class_attribute :fields, default: []
|
8
|
+
class_attribute :request, default: nil
|
9
|
+
class_attribute :context, default: nil
|
10
|
+
class_attribute :license, default: nil
|
11
|
+
|
12
|
+
class << self
|
13
|
+
# def load_controllers
|
14
|
+
# BaseResource.descendants.each do |resource|
|
15
|
+
# controller_name = "#{resource.to_s.gsub('Resource', '').pluralize}Controller"
|
16
|
+
# puts controller_name.inspect
|
17
|
+
# # eval <<DYNAMIC
|
18
|
+
# # class #{controller_name} < Avo::ResourcesController
|
19
|
+
# # # title :Person
|
20
|
+
# # # attribute :name, String
|
21
|
+
# # # ...or substitute other stuff in here.
|
22
|
+
# # end
|
23
|
+
# # DYNAMIC
|
24
|
+
|
25
|
+
# Avo.const_set(controller_name.to_sym, Class.new(Avo::ResourcesController))
|
26
|
+
# # puts controller_name.inspect
|
27
|
+
# end
|
28
|
+
# end
|
29
|
+
|
30
|
+
def boot
|
31
|
+
init_fields
|
32
|
+
|
33
|
+
I18n.locale = Avo.configuration.language_code
|
34
|
+
|
35
|
+
if Rails.cache.class == ActiveSupport::Cache::NullStore
|
36
|
+
self.app[:cache_store] ||= ActiveSupport::Cache::MemoryStore.new
|
37
|
+
else
|
38
|
+
self.app[:cache_store] = Rails.cache
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def init(request:, context:)
|
43
|
+
self.request = request
|
44
|
+
self.context = context
|
45
|
+
|
46
|
+
# Set the current host for ActiveStorage
|
47
|
+
ActiveStorage::Current.host = request.base_url
|
48
|
+
|
49
|
+
init_resources
|
50
|
+
|
51
|
+
self.license = Licensing::LicenseManager.new(Licensing::HQ.new(request).response).license
|
52
|
+
end
|
53
|
+
|
54
|
+
def cache_store
|
55
|
+
self.app[:cache_store]
|
56
|
+
end
|
57
|
+
|
58
|
+
# This method will find all fields available in the Avo::Fields namespace and add them to the fields class_variable array
|
59
|
+
# so later we can instantiate them on our resources.
|
60
|
+
#
|
61
|
+
# If the field has their `def_method` set up it will follow that convention, if not it will snake_case the name:
|
62
|
+
#
|
63
|
+
# Avo::Fields::TextField -> text
|
64
|
+
# Avo::Fields::DateTimeField -> date_time
|
65
|
+
def init_fields
|
66
|
+
Avo::Fields::BaseField.descendants.each do |class_name|
|
67
|
+
next if class_name.to_s == 'BaseField'
|
68
|
+
|
69
|
+
if class_name.to_s.end_with? 'Field'
|
70
|
+
load_field class_name.get_field_name, class_name
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def load_field(method_name, klass)
|
76
|
+
self.fields.push(
|
77
|
+
name: method_name,
|
78
|
+
class: klass,
|
79
|
+
)
|
80
|
+
|
81
|
+
# Avo::Loaders::FieldsLoader.define_method method_name.to_sym do |*args, &block|
|
82
|
+
# puts ['Avo::Loaders::FieldsLoader.define_method->', args, block.present?].inspect
|
83
|
+
|
84
|
+
# if block.present?
|
85
|
+
# puts '111->'.inspect
|
86
|
+
# field = klass.new(args[0], **args[1] || {}, &block)
|
87
|
+
# else
|
88
|
+
# puts '222->'.inspect
|
89
|
+
# field = klass.new(args[0], **args[1] || {})
|
90
|
+
# end
|
91
|
+
|
92
|
+
# puts field.inspect
|
93
|
+
|
94
|
+
# self.bag.push field
|
95
|
+
|
96
|
+
# # field
|
97
|
+
# # if block.present?
|
98
|
+
# # field_class = klass::new(args[0], **args[1] || {}, &block)
|
99
|
+
# # else
|
100
|
+
# # field_class = klass::new(args[0], **args[1] || {})
|
101
|
+
# # end
|
102
|
+
|
103
|
+
# # klass_entity.add_field(self, field_class)
|
104
|
+
# end
|
105
|
+
end
|
106
|
+
|
107
|
+
def init_resources
|
108
|
+
self.app[:resources] = BaseResource.descendants
|
109
|
+
.select do |resource|
|
110
|
+
resource != BaseResource
|
111
|
+
end
|
112
|
+
.map do |resource|
|
113
|
+
if resource.is_a? Class
|
114
|
+
resource.new
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def get_resources
|
120
|
+
self.app[:resources]
|
121
|
+
end
|
122
|
+
|
123
|
+
# Returns the Avo resource by camelized name
|
124
|
+
#
|
125
|
+
# get_resource_by_name('User') => Avo::Resources::User
|
126
|
+
def get_resource(resource)
|
127
|
+
self.app[:resources].find do |available_resource|
|
128
|
+
"#{resource}Resource".safe_constantize == available_resource.class
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
# Returns the Avo resource by singular snake_cased name
|
133
|
+
#
|
134
|
+
# get_resource_by_name('user') => Avo::Resources::User
|
135
|
+
def get_resource_by_name(name)
|
136
|
+
self.get_resource name.singularize.camelize
|
137
|
+
end
|
138
|
+
|
139
|
+
# Returns the Avo resource by singular snake_cased name
|
140
|
+
#
|
141
|
+
# get_resource_by_name('User') => Avo::Resources::User
|
142
|
+
# get_resource_by_name(User) => Avo::Resources::User
|
143
|
+
def get_resource_by_model_name(name)
|
144
|
+
get_resources.find do |resource|
|
145
|
+
resource.model_class.model_name.name == name.to_s
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
# Returns the Rails model class by singular snake_cased name
|
150
|
+
#
|
151
|
+
# get_model_class_by_name('user') => User
|
152
|
+
def get_model_class_by_name(name)
|
153
|
+
name.to_s.camelize.singularize
|
154
|
+
end
|
155
|
+
|
156
|
+
def get_available_resources(user = nil)
|
157
|
+
App.get_resources
|
158
|
+
.select do |resource|
|
159
|
+
Services::AuthorizationService.authorize user, resource.model, Avo.configuration.authorization_methods.stringify_keys['index'], raise_exception: false
|
160
|
+
end
|
161
|
+
.sort_by { |r| r.name }
|
162
|
+
end
|
163
|
+
|
164
|
+
def get_navigation_items(user = nil)
|
165
|
+
get_available_resources(user).select do |resource|
|
166
|
+
resource.model_class.present?
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def draw_routes
|
171
|
+
# We should eager load all the classes so we find all descendants
|
172
|
+
Rails.application.eager_load!
|
173
|
+
|
174
|
+
Proc.new do
|
175
|
+
BaseResource.descendants
|
176
|
+
.select do |resource|
|
177
|
+
resource != :Resource
|
178
|
+
end
|
179
|
+
.map do |resource|
|
180
|
+
if resource.is_a? Class
|
181
|
+
route_key = resource.to_s.underscore.gsub('_resource', '').downcase.pluralize.to_sym
|
182
|
+
|
183
|
+
resources route_key
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|