avo 0.5.0.beta3 → 0.5.0.beta8
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_grid_component.html.erb +1 -1
- data/app/components/avo/index/resource_table_component.html.erb +2 -2
- 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 +4 -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/{frontend/css → packs/stylesheets}/components/code.css +0 -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 +2 -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-5bb09ba4.css +6024 -0
- data/public/avo-packs/css/application-5bb09ba4.css.br +0 -0
- data/public/avo-packs/css/application-5bb09ba4.css.gz +0 -0
- data/public/avo-packs/css/application-5bb09ba4.css.map +1 -0
- data/public/avo-packs/css/application-5bb09ba4.css.map.br +0 -0
- data/public/avo-packs/css/application-5bb09ba4.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-86a3ea5a835b0c758203.js +26 -0
- data/public/avo-packs/js/{application-6ba2bd1bca05d69b96e0.js.LICENSE.txt → application-86a3ea5a835b0c758203.js.LICENSE.txt} +17 -17
- data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.br +0 -0
- data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.gz +0 -0
- data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map +1 -0
- data/public/avo-packs/js/application-86a3ea5a835b0c758203.js.map.br +0 -0
- data/public/avo-packs/js/application-86a3ea5a835b0c758203.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/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 -291
- 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,10 +1,10 @@
|
|
1
1
|
<div class="w-full">
|
2
2
|
<% if @resources.present?%>
|
3
3
|
<table class="w-full px-4 overflow-hidden">
|
4
|
-
<%= render partial: 'avo/partials/table_header', locals: {fields: @resource.get_fields(
|
4
|
+
<%= render partial: 'avo/partials/table_header', locals: {fields: @resource.get_fields(reflection: @reflection)} %>
|
5
5
|
<tbody>
|
6
6
|
<% @resources.each_with_index do |resource, index| %>
|
7
|
-
<% cache_if Avo.configuration.cache_resources_on_index_view,
|
7
|
+
<% cache_if Avo.configuration.cache_resources_on_index_view, resource.cache_hash(@parent_model) do %>
|
8
8
|
<%= render Avo::Index::TableRowComponent.new(resource: resource, reflection: @reflection, parent_model: @parent_model) %>
|
9
9
|
<% end %>
|
10
10
|
<% end %>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<%== item_selector_input floating: false %>
|
8
8
|
</div>
|
9
9
|
</td>
|
10
|
-
<% @resource.get_fields(
|
10
|
+
<% @resource.get_fields(reflection: @reflection).each_with_index do |field, index| %>
|
11
11
|
<%= index_field field, index, @resource %>
|
12
12
|
<% end %>
|
13
13
|
<td class="text-right whitespace-nowrap px-2">
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="flex items-start leading-tight <%= @classes %> min-h-16" data-field-id="<%= @field.id %>">
|
1
|
+
<div class="flex items-start leading-tight <%= @classes %> min-h-16" data-field-id="<%= @field.id %>" data-field-type="<%= @field.type %>">
|
2
2
|
<div class="h-16 flex self-start items-center text-blue-gray-800">
|
3
3
|
<div class="w-48 md:w-64 px-8" data-slot="label">
|
4
4
|
<%= @field.name %> <% if @field.required %> <span class="text-red-600">*</span> <% end %>
|
@@ -18,8 +18,20 @@
|
|
18
18
|
<% end %>
|
19
19
|
|
20
20
|
<% if @resource.authorization.authorize_action(:destroy, raise_exception: false) %>
|
21
|
-
<%=
|
22
|
-
<%=
|
21
|
+
<%= form_with url: helpers.resource_path(@resource.model), method: :delete, html: { 'data-turbo-frame': params[:turbo_frame] } do |form| %>
|
22
|
+
<%= a_button title: t('avo.delete_item', { item: @resource.model.model_name.name.downcase }).capitalize,
|
23
|
+
color: 'red',
|
24
|
+
variant: 'outlined',
|
25
|
+
type: :submit,
|
26
|
+
data: {
|
27
|
+
confirm: t('avo.are_you_sure', { item: @resource.model.model_name.name.downcase }),
|
28
|
+
control: :destroy,
|
29
|
+
'resource-id': @resource.model.id,
|
30
|
+
'tippy': 'tooltip',
|
31
|
+
} do
|
32
|
+
%>
|
33
|
+
<%= svg 'trash' %> <%= t('avo.delete').capitalize %>
|
34
|
+
<% end %>
|
23
35
|
<% end %>
|
24
36
|
<% end %>
|
25
37
|
|
@@ -6,7 +6,9 @@ module Avo
|
|
6
6
|
before_action :set_resource
|
7
7
|
before_action :set_action, only: [:show, :handle]
|
8
8
|
|
9
|
-
def show
|
9
|
+
def show
|
10
|
+
@model = ActionModel.new @action.get_attributes_for_action
|
11
|
+
end
|
10
12
|
|
11
13
|
def handle
|
12
14
|
resource_ids = action_params[:fields][:resource_ids].split(',').map(&:to_i)
|
@@ -16,7 +18,7 @@ module Avo
|
|
16
18
|
key != 'resource_ids'
|
17
19
|
end
|
18
20
|
|
19
|
-
performed_action = @action.handle_action(
|
21
|
+
performed_action = @action.handle_action(models: models, fields: fields)
|
20
22
|
|
21
23
|
respond performed_action.response
|
22
24
|
end
|
@@ -27,17 +29,13 @@ module Avo
|
|
27
29
|
end
|
28
30
|
|
29
31
|
def set_action
|
30
|
-
action_class = params[:action_id].gsub('avo_actions_', '').classify
|
31
|
-
action_name = "Avo::Actions::#{action_class}"
|
32
|
+
action_class = params[:action_id].gsub('avo_actions_', '').classify.safe_constantize
|
32
33
|
|
33
34
|
if params[:id].present?
|
34
35
|
model = @resource.model_class.find params[:id]
|
35
36
|
end
|
36
37
|
|
37
|
-
@action =
|
38
|
-
@action.configure
|
39
|
-
@action.hydrate(model: model, resource: resource, user: _current_user)
|
40
|
-
@action.boot_fields request
|
38
|
+
@action = action_class.new(model: model, resource: resource, user: _current_user)
|
41
39
|
end
|
42
40
|
|
43
41
|
def respond(response)
|
@@ -11,12 +11,11 @@ module Avo
|
|
11
11
|
rescue_from Pundit::NotAuthorizedError, with: :render_unauthorized
|
12
12
|
rescue_from ActiveRecord::RecordInvalid, with: :exception_logger
|
13
13
|
|
14
|
-
helper_method :_current_user, :resources_path, :resource_path, :new_resource_path, :edit_resource_path, :resource_attach_path, :resource_detach_path
|
14
|
+
helper_method :_current_user, :resources_path, :resource_path, :new_resource_path, :edit_resource_path, :resource_attach_path, :resource_detach_path, :related_resources_path
|
15
15
|
add_flash_types :info, :warning, :success, :error
|
16
16
|
|
17
17
|
def init_app
|
18
|
-
Avo::App.
|
19
|
-
Avo::App.init request
|
18
|
+
Avo::App.init request: request, context: context
|
20
19
|
|
21
20
|
@license = Avo::App.license
|
22
21
|
end
|
@@ -25,7 +24,7 @@ module Avo
|
|
25
24
|
respond_to do |format|
|
26
25
|
format.html { raise exception }
|
27
26
|
format.json { render json: {
|
28
|
-
errors: exception.record.present? ? exception.record.errors : [],
|
27
|
+
errors: exception.respond_to?(:record) && exception.record.present? ? exception.record.errors : [],
|
29
28
|
message: exception.message,
|
30
29
|
traces: exception.backtrace,
|
31
30
|
}, status: ActionDispatch::ExceptionWrapper.status_code_for_exception(exception.class.name) }
|
@@ -36,6 +35,10 @@ module Avo
|
|
36
35
|
instance_eval(&Avo.configuration.current_user)
|
37
36
|
end
|
38
37
|
|
38
|
+
def context
|
39
|
+
instance_eval(&Avo.configuration.context)
|
40
|
+
end
|
41
|
+
|
39
42
|
def resources_path(model, keep_query_params: false, **args)
|
40
43
|
return if model.nil?
|
41
44
|
|
@@ -50,6 +53,22 @@ module Avo
|
|
50
53
|
send :"resources_#{model.model_name.route_key}_path", **existing_params, **args
|
51
54
|
end
|
52
55
|
|
56
|
+
def related_resources_path(parent_model, model, keep_query_params: false, **args)
|
57
|
+
return if model.nil?
|
58
|
+
|
59
|
+
existing_params = {}
|
60
|
+
|
61
|
+
begin
|
62
|
+
if keep_query_params
|
63
|
+
existing_params = Addressable::URI.parse(request.fullpath).query_values.symbolize_keys
|
64
|
+
end
|
65
|
+
rescue;end
|
66
|
+
|
67
|
+
Addressable::Template.new("#{Avo.configuration.root_path}/resources/#{@parent_resource.model.model_name.route_key}/#{@parent_resource.model.id}/#{@resource.route_key}{?query*}")
|
68
|
+
.expand({query: {**existing_params, **args}})
|
69
|
+
.to_str
|
70
|
+
end
|
71
|
+
|
53
72
|
def resource_path(model = nil, resource_id: nil, keep_query_params: false, **args)
|
54
73
|
existing_params = {}
|
55
74
|
|
@@ -152,7 +171,12 @@ module Avo
|
|
152
171
|
# Gets the Avo resource for this request based on the request from the `resource_name` "param"
|
153
172
|
# Ex: Avo::Resources::Project, Avo::Resources::Team, Avo::Resources::User
|
154
173
|
def resource
|
155
|
-
|
174
|
+
|
175
|
+
resource = App.get_resource @resource_name.to_s.camelize.singularize
|
176
|
+
|
177
|
+
return resource if resource.present?
|
178
|
+
|
179
|
+
App.get_resource_by_controller_name @resource_name
|
156
180
|
end
|
157
181
|
|
158
182
|
def related_resource
|
@@ -221,7 +245,7 @@ module Avo
|
|
221
245
|
end
|
222
246
|
|
223
247
|
def set_authorization
|
224
|
-
@authorization = AuthorizationService.new _current_user
|
248
|
+
@authorization = Services::AuthorizationService.new _current_user
|
225
249
|
end
|
226
250
|
|
227
251
|
def set_container_classes
|
@@ -103,7 +103,7 @@ module Avo
|
|
103
103
|
@model.destroy!
|
104
104
|
|
105
105
|
respond_to do |format|
|
106
|
-
format.html { redirect_to params[:referrer] || resources_path(@model), notice: t('avo.resource_destroyed', attachment_class: @attachment_class) }
|
106
|
+
format.html { redirect_to params[:referrer] || resources_path(@model, turbo_frame: params[:turbo_frame], view_type: params[:view_type]), notice: t('avo.resource_destroyed', attachment_class: @attachment_class) }
|
107
107
|
format.json { head :no_content }
|
108
108
|
end
|
109
109
|
end
|
@@ -161,18 +161,15 @@ module Avo
|
|
161
161
|
@index_params[:per_page] = cookies[:per_page]
|
162
162
|
end
|
163
163
|
|
164
|
-
if
|
165
|
-
@index_params[:per_page] =
|
164
|
+
if @parent_model.present?
|
165
|
+
@index_params[:per_page] = Avo.configuration.via_per_page
|
166
166
|
end
|
167
167
|
|
168
168
|
if params[:per_page].present?
|
169
|
+
@index_params[:per_page] = params[:per_page]
|
169
170
|
cookies[:per_page] = params[:per_page]
|
170
171
|
end
|
171
172
|
|
172
|
-
if @parent_model.present?
|
173
|
-
@index_params[:per_page] = Avo.configuration.via_per_page
|
174
|
-
end
|
175
|
-
|
176
173
|
# Sorting
|
177
174
|
@index_params[:sort_by] = params[:sort_by] || :created_at
|
178
175
|
@index_params[:sort_direction] = params[:sort_direction] || :desc
|
@@ -186,8 +183,6 @@ module Avo
|
|
186
183
|
@filters = @resource.get_filters.map do |filter_class|
|
187
184
|
filter = filter_class.new
|
188
185
|
|
189
|
-
filter.configure
|
190
|
-
|
191
186
|
filter
|
192
187
|
end
|
193
188
|
end
|
@@ -198,12 +193,7 @@ module Avo
|
|
198
193
|
end
|
199
194
|
|
200
195
|
@actions = @resource.get_actions.map do |action|
|
201
|
-
action
|
202
|
-
|
203
|
-
action.hydrate(model: model, resource: @resource)
|
204
|
-
action.boot_fields request
|
205
|
-
|
206
|
-
action
|
196
|
+
action.new(model: model, resource: @resource)
|
207
197
|
end
|
208
198
|
end
|
209
199
|
|
@@ -216,7 +206,6 @@ module Avo
|
|
216
206
|
|
217
207
|
@resource.get_filters.each do |filter_class|
|
218
208
|
filter = filter_class.new
|
219
|
-
filter.configure
|
220
209
|
|
221
210
|
if filter.default.present?
|
222
211
|
filter_defaults[filter_class.to_s] = filter.default
|
@@ -35,7 +35,7 @@ module Avo
|
|
35
35
|
@options = query.all.map do |model|
|
36
36
|
{
|
37
37
|
value: model.id,
|
38
|
-
label: model.send(@attachment_resource.title)
|
38
|
+
label: model.send(@attachment_resource.class.title)
|
39
39
|
}
|
40
40
|
end
|
41
41
|
end
|
@@ -66,7 +66,7 @@ module Avo
|
|
66
66
|
end
|
67
67
|
|
68
68
|
respond_to do |format|
|
69
|
-
format.html { redirect_to params[:referrer] ||
|
69
|
+
format.html { redirect_to params[:referrer] || resource_path(@model), notice: t('avo.attachment_class_detached', attachment_class: @attachment_class) }
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
@@ -130,7 +130,7 @@ module Avo
|
|
130
130
|
options[:class] += args[:extra_class].present? ? " #{args[:extra_class]}" : ''
|
131
131
|
|
132
132
|
# Create the path to the svgs directory
|
133
|
-
file_path = "#{Avo::Engine.root}/app/
|
133
|
+
file_path = "#{Avo::Engine.root}/app/packs/svgs/#{file_name}"
|
134
134
|
file_path = "#{file_path}.svg" unless file_path.end_with? '.svg'
|
135
135
|
|
136
136
|
# Create a cache hash
|
@@ -5,20 +5,21 @@
|
|
5
5
|
@import './../../../node_modules/trix/dist/trix.css';
|
6
6
|
@import './../../../node_modules/flatpickr/dist/flatpickr.css';
|
7
7
|
|
8
|
-
@import './tailwindcss/base.css';
|
9
|
-
@import './tailwindcss/components.css';
|
10
8
|
|
11
|
-
@import '
|
12
|
-
@import './typography.css';
|
13
|
-
@import './tooltips.css';
|
14
|
-
@import './alerts.css';
|
15
|
-
@import './loader.css';
|
16
|
-
@import './pagination.css';
|
9
|
+
@import './../stylesheets/tailwindcss/base.css';
|
17
10
|
|
18
|
-
@import '
|
19
|
-
@import '
|
11
|
+
@import './../stylesheets/fonts.css';
|
12
|
+
@import './../stylesheets/typography.css';
|
13
|
+
@import './../stylesheets/tooltips.css';
|
14
|
+
@import './../stylesheets/alerts.css';
|
15
|
+
@import './../stylesheets/loader.css';
|
16
|
+
@import './../stylesheets/pagination.css';
|
20
17
|
|
21
|
-
@import '
|
18
|
+
@import './../stylesheets/components/status.css';
|
19
|
+
@import './../stylesheets/components/code.css';
|
20
|
+
@import './../stylesheets/tailwindcss/components.css';
|
21
|
+
|
22
|
+
@import './../stylesheets/tailwindcss/utilities.css';
|
22
23
|
|
23
24
|
html,
|
24
25
|
body {
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import '@/css/application.css'
|
2
|
-
|
3
1
|
import 'regenerator-runtime/runtime'
|
4
2
|
import 'trix'
|
5
3
|
import * as Mousetrap from 'mousetrap'
|
@@ -7,11 +5,14 @@ import { Application } from 'stimulus'
|
|
7
5
|
import { Turbo } from '@hotwired/turbo-rails'
|
8
6
|
import { definitionsFromContext } from 'stimulus/webpack-helpers'
|
9
7
|
import tippy from 'tippy.js'
|
8
|
+
import Rails from '@rails/ujs';
|
9
|
+
|
10
|
+
Rails.start();
|
10
11
|
|
11
12
|
// Toastr alerts
|
12
13
|
import '../js/toastr'
|
13
14
|
|
14
|
-
Mousetrap.bind('r r r', () => Turbo.visit(window.location.href))
|
15
|
+
Mousetrap.bind('r r r', () => Turbo.visit(window.location.href, { action: "replace" }))
|
15
16
|
|
16
17
|
const application = Application.start()
|
17
18
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { Controller } from 'stimulus'
|
2
|
-
import { Turbo } from '@hotwired/turbo-rails'
|
3
2
|
import URI from 'urijs'
|
4
3
|
|
5
4
|
export default class extends Controller {
|
@@ -35,13 +34,30 @@ export default class extends Controller {
|
|
35
34
|
}
|
36
35
|
|
37
36
|
filters[filterClass] = value
|
38
|
-
|
37
|
+
|
38
|
+
const filtered = Object.keys(filters)
|
39
|
+
.filter(key => filters[key] !== '')
|
40
|
+
.reduce((obj, key) => {
|
41
|
+
obj[key] = filters[key];
|
42
|
+
return obj;
|
43
|
+
}, {});
|
44
|
+
|
45
|
+
let encodedFilters;
|
46
|
+
|
47
|
+
if (filtered && Object.keys(filtered).length > 0) {
|
48
|
+
encodedFilters = btoa(JSON.stringify(filtered))
|
49
|
+
}
|
39
50
|
|
40
51
|
const url = new URI(this.urlRedirectTarget.href)
|
41
52
|
|
42
53
|
const query = {
|
43
54
|
...url.query(true),
|
44
|
-
|
55
|
+
}
|
56
|
+
|
57
|
+
if (encodedFilters) {
|
58
|
+
query['filters'] = encodedFilters
|
59
|
+
} else {
|
60
|
+
delete query['filters']
|
45
61
|
}
|
46
62
|
|
47
63
|
url.query(query)
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,7 +3,11 @@ import { Controller } from 'stimulus'
|
|
3
3
|
export default class extends Controller {
|
4
4
|
static targets = ['selector']
|
5
5
|
|
6
|
+
get turboFrame() {
|
7
|
+
return this.selectorTarget.dataset.turboFrame
|
8
|
+
}
|
9
|
+
|
6
10
|
reload() {
|
7
|
-
document.querySelector(`[data-per-page-option="${this.selectorTarget.value}"]`).click()
|
11
|
+
document.querySelector(`[data-per-page-option="${this.selectorTarget.value}"][data-turbo-frame="${this.turboFrame}"]`).click()
|
8
12
|
}
|
9
13
|
}
|