avo 0.5.0.beta4 → 0.5.0.beta9
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 +8 -6
- data/Gemfile.lock +28 -22
- data/app/components/avo/common/badge_viewer_component.html.erb +1 -1
- data/app/components/avo/common/gravatar_viewer_component.html.erb +2 -2
- data/app/components/avo/common/gravatar_viewer_component.rb +2 -1
- data/app/components/avo/edit/fields/trix_field_component.html.erb +1 -1
- data/app/components/avo/index/field_wrapper_component.html.erb +1 -1
- data/app/components/avo/index/fields/belongs_to_field_component.html.erb +1 -5
- data/app/components/avo/index/fields/boolean_group_field_component.html.erb +1 -1
- data/app/components/avo/index/fields/gravatar_field_component.html.erb +2 -1
- data/app/components/avo/index/fields/has_one_field_component.html.erb +1 -5
- data/app/components/avo/index/fields/id_field_component.html.erb +1 -1
- data/app/components/avo/index/grid_item_component.html.erb +8 -8
- data/app/components/avo/index/grid_item_component.rb +6 -12
- data/app/components/avo/index/resource_controls_component.html.erb +12 -4
- data/app/components/avo/index/resource_table_component.html.erb +1 -1
- data/app/components/avo/index/table_row_component.html.erb +1 -1
- data/app/components/avo/show/field_wrapper_component.html.erb +1 -1
- data/app/components/avo/show/fields/boolean_group_field_component.html.erb +1 -1
- data/app/components/avo/show/fields/external_image_field_component.html.erb +1 -1
- data/app/components/avo/views/resource_show_component.html.erb +14 -2
- data/app/controllers/avo/actions_controller.rb +6 -8
- data/app/controllers/avo/application_controller.rb +30 -6
- data/app/controllers/avo/base_controller.rb +5 -16
- data/app/controllers/avo/relations_controller.rb +2 -2
- data/app/controllers/avo/search_controller.rb +1 -1
- data/app/helpers/avo/application_helper.rb +1 -1
- data/app/{frontend/css → packs/entrypoints}/application.css +12 -11
- data/app/{frontend/packs → packs/entrypoints}/application.js +7 -3
- data/app/{frontend → packs}/fonts/nunito-v16-latin-700.eot +0 -0
- data/app/{frontend → packs}/fonts/nunito-v16-latin-700.svg +0 -0
- data/app/{frontend → packs}/fonts/nunito-v16-latin-700.ttf +0 -0
- data/app/{frontend → packs}/fonts/nunito-v16-latin-700.woff +0 -0
- data/app/{frontend → packs}/fonts/nunito-v16-latin-700.woff2 +0 -0
- data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.eot +0 -0
- data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.svg +0 -0
- data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.ttf +0 -0
- data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.woff +0 -0
- data/app/{frontend → packs}/fonts/nunito-v16-latin-regular.woff2 +0 -0
- data/app/{frontend → packs}/images/logo.png +0 -0
- data/app/{frontend → packs}/importmap.json.erb +0 -0
- data/app/{frontend → packs}/js/controllers/action_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/actions_picker_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/alerts_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/attachments_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/boolean_filter_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/fields/code_field_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/fields/date_field_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/fields/simple_mde_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/filter_controller.js +19 -3
- data/app/{frontend → packs}/js/controllers/hidden_input_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/item_selector_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/modal_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/per_page_controller.js +5 -1
- data/app/{frontend → packs}/js/controllers/select_filter_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/tippy_controller.js +0 -0
- data/app/{frontend → packs}/js/controllers/toggle_panel_controller.js +0 -0
- data/app/{frontend → packs}/js/helpers/cast_boolean.js +0 -0
- data/app/{frontend → packs}/js/toastr.js +0 -0
- data/app/{frontend/css → packs/stylesheets}/alerts.css +0 -0
- data/app/packs/stylesheets/components/code.css +11 -0
- data/app/{frontend/css → packs/stylesheets}/components/status.css +0 -0
- data/app/{frontend/css → packs/stylesheets}/fonts.css +0 -0
- data/app/{frontend/css → packs/stylesheets}/loader.css +0 -0
- data/app/{frontend/css → packs/stylesheets}/pagination.css +0 -0
- data/app/{frontend/css → packs/stylesheets}/tailwindcss/base.css +0 -0
- data/app/{frontend/css → packs/stylesheets}/tailwindcss/components.css +0 -0
- data/app/{frontend/css → packs/stylesheets}/tailwindcss/utilities.css +0 -0
- data/app/{frontend/css → packs/stylesheets}/tooltips.css +0 -0
- data/app/{frontend/css → packs/stylesheets}/typography.css +0 -0
- data/app/{frontend → packs}/svgs/arrow-circle-right.svg +0 -0
- data/app/{frontend → packs}/svgs/arrow-left.svg +0 -0
- data/app/{frontend → packs}/svgs/avocado.svg +0 -0
- data/app/{frontend → packs}/svgs/badge-check-sm.svg +0 -0
- data/app/{frontend → packs}/svgs/check-circle.svg +0 -0
- data/app/{frontend → packs}/svgs/chevron-down.svg +0 -0
- data/app/{frontend → packs}/svgs/chevron-up.svg +0 -0
- data/app/{frontend → packs}/svgs/code.svg +0 -0
- data/app/{frontend → packs}/svgs/color-swatch.svg +0 -0
- data/app/{frontend → packs}/svgs/document-text.svg +0 -0
- data/app/{frontend → packs}/svgs/download.svg +0 -0
- data/app/{frontend → packs}/svgs/edit.svg +0 -0
- data/app/{frontend → packs}/svgs/exclamation-circle-sm.svg +0 -0
- data/app/{frontend → packs}/svgs/exclamation-sm.svg +0 -0
- data/app/{frontend → packs}/svgs/exclamation.svg +0 -0
- data/app/{frontend → packs}/svgs/eye.svg +0 -0
- data/app/{frontend → packs}/svgs/filter.svg +0 -0
- data/app/{frontend → packs}/svgs/fire.svg +0 -0
- data/app/{frontend → packs}/svgs/game-board.svg +0 -0
- data/app/{frontend → packs}/svgs/globe.svg +0 -0
- data/app/{frontend → packs}/svgs/information-circle-sm.svg +0 -0
- data/app/{frontend → packs}/svgs/information-circle.svg +0 -0
- data/app/{frontend → packs}/svgs/library.svg +0 -0
- data/app/{frontend → packs}/svgs/photograph.svg +0 -0
- data/app/{frontend → packs}/svgs/play.svg +0 -0
- data/app/{frontend → packs}/svgs/plus-circle.svg +0 -0
- data/app/{frontend → packs}/svgs/plus.svg +0 -0
- data/app/{frontend → packs}/svgs/question-mark-circle.svg +0 -0
- data/app/{frontend → packs}/svgs/save.svg +0 -0
- data/app/{frontend → packs}/svgs/selector.svg +0 -0
- data/app/{frontend → packs}/svgs/sort-ascending.svg +0 -0
- data/app/{frontend → packs}/svgs/sort-descending.svg +0 -0
- data/app/{frontend → packs}/svgs/switch-horizontal.svg +0 -0
- data/app/{frontend → packs}/svgs/thumbs-down.svg +0 -0
- data/app/{frontend → packs}/svgs/thumbs-up.svg +0 -0
- data/app/{frontend → packs}/svgs/times.svg +0 -0
- data/app/{frontend → packs}/svgs/trash-sm.svg +0 -0
- data/app/{frontend → packs}/svgs/trash.svg +0 -0
- data/app/{frontend → packs}/svgs/view-grid-add.svg +0 -0
- data/app/{frontend → packs}/svgs/view-grid.svg +0 -0
- data/app/{frontend → packs}/svgs/view-list.svg +0 -0
- data/app/{frontend → packs}/svgs/x-circle.svg +0 -0
- data/app/views/avo/actions/show.html.erb +3 -39
- data/app/views/avo/attachments/show.html.erb +8 -1
- data/app/views/avo/base/_actions.html.erb +0 -6
- data/app/views/avo/base/_boolean_filter.html.erb +2 -1
- data/app/views/avo/base/_filters.html.erb +4 -11
- data/app/views/avo/base/_select_filter.html.erb +2 -1
- data/app/views/avo/home/_resources.html.erb +0 -1
- data/app/views/avo/partials/_paginator.html.erb +24 -5
- data/app/views/avo/relations/new.html.erb +5 -1
- data/app/views/layouts/avo/_filter_wrapper.html.erb +1 -1
- data/avo.gemspec +1 -1
- data/bin/helpers.rb +0 -0
- data/bin/rspec +1 -0
- data/bin/webpack +3 -1
- data/config/webpack/aliases.js +1 -1
- data/config/webpack/base.js +14 -0
- data/config/webpack/development.js +2 -2
- data/config/webpack/production.js +2 -2
- data/config/webpack/test.js +2 -2
- data/config/webpacker.yml +10 -62
- data/db/factories.rb +1 -0
- data/lib/avo.rb +5 -16
- data/lib/avo/action_model.rb +20 -0
- data/lib/avo/app.rb +162 -0
- data/lib/avo/base_action.rb +126 -0
- data/lib/avo/base_resource.rb +301 -0
- data/lib/avo/configuration.rb +6 -4
- data/lib/avo/engine.rb +17 -20
- data/lib/avo/{app/fields → fields}/badge_field.rb +1 -1
- data/lib/avo/{app/fields/field.rb → fields/base_field.rb} +22 -16
- data/lib/avo/{app/fields/belongs_to.rb → fields/belongs_to_field.rb} +3 -3
- data/lib/avo/{app/fields → fields}/boolean_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/boolean_group_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/code_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/country_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/currency_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/date_field.rb +0 -2
- data/lib/avo/{app/fields → fields}/date_time_field.rb +0 -2
- data/lib/avo/{app/fields → fields}/external_image_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/field_extensions/has_field_name.rb +2 -9
- data/lib/avo/{app/fields → fields}/field_extensions/visible_in_different_views.rb +1 -1
- data/lib/avo/{app/fields → fields}/file_field.rb +1 -2
- data/lib/avo/{app/fields → fields}/files_field.rb +1 -2
- data/lib/avo/{app/fields → fields}/gravatar_field.rb +2 -2
- data/lib/avo/{app/fields/has_and_belongs_to_many.rb → fields/has_and_belongs_to_many_field.rb} +1 -1
- data/lib/avo/{app/fields/has_many.rb → fields/has_many_field.rb} +1 -1
- data/lib/avo/{app/fields/has_one.rb → fields/has_one_field.rb} +1 -1
- data/lib/avo/{app/fields → fields}/heading_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/hidden_field.rb +0 -2
- data/lib/avo/{app/fields → fields}/id_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/key_value_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/markdown_field.rb +1 -3
- data/lib/avo/{app/fields → fields}/number_field.rb +0 -2
- data/lib/avo/{app/fields → fields}/password_field.rb +0 -2
- data/lib/avo/{app/fields → fields}/select_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/status_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/text_field.rb +1 -1
- data/lib/avo/{app/fields → fields}/textarea_field.rb +0 -2
- data/lib/avo/{app/fields → fields}/trix_field.rb +1 -3
- data/lib/avo/fields_collector.rb +31 -0
- 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/grid_collector.rb +39 -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/has_context.rb +7 -0
- 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 +14 -8
- 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 +11 -7
- data/lib/generators/avo/partials_generator.rb +11 -5
- data/lib/generators/avo/resource_generator.rb +33 -15
- data/lib/generators/avo/templates/{action.rb → action.tt} +4 -6
- 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} +6 -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-38e7e91b.css +5975 -0
- data/public/avo-packs/css/application-38e7e91b.css.br +0 -0
- data/public/avo-packs/css/application-38e7e91b.css.gz +0 -0
- data/public/avo-packs/css/application-38e7e91b.css.map +1 -0
- data/public/avo-packs/css/application-38e7e91b.css.map.br +0 -0
- data/public/avo-packs/css/application-38e7e91b.css.map.gz +0 -0
- data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js +2 -0
- data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.br +0 -0
- data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.gz +0 -0
- data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.map +1 -0
- data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.map.br +0 -0
- data/public/avo-packs/js/219-9aa2b689f44613118203.chunk.js.map.gz +0 -0
- data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js +26 -0
- data/public/avo-packs/js/{application-6ba2bd1bca05d69b96e0.js.LICENSE.txt → application-2b90fe889f7d6df1ad92.js.LICENSE.txt} +17 -17
- data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js.br +0 -0
- data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js.gz +0 -0
- data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js.map +1 -0
- data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js.map.br +0 -0
- data/public/avo-packs/js/application-2b90fe889f7d6df1ad92.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +46 -23
- data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg → images/13ae283c0d7cc04efe7e.svg} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg.br → images/13ae283c0d7cc04efe7e.svg.br} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-00fbd8a72a3708b8314cce5f0515640e.svg.gz → images/13ae283c0d7cc04efe7e.svg.gz} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg → images/195026a50008c53526ef.svg} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg.br → images/195026a50008c53526ef.svg.br} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-700-35bd1c96bc2e402cf22ea812ae067995.svg.gz → images/195026a50008c53526ef.svg.gz} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-cb632c9fe211ba2c2bf1564c9a9295cc.woff → images/1f30e08faa7c60d1f7ac.woff} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf → images/1fd17dabf6b7d2b15348.ttf} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf.br → images/1fd17dabf6b7d2b15348.ttf.br} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-700-2cc22f9c0cf217cbfc371f3b74992305.ttf.gz → images/1fd17dabf6b7d2b15348.ttf.gz} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-bcf84d6cb8a0ac214c8c14ba9af834f3.woff2 → images/39a18f443d434999b89b.woff2} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-700-412073df419ad5f6f8f2ea76eb4aced9.woff2 → images/4ad349571e28bb59c5a5.woff2} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-2fae1e2418251b68fe5d0505ab93dd5c.eot → images/57a5470848663767abbf.eot} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf → images/b2e4cf0fab6c8ca66b7f.ttf} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf.br → images/b2e4cf0fab6c8ca66b7f.ttf.br} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-regular-df8c4bee41b6ca0ed2b7b71456ed7fbb.ttf.gz → images/b2e4cf0fab6c8ca66b7f.ttf.gz} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-700-df7e79af617f98cd3b95d320e8b2a1af.eot → images/b78d61ab7e046de8c156.eot} +0 -0
- data/public/avo-packs/media/{fonts/nunito-v16-latin-700-7c472b19cb573f537bad8ef62ca917ac.woff → images/c9ab29becb76ddab01d0.woff} +0 -0
- data/public/avo-packs/media/images/{logo-edf8d8d0d263e0c1f73bb32a222d9991.png → f1b4befac91a3336db9a.png} +0 -0
- metadata +195 -193
- data/app/frontend/css/components/code.css +0 -27
- data/app/views/layouts/avo/application_vue.html.erb +0 -61
- data/config/webpack/environment.js +0 -18
- data/config/webpacker_packed.yml +0 -86
- data/db/migrate/20210305082639_add_url_to_teams.rb +0 -5
- data/lib/avo/app/action.rb +0 -145
- data/lib/avo/app/actions_loader.rb +0 -11
- data/lib/avo/app/app.rb +0 -183
- data/lib/avo/app/fields_loader.rb +0 -29
- data/lib/avo/app/filter.rb +0 -23
- 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 -299
- data/lib/avo/app/resource_grid_fields.rb +0 -30
- data/lib/avo/app/services/authorization_service.rb +0 -110
- data/lib/avo/app/services/panel_service.rb +0 -25
- 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/%plural_name%_controller.tt +0 -2
- data/lib/generators/avo/templates/resource/%singular_name%.tt +0 -20
- data/public/avo-packs/css/application-3598cfbb.css +0 -6
- data/public/avo-packs/css/application-3598cfbb.css.br +0 -0
- data/public/avo-packs/css/application-3598cfbb.css.gz +0 -0
- data/public/avo-packs/js/1-0565987ca0c3045602ad.chunk.js +0 -2
- 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 +0 -1
- 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-6ba2bd1bca05d69b96e0.js +0 -26
- data/public/avo-packs/js/application-6ba2bd1bca05d69b96e0.js.br +0 -0
- data/public/avo-packs/js/application-6ba2bd1bca05d69b96e0.js.gz +0 -0
- data/public/avo-packs/js/application-6ba2bd1bca05d69b96e0.js.map +0 -1
- data/public/avo-packs/js/application-6ba2bd1bca05d69b96e0.js.map.br +0 -0
- data/public/avo-packs/js/application-6ba2bd1bca05d69b96e0.js.map.gz +0 -0
- data/public/avo-packs/manifest.json.br +0 -0
- data/public/avo-packs/manifest.json.gz +0 -0
@@ -1,27 +0,0 @@
|
|
1
|
-
@import 'codemirror/lib/codemirror.css';
|
2
|
-
|
3
|
-
/* themes */
|
4
|
-
@import 'codemirror/theme/dracula.css';
|
5
|
-
@import 'codemirror/theme/eclipse.css';
|
6
|
-
@import 'codemirror/theme/material-darker.css';
|
7
|
-
|
8
|
-
|
9
|
-
/* programming_languages */
|
10
|
-
@import 'codemirror/mode/css/css'
|
11
|
-
@import 'codemirror/mode/dockerfile/dockerfile'
|
12
|
-
@import 'codemirror/mode/htmlmixed/htmlmixed'
|
13
|
-
@import 'codemirror/mode/javascript/javascript'
|
14
|
-
@import 'codemirror/mode/markdown/markdown'
|
15
|
-
@import 'codemirror/mode/nginx/nginx'
|
16
|
-
@import 'codemirror/mode/php/php'
|
17
|
-
@import 'codemirror/mode/ruby/ruby'
|
18
|
-
@import 'codemirror/mode/sass/sass'
|
19
|
-
@import 'codemirror/mode/shell/shell'
|
20
|
-
@import 'codemirror/mode/sql/sql'
|
21
|
-
@import 'codemirror/mode/vue/vue'
|
22
|
-
@import 'codemirror/mode/xml/xml'
|
23
|
-
|
24
|
-
.CodeMirror {
|
25
|
-
height: var(--height) !important;
|
26
|
-
min-height: auto;
|
27
|
-
}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Avo</title>
|
5
|
-
<%= csrf_meta_tags %>
|
6
|
-
<%= csp_meta_tag %>
|
7
|
-
<%= render partial: 'layouts/avo/javascript' %>
|
8
|
-
|
9
|
-
<%= javascript_pack_tag 'application' %>
|
10
|
-
<%= stylesheet_pack_tag 'application', media: 'all' %>
|
11
|
-
<%= render partial: 'layouts/avo/translations' %>
|
12
|
-
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&display=swap" rel="stylesheet">
|
13
|
-
</head>
|
14
|
-
|
15
|
-
<body class="bg-gray-200">
|
16
|
-
|
17
|
-
<div id="app" class="flex min-h-screen flex-row h-full">
|
18
|
-
<app-layout class="flex flex-1 w-full"
|
19
|
-
:router-key="routerKey"
|
20
|
-
:layout="layout"
|
21
|
-
inline-template
|
22
|
-
>
|
23
|
-
<div>
|
24
|
-
<application-sidebar v-if="layout !== 'blank'">
|
25
|
-
<template #logo>
|
26
|
-
<%= render_logo %>
|
27
|
-
</template>
|
28
|
-
<template #licensing>
|
29
|
-
<license-warnings></license-warnings>
|
30
|
-
</template>
|
31
|
-
</application-sidebar>
|
32
|
-
|
33
|
-
<div class="flex-1 flex flex-col h-full overflow-auto">
|
34
|
-
<div class="relative bg-white p-2 shadow-md h-16 w-full flex flex-shrink-0 items-center z-50" v-if="layout !== 'blank'">
|
35
|
-
<div class="ml-6">
|
36
|
-
<%= render_header %>
|
37
|
-
</div>
|
38
|
-
<div class="flex-1 flex justify-center">
|
39
|
-
<div class="w-64">
|
40
|
-
<resources-search :global="true">
|
41
|
-
</div>
|
42
|
-
</div>
|
43
|
-
</div>
|
44
|
-
|
45
|
-
<div v-if="layout === 'blank'" class="h-full w-full flex justify-center items-center">
|
46
|
-
<%= yield %>
|
47
|
-
</div>
|
48
|
-
|
49
|
-
<div class="content p-8 flex-1 flex flex-col justify-between items-stretch" v-else>
|
50
|
-
<%= yield %>
|
51
|
-
<%= render_footer %>
|
52
|
-
</div>
|
53
|
-
</div>
|
54
|
-
</div>
|
55
|
-
</app-layout>
|
56
|
-
</div>
|
57
|
-
|
58
|
-
<%= render_scripts %>
|
59
|
-
|
60
|
-
</body>
|
61
|
-
</html>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
const { environment } = require('@rails/webpacker')
|
2
|
-
const aliases = require('./aliases')
|
3
|
-
|
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
|
-
|
18
|
-
module.exports = environment
|
data/config/webpacker_packed.yml
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
# Note: You must restart bin/webpack-dev-server for changes to take effect
|
2
|
-
|
3
|
-
default: &default
|
4
|
-
source_path: app/frontend
|
5
|
-
source_entry_path: packs
|
6
|
-
public_root_path: public
|
7
|
-
cache_path: tmp/cache/webpacker
|
8
|
-
check_yarn_integrity: false
|
9
|
-
# use a different sub-folder name
|
10
|
-
public_output_path: avo-packs
|
11
|
-
webpack_compile_output: true
|
12
|
-
|
13
|
-
# Additional paths webpack should lookup modules
|
14
|
-
# ['app/assets', 'engine/foo/app/assets']
|
15
|
-
resolved_paths: []
|
16
|
-
|
17
|
-
# Reload manifest.json on all requests so we reload latest compiled packs
|
18
|
-
cache_manifest: false
|
19
|
-
|
20
|
-
# Extract and emit a css file
|
21
|
-
extract_css: true
|
22
|
-
|
23
|
-
static_assets_extensions:
|
24
|
-
- .jpg
|
25
|
-
- .jpeg
|
26
|
-
- .png
|
27
|
-
- .gif
|
28
|
-
- .tiff
|
29
|
-
- .ico
|
30
|
-
- .svg
|
31
|
-
- .eot
|
32
|
-
- .otf
|
33
|
-
- .ttf
|
34
|
-
- .woff
|
35
|
-
- .woff2
|
36
|
-
|
37
|
-
extensions:
|
38
|
-
- .ts
|
39
|
-
- .vue
|
40
|
-
- .mjs
|
41
|
-
- .js
|
42
|
-
- .sass
|
43
|
-
- .scss
|
44
|
-
- .css
|
45
|
-
- .module.sass
|
46
|
-
- .module.scss
|
47
|
-
- .module.css
|
48
|
-
- .png
|
49
|
-
- .svg
|
50
|
-
- .gif
|
51
|
-
- .jpeg
|
52
|
-
- .jpg
|
53
|
-
|
54
|
-
# 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.
|
56
|
-
development:
|
57
|
-
<<: *default
|
58
|
-
|
59
|
-
# Production depends on precompilation of packs prior to booting for performance.
|
60
|
-
compile: false
|
61
|
-
|
62
|
-
# Extract and emit a css file
|
63
|
-
extract_css: true
|
64
|
-
|
65
|
-
# Cache manifest.json for performance
|
66
|
-
cache_manifest: true
|
67
|
-
|
68
|
-
test:
|
69
|
-
<<: *default
|
70
|
-
compile: true
|
71
|
-
|
72
|
-
# Compile test packs to a separate directory
|
73
|
-
public_output_path: packs-test
|
74
|
-
public_root_path: spec/dummy/public
|
75
|
-
|
76
|
-
production:
|
77
|
-
<<: *default
|
78
|
-
|
79
|
-
# Production depends on precompilation of packs prior to booting for performance.
|
80
|
-
compile: false
|
81
|
-
|
82
|
-
# Extract and emit a css file
|
83
|
-
extract_css: true
|
84
|
-
|
85
|
-
# Cache manifest.json for performance
|
86
|
-
cache_manifest: true
|
data/lib/avo/app/action.rb
DELETED
@@ -1,145 +0,0 @@
|
|
1
|
-
require_relative 'fields_loader'
|
2
|
-
|
3
|
-
|
4
|
-
module Avo
|
5
|
-
module Actions
|
6
|
-
class Action
|
7
|
-
attr_accessor :name
|
8
|
-
attr_accessor :message
|
9
|
-
attr_accessor :default
|
10
|
-
attr_accessor :theme
|
11
|
-
attr_accessor :confirm_text
|
12
|
-
attr_accessor :cancel_text
|
13
|
-
# response: {
|
14
|
-
# message: String
|
15
|
-
# message_type: success | error
|
16
|
-
# type: reload | reload_resources | redirect | http_redirect | open_in_new_tab | download
|
17
|
-
# path: String
|
18
|
-
# filename: String
|
19
|
-
# }
|
20
|
-
attr_accessor :response
|
21
|
-
attr_accessor :no_confirmation
|
22
|
-
attr_accessor :model
|
23
|
-
attr_accessor :resource
|
24
|
-
attr_accessor :user
|
25
|
-
|
26
|
-
attr_accessor :field_loader
|
27
|
-
|
28
|
-
alias :field :field_loader
|
29
|
-
alias :f :field
|
30
|
-
|
31
|
-
@@default = nil
|
32
|
-
|
33
|
-
def initialize
|
34
|
-
@name ||= name
|
35
|
-
@message ||= I18n.t('avo.are_you_sure_you_want_to_run_this_option')
|
36
|
-
@default ||= ''
|
37
|
-
@fields ||= []
|
38
|
-
@confirm_text ||= I18n.t('avo.run')
|
39
|
-
@cancel_text ||= I18n.t('avo.cancel')
|
40
|
-
@response ||= {}
|
41
|
-
@response[:message_type] ||= :notice
|
42
|
-
@response[:message] ||= I18n.t('avo.action_ran_successfully')
|
43
|
-
@theme ||= 'success'
|
44
|
-
@no_confirmation ||= false
|
45
|
-
end
|
46
|
-
|
47
|
-
def boot_fields(request)
|
48
|
-
@field_loader = Avo::FieldsLoader.new
|
49
|
-
fields request if self.respond_to? :fields
|
50
|
-
end
|
51
|
-
|
52
|
-
def get_fields(view_type: :table)
|
53
|
-
get_field_definitions.map do |field|
|
54
|
-
field.hydrate(action: self, model: @model)
|
55
|
-
end
|
56
|
-
.select do |field|
|
57
|
-
field.can_see.present? ? field.can_see.call : true
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def get_field_definitions
|
62
|
-
@field_loader.bag.map do |field|
|
63
|
-
field.hydrate(action: self)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def hydrate(model: nil, resource: nil, user: nil)
|
68
|
-
@model = model if model.present?
|
69
|
-
@resource = resource if resource.present?
|
70
|
-
@user = user if user.present?
|
71
|
-
|
72
|
-
self
|
73
|
-
end
|
74
|
-
|
75
|
-
def handle_action(request, models, raw_fields)
|
76
|
-
avo_fields = get_fields.map { |field| [field.id, field] }.to_h
|
77
|
-
|
78
|
-
if raw_fields.present?
|
79
|
-
fields = raw_fields.to_unsafe_h.map do |name, value|
|
80
|
-
[name, avo_fields[name.to_sym].resolve_attribute(value)]
|
81
|
-
end
|
82
|
-
|
83
|
-
fields = fields.to_h
|
84
|
-
else
|
85
|
-
fields = {}
|
86
|
-
end
|
87
|
-
|
88
|
-
result = self.handle request, models, fields
|
89
|
-
|
90
|
-
self
|
91
|
-
end
|
92
|
-
|
93
|
-
def param_id
|
94
|
-
self.class.name.underscore.gsub '/', '_'
|
95
|
-
end
|
96
|
-
|
97
|
-
def name
|
98
|
-
self.class.name.demodulize.underscore.humanize(keep_id_suffix: true)
|
99
|
-
end
|
100
|
-
|
101
|
-
def succeed(text)
|
102
|
-
self.response[:message_type] = :notice
|
103
|
-
self.response[:message] = text
|
104
|
-
|
105
|
-
self
|
106
|
-
end
|
107
|
-
|
108
|
-
def fail(text)
|
109
|
-
self.response[:message_type] = :alert
|
110
|
-
self.response[:message] = text
|
111
|
-
|
112
|
-
self
|
113
|
-
end
|
114
|
-
|
115
|
-
def redirect_to(path = nil, &block)
|
116
|
-
self.response[:type] = :redirect
|
117
|
-
if block.present?
|
118
|
-
self.response[:path] = block
|
119
|
-
else
|
120
|
-
self.response[:path] = path
|
121
|
-
end
|
122
|
-
|
123
|
-
self
|
124
|
-
end
|
125
|
-
|
126
|
-
def reload
|
127
|
-
self.response[:type] = :reload
|
128
|
-
|
129
|
-
self
|
130
|
-
end
|
131
|
-
|
132
|
-
def download(path, filename)
|
133
|
-
self.response[:type] = :download
|
134
|
-
self.response[:path] = path
|
135
|
-
self.response[:filename] = filename
|
136
|
-
|
137
|
-
self
|
138
|
-
end
|
139
|
-
|
140
|
-
def self.param_id
|
141
|
-
self.name.underscore.gsub '/', '_'
|
142
|
-
end
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
data/lib/avo/app/app.rb
DELETED
@@ -1,183 +0,0 @@
|
|
1
|
-
require_relative 'tools_manager'
|
2
|
-
require_relative 'filter'
|
3
|
-
require_relative 'filters/select_filter'
|
4
|
-
require_relative 'filters/boolean_filter'
|
5
|
-
require_relative 'resource'
|
6
|
-
require_relative 'tool'
|
7
|
-
require_relative 'services/authorization_service'
|
8
|
-
|
9
|
-
module Avo
|
10
|
-
class App
|
11
|
-
@@app = {
|
12
|
-
root_path: '',
|
13
|
-
resources: [],
|
14
|
-
cache_store: nil
|
15
|
-
}
|
16
|
-
@@license = nil
|
17
|
-
@@fields = []
|
18
|
-
|
19
|
-
class << self
|
20
|
-
def boot
|
21
|
-
# init_controllers
|
22
|
-
@@app[:root_path] = Pathname.new(File.join(__dir__, '..', '..'))
|
23
|
-
init_fields
|
24
|
-
I18n.locale = Avo.configuration.language_code
|
25
|
-
|
26
|
-
if Rails.cache.class == ActiveSupport::Cache::NullStore
|
27
|
-
@@app[:cache_store] ||= ActiveSupport::Cache::MemoryStore.new
|
28
|
-
else
|
29
|
-
@@app[:cache_store] = Rails.cache
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def init(current_request = nil)
|
34
|
-
# Set the current host for ActiveStorage
|
35
|
-
ActiveStorage::Current.host = current_request.base_url
|
36
|
-
|
37
|
-
init_resources current_request
|
38
|
-
@@license = LicenseManager.new(HQ.new(current_request).response).license
|
39
|
-
end
|
40
|
-
|
41
|
-
def app
|
42
|
-
@@app
|
43
|
-
end
|
44
|
-
|
45
|
-
def fields
|
46
|
-
@@fields
|
47
|
-
end
|
48
|
-
|
49
|
-
def license
|
50
|
-
@@license
|
51
|
-
end
|
52
|
-
|
53
|
-
def cache_store
|
54
|
-
@@app[:cache_store]
|
55
|
-
end
|
56
|
-
|
57
|
-
# This method will find all fields available in the Avo::Fields namespace and add them to a @@fields array
|
58
|
-
# so later we can instantiate them on our resources.
|
59
|
-
#
|
60
|
-
# If the field has their `def_method` set up it will follow that convention, if not it will snake_case the name:
|
61
|
-
#
|
62
|
-
# Avo::Fields::TextField -> text
|
63
|
-
# Avo::Fields::DateTimeField -> date_time
|
64
|
-
def init_fields
|
65
|
-
Avo::Fields.constants.each do |class_name|
|
66
|
-
next if class_name.to_s == 'Field'
|
67
|
-
|
68
|
-
field_class = method_name = nil
|
69
|
-
|
70
|
-
if class_name.to_s.end_with? 'Field'
|
71
|
-
field_class = "Avo::Fields::#{class_name.to_s}".safe_constantize
|
72
|
-
method_name = field_class.get_field_name
|
73
|
-
else
|
74
|
-
# Try one level deeper for custom fields
|
75
|
-
namespace = class_name
|
76
|
-
tool_provider = "Avo::Fields::#{namespace}::ToolProvider".safe_constantize
|
77
|
-
|
78
|
-
next unless tool_provider.present?
|
79
|
-
|
80
|
-
tool_provider.boot
|
81
|
-
|
82
|
-
"Avo::Fields::#{namespace}".safe_constantize.constants.each do |custom_field_class|
|
83
|
-
next unless custom_field_class.to_s.end_with? 'Field' or custom_field_class.to_s == 'Field'
|
84
|
-
|
85
|
-
field_class = "Avo::Fields::#{namespace}::#{custom_field_class}".safe_constantize
|
86
|
-
method_name = field_class.get_field_name
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
if field_class.present? and method_name.present?
|
91
|
-
load_field method_name, field_class
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def load_field(method_name, klass)
|
97
|
-
@@fields.push(
|
98
|
-
name: method_name,
|
99
|
-
class: klass,
|
100
|
-
)
|
101
|
-
end
|
102
|
-
|
103
|
-
def init_resources(request)
|
104
|
-
@@app[:resources] = Avo::Resources.constants
|
105
|
-
.select do |r|
|
106
|
-
r != :Resource
|
107
|
-
end
|
108
|
-
.map do |c|
|
109
|
-
if Avo::Resources.const_get(c).is_a? Class
|
110
|
-
"Avo::Resources::#{c}".safe_constantize.new request
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
def get_resources
|
116
|
-
@@app[:resources]
|
117
|
-
end
|
118
|
-
|
119
|
-
# Returns the Avo resource by camelized name
|
120
|
-
#
|
121
|
-
# get_resource_by_name('User') => Avo::Resources::User
|
122
|
-
def get_resource(resource)
|
123
|
-
@@app[:resources].find do |available_resource|
|
124
|
-
"Avo::Resources::#{resource}".safe_constantize == available_resource.class
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
# Returns the Avo resource by singular snake_cased name
|
129
|
-
#
|
130
|
-
# get_resource_by_name('user') => Avo::Resources::User
|
131
|
-
def get_resource_by_name(name)
|
132
|
-
self.get_resource name.singularize.camelize
|
133
|
-
end
|
134
|
-
|
135
|
-
# Returns the Avo resource by singular snake_cased name
|
136
|
-
#
|
137
|
-
# get_resource_by_name('User') => Avo::Resources::User
|
138
|
-
# get_resource_by_name(User) => Avo::Resources::User
|
139
|
-
def get_resource_by_model_name(name)
|
140
|
-
get_resources.find do |resource|
|
141
|
-
resource.model_class.model_name.name == name.to_s
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
# Returns the Rails model class by singular snake_cased name
|
146
|
-
#
|
147
|
-
# get_model_class_by_name('user') => User
|
148
|
-
def get_model_class_by_name(name)
|
149
|
-
name.to_s.camelize.singularize
|
150
|
-
end
|
151
|
-
|
152
|
-
def get_available_resources(user = nil)
|
153
|
-
App.get_resources
|
154
|
-
.select do |resource|
|
155
|
-
AuthorizationService::authorize user, resource.model, Avo.configuration.authorization_methods.stringify_keys['index'], raise_exception: false
|
156
|
-
end
|
157
|
-
.sort_by { |r| r.name }
|
158
|
-
end
|
159
|
-
|
160
|
-
def get_navigation_items(user = nil)
|
161
|
-
get_available_resources(user).select do |resource|
|
162
|
-
resource.model_class.present?
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
def draw_routes
|
167
|
-
Proc.new do
|
168
|
-
Avo::Resources.constants
|
169
|
-
.select do |resource|
|
170
|
-
resource != :Resource
|
171
|
-
end
|
172
|
-
.map do |resource|
|
173
|
-
if Avo::Resources.const_get(resource).is_a? Class
|
174
|
-
route_key = resource.to_s.underscore.downcase.pluralize.to_sym
|
175
|
-
|
176
|
-
resources route_key
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
180
|
-
end
|
181
|
-
end
|
182
|
-
end
|
183
|
-
end
|