avo 1.3.3 → 1.4.0
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.lock +4 -4
- data/README.md +1 -0
- data/app/components/avo/fields/badge_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/badge_field/index_component.rb +4 -0
- data/app/components/avo/fields/badge_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/badge_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/belongs_to_field_component.html.erb → fields/belongs_to_field/edit_component.html.erb} +0 -0
- data/app/components/avo/{edit/fields/belongs_to_field_component.rb → fields/belongs_to_field/edit_component.rb} +1 -1
- data/app/components/avo/{index/fields/belongs_to_field_component.html.erb → fields/belongs_to_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/belongs_to_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/belongs_to_field_component.html.erb → fields/belongs_to_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/belongs_to_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/boolean_field_component.html.erb → fields/boolean_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/boolean_field/edit_component.rb +4 -0
- data/app/components/avo/fields/boolean_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/boolean_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/boolean_field_component.html.erb → fields/boolean_field/show_component.html.erb} +1 -1
- data/app/components/avo/fields/boolean_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/boolean_group_field_component.html.erb → fields/boolean_group_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/boolean_group_field/edit_component.rb +4 -0
- data/app/components/avo/fields/boolean_group_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/boolean_group_field/index_component.rb +4 -0
- data/app/components/avo/fields/boolean_group_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/boolean_group_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/code_field_component.html.erb → fields/code_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/code_field/edit_component.rb +4 -0
- data/app/components/avo/{show/fields/code_field_component.html.erb → fields/code_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/code_field/show_component.rb +4 -0
- data/app/components/avo/{common → fields/common}/badge_viewer_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/badge_viewer_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/boolean_check_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/boolean_check_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/boolean_group_component.html.erb +1 -1
- data/app/components/avo/{common → fields/common}/boolean_group_component.rb +1 -1
- data/app/components/avo/fields/common/files_list_viewer_component.html.erb +5 -0
- data/app/components/avo/{common → fields/common}/files_list_viewer_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/gravatar_viewer_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/gravatar_viewer_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/heading_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/heading_component.rb +1 -1
- data/app/components/avo/fields/common/key_value_component.html.erb +53 -0
- data/app/components/avo/fields/common/key_value_component.rb +11 -0
- data/app/components/avo/{common → fields/common}/multiple_file_viewer_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/multiple_file_viewer_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/single_file_viewer_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/single_file_viewer_component.rb +1 -1
- data/app/components/avo/{common → fields/common}/status_viewer_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/status_viewer_component.rb +1 -1
- data/app/components/avo/{edit/fields/country_field_component.html.erb → fields/country_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/country_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/country_field_component.html.erb → fields/country_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/country_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/country_field_component.html.erb → fields/country_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/country_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/date_field_component.html.erb → fields/date_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/date_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/date_field_component.html.erb → fields/date_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/date_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/date_field_component.html.erb → fields/date_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/date_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/date_time_field_component.html.erb → fields/date_time_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/date_time_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/date_time_field_component.html.erb → fields/date_time_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/date_time_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/date_time_field_component.html.erb → fields/date_time_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/date_time_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/field_component.rb → fields/edit_component.rb} +1 -1
- data/app/components/avo/{edit/fields/external_image_field_component.html.erb → fields/external_image_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/external_image_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/external_image_field_component.html.erb → fields/external_image_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/external_image_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/external_image_field_component.html.erb → fields/external_image_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/external_image_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/file_field_component.html.erb → fields/file_field/edit_component.html.erb} +1 -1
- data/app/components/avo/fields/file_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/file_field_component.html.erb → fields/file_field/index_component.html.erb} +1 -1
- data/app/components/avo/fields/file_field/index_component.rb +4 -0
- data/app/components/avo/fields/file_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/file_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/files_field_component.html.erb → fields/files_field/edit_component.html.erb} +1 -1
- data/app/components/avo/fields/files_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/files_field_component.html.erb → fields/files_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/files_field/index_component.rb +4 -0
- data/app/components/avo/fields/files_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/files_field/show_component.rb +4 -0
- data/app/components/avo/{index/fields/gravatar_field_component.html.erb → fields/gravatar_field/index_component.html.erb} +2 -2
- data/app/components/avo/fields/gravatar_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/gravatar_field_component.html.erb → fields/gravatar_field/show_component.html.erb} +1 -1
- data/app/components/avo/fields/gravatar_field/show_component.rb +4 -0
- data/app/components/avo/{show/fields/has_many_field_component.html.erb → fields/has_many_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/has_many_field/show_component.rb +4 -0
- data/app/components/avo/{index/fields/has_one_field_component.html.erb → fields/has_one_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/has_one_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/has_one_field_component.html.erb → fields/has_one_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/has_one_field/show_component.rb +5 -0
- data/app/components/avo/{show/fields/heading_field_component.html.erb → fields/heading_field/edit_component.html.erb} +1 -1
- data/app/components/avo/fields/heading_field/edit_component.rb +4 -0
- data/app/components/avo/{edit/fields/heading_field_component.html.erb → fields/heading_field/show_component.html.erb} +1 -1
- data/app/components/avo/fields/heading_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/hidden_field_component.html.erb → fields/hidden_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/hidden_field/edit_component.rb +4 -0
- data/app/components/avo/{edit/fields/id_field_component.html.erb → fields/id_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/id_field/edit_component.rb +4 -0
- data/app/components/avo/fields/id_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/id_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/id_field_component.html.erb → fields/id_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/id_field/show_component.rb +4 -0
- data/app/components/avo/fields/index_component.rb +20 -0
- data/app/components/avo/fields/key_value_field/edit_component.html.erb +3 -0
- data/app/components/avo/fields/key_value_field/edit_component.rb +4 -0
- data/app/components/avo/fields/key_value_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/key_value_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/markdown_field_component.html.erb → fields/markdown_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/markdown_field/edit_component.rb +4 -0
- data/app/components/avo/{show/fields/markdown_field_component.html.erb → fields/markdown_field/show_component.html.erb} +1 -1
- data/app/components/avo/fields/markdown_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/number_field_component.html.erb → fields/number_field/edit_component.html.erb} +3 -3
- data/app/components/avo/fields/number_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/number_field_component.html.erb → fields/number_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/number_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/number_field_component.html.erb → fields/number_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/number_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/password_field_component.html.erb → fields/password_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/password_field/edit_component.rb +4 -0
- data/app/components/avo/fields/progress_bar_field/edit_component.html.erb +26 -0
- data/app/components/avo/fields/progress_bar_field/edit_component.rb +4 -0
- data/app/components/avo/fields/progress_bar_field/index_component.html.erb +8 -0
- data/app/components/avo/fields/progress_bar_field/index_component.rb +4 -0
- data/app/components/avo/fields/progress_bar_field/show_component.html.erb +8 -0
- data/app/components/avo/fields/progress_bar_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/select_field_component.html.erb → fields/select_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/select_field/edit_component.rb +4 -0
- data/app/components/avo/{index/fields/select_field_component.html.erb → fields/select_field/index_component.html.erb} +0 -0
- data/app/components/avo/fields/select_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/select_field_component.html.erb → fields/select_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/select_field/show_component.rb +4 -0
- data/app/components/avo/{show/fields/field_component.rb → fields/show_component.rb} +1 -1
- data/app/components/avo/{edit/fields/status_field_component.html.erb → fields/status_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/status_field/edit_component.rb +4 -0
- data/app/components/avo/fields/status_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/status_field/index_component.rb +4 -0
- data/app/components/avo/fields/status_field/show_component.html.erb +3 -0
- data/app/components/avo/fields/status_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/text_field_component.html.erb → fields/text_field/edit_component.html.erb} +0 -0
- data/app/components/avo/fields/text_field/edit_component.rb +4 -0
- data/app/components/avo/fields/text_field/index_component.html.erb +3 -0
- data/app/components/avo/fields/text_field/index_component.rb +4 -0
- data/app/components/avo/{show/fields/text_field_component.html.erb → fields/text_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/text_field/show_component.rb +4 -0
- data/app/components/avo/{edit/fields/textarea_field_component.html.erb → fields/textarea_field/edit_component.html.erb} +1 -1
- data/app/components/avo/fields/textarea_field/edit_component.rb +4 -0
- data/app/components/avo/{show/fields/textarea_field_component.html.erb → fields/textarea_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/textarea_field/show_component.rb +4 -0
- data/app/components/avo/fields/trix_field/edit_component.html.erb +19 -0
- data/app/components/avo/fields/trix_field/edit_component.rb +4 -0
- data/app/components/avo/{show/fields/trix_field_component.html.erb → fields/trix_field/show_component.html.erb} +0 -0
- data/app/components/avo/fields/trix_field/show_component.rb +4 -0
- data/app/components/avo/index/resource_controls_component.html.erb +2 -3
- data/app/components/avo/index/table_row_component.html.erb +1 -1
- data/app/components/avo/panel_component.html.erb +1 -1
- data/app/components/avo/panel_component.rb +4 -4
- data/app/components/avo/views/resource_edit_component.html.erb +2 -2
- data/app/components/avo/views/resource_index_component.html.erb +3 -3
- data/app/components/avo/views/resource_new_component.html.erb +2 -2
- data/app/components/avo/views/resource_show_component.html.erb +5 -5
- data/app/controllers/avo/application_controller.rb +5 -1
- data/app/controllers/avo/attachments_controller.rb +14 -3
- data/app/controllers/avo/base_controller.rb +26 -2
- data/app/controllers/avo/home_controller.rb +1 -1
- data/app/controllers/avo/search_controller.rb +1 -1
- data/app/helpers/avo/application_helper.rb +1 -1
- data/app/helpers/avo/resources_helper.rb +0 -44
- data/app/packs/entrypoints/application.css +1 -0
- data/app/packs/entrypoints/application.js +14 -11
- data/app/packs/js/controllers/fields/code_field_controller.js +1 -0
- data/app/packs/js/controllers/fields/date_field_controller.js +1 -1
- data/app/packs/js/controllers/fields/key_value_controller.js +136 -0
- data/app/packs/js/controllers/fields/trix_field_controller.js +121 -0
- data/app/packs/stylesheets/components/progress.css +13 -0
- data/app/views/avo/actions/show.html.erb +1 -1
- data/app/views/avo/partials/_javascript.html.erb +3 -1
- data/app/views/avo/partials/_profile_dropdown.html.erb +19 -0
- data/app/views/layouts/avo/application.html.erb +6 -3
- data/config/routes.rb +4 -0
- data/config/webpacker.yml +2 -2
- data/db/factories.rb +3 -0
- data/db/migrate/20210421064037_add_color_to_teams.rb +5 -0
- data/db/migrate/20210423075924_add_progress_to_projects.rb +5 -0
- data/lib/avo.rb +1 -1
- data/lib/avo/app.rb +9 -20
- data/lib/avo/base_resource.rb +9 -1
- data/lib/avo/engine.rb +1 -0
- data/lib/avo/fields/badge_field.rb +4 -6
- data/lib/avo/fields/base_field.rb +62 -83
- data/lib/avo/fields/belongs_to_field.rb +11 -11
- data/lib/avo/fields/boolean_field.rb +2 -7
- data/lib/avo/fields/boolean_group_field.rb +2 -7
- data/lib/avo/fields/code_field.rb +3 -7
- data/lib/avo/fields/country_field.rb +3 -6
- data/lib/avo/fields/currency_field.rb +4 -13
- data/lib/avo/fields/date_field.rb +2 -8
- data/lib/avo/fields/date_time_field.rb +2 -3
- data/lib/avo/fields/external_image_field.rb +2 -7
- data/lib/avo/fields/file_field.rb +4 -8
- data/lib/avo/fields/files_field.rb +6 -8
- data/lib/avo/fields/gravatar_field.rb +6 -9
- data/lib/avo/fields/has_and_belongs_to_many_field.rb +6 -7
- data/lib/avo/fields/has_many_field.rb +3 -9
- data/lib/avo/fields/has_one_field.rb +3 -8
- data/lib/avo/fields/heading_field.rb +10 -8
- data/lib/avo/fields/hidden_field.rb +2 -6
- data/lib/avo/fields/id_field.rb +5 -17
- data/lib/avo/fields/key_value_field.rb +27 -6
- data/lib/avo/fields/markdown_field.rb +3 -5
- data/lib/avo/fields/number_field.rb +8 -11
- data/lib/avo/fields/password_field.rb +2 -6
- data/lib/avo/fields/progress_bar_field.rb +19 -0
- data/lib/avo/fields/select_field.rb +13 -12
- data/lib/avo/fields/status_field.rb +2 -6
- data/lib/avo/fields/text_field.rb +3 -6
- data/lib/avo/fields/textarea_field.rb +4 -7
- data/lib/avo/fields/trix_field.rb +7 -7
- data/lib/avo/fields_collector.rb +47 -11
- data/lib/avo/licensing/pro_license.rb +2 -1
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/action_generator.rb +1 -1
- data/lib/generators/avo/eject_generator.rb +1 -0
- data/lib/generators/avo/field_generator.rb +17 -0
- data/lib/generators/avo/filter_generator.rb +1 -1
- data/lib/generators/avo/templates/action.tt +5 -9
- data/lib/generators/avo/templates/field/%singular_name%_field.rb.tt +5 -0
- data/lib/generators/avo/templates/field/components/edit_component.html.erb.tt +6 -0
- data/lib/generators/avo/templates/field/components/edit_component.rb.tt +4 -0
- data/lib/generators/avo/templates/field/components/index_component.html.erb.tt +3 -0
- data/lib/generators/avo/templates/field/components/index_component.rb.tt +4 -0
- data/lib/generators/avo/templates/field/components/show_component.html.erb.tt +3 -0
- data/lib/generators/avo/templates/field/components/show_component.rb.tt +4 -0
- data/lib/generators/avo/templates/tool/view.tt +1 -1
- data/public/avo-packs/css/{application-af3e670d.css → application-cb627e0b.css} +179 -43
- data/public/avo-packs/css/application-cb627e0b.css.br +0 -0
- data/public/avo-packs/css/application-cb627e0b.css.gz +0 -0
- data/public/avo-packs/css/application-cb627e0b.css.map +1 -0
- data/public/avo-packs/css/application-cb627e0b.css.map.br +0 -0
- data/public/avo-packs/css/application-cb627e0b.css.map.gz +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js +26 -0
- data/public/avo-packs/js/{application-801f1297670a4c6df1b6.js.LICENSE.txt → application-6a0b9e58526ae6bef242.js.LICENSE.txt} +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js.br +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js.gz +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js.map +1 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js.map.br +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +15 -15
- metadata +185 -159
- data/app/components/avo/common/files_list_viewer_component.html.erb +0 -5
- data/app/components/avo/edit/fields/boolean_field_component.rb +0 -4
- data/app/components/avo/edit/fields/boolean_group_field_component.rb +0 -4
- data/app/components/avo/edit/fields/code_field_component.rb +0 -4
- data/app/components/avo/edit/fields/country_field_component.rb +0 -4
- data/app/components/avo/edit/fields/date_field_component.rb +0 -4
- data/app/components/avo/edit/fields/date_time_field_component.rb +0 -4
- data/app/components/avo/edit/fields/external_image_field_component.rb +0 -4
- data/app/components/avo/edit/fields/file_field_component.rb +0 -4
- data/app/components/avo/edit/fields/files_field_component.rb +0 -4
- data/app/components/avo/edit/fields/heading_field_component.rb +0 -4
- data/app/components/avo/edit/fields/hidden_field_component.rb +0 -4
- data/app/components/avo/edit/fields/id_field_component.rb +0 -4
- data/app/components/avo/edit/fields/markdown_field_component.rb +0 -4
- data/app/components/avo/edit/fields/number_field_component.rb +0 -4
- data/app/components/avo/edit/fields/password_field_component.rb +0 -4
- data/app/components/avo/edit/fields/select_field_component.rb +0 -4
- data/app/components/avo/edit/fields/status_field_component.rb +0 -4
- data/app/components/avo/edit/fields/text_field_component.rb +0 -4
- data/app/components/avo/edit/fields/textarea_field_component.rb +0 -4
- data/app/components/avo/edit/fields/trix_field_component.html.erb +0 -11
- data/app/components/avo/edit/fields/trix_field_component.rb +0 -4
- data/app/components/avo/index/fields/badge_field_component.html.erb +0 -3
- data/app/components/avo/index/fields/badge_field_component.rb +0 -4
- data/app/components/avo/index/fields/belongs_to_field_component.rb +0 -4
- data/app/components/avo/index/fields/boolean_field_component.html.erb +0 -3
- data/app/components/avo/index/fields/boolean_field_component.rb +0 -4
- data/app/components/avo/index/fields/boolean_group_field_component.html.erb +0 -3
- data/app/components/avo/index/fields/boolean_group_field_component.rb +0 -4
- data/app/components/avo/index/fields/country_field_component.rb +0 -4
- data/app/components/avo/index/fields/date_field_component.rb +0 -4
- data/app/components/avo/index/fields/date_time_field_component.rb +0 -4
- data/app/components/avo/index/fields/external_image_field_component.rb +0 -4
- data/app/components/avo/index/fields/field_component.html.erb +0 -1
- data/app/components/avo/index/fields/field_component.rb +0 -11
- data/app/components/avo/index/fields/file_field_component.rb +0 -4
- data/app/components/avo/index/fields/files_field_component.rb +0 -4
- data/app/components/avo/index/fields/gravatar_field_component.rb +0 -4
- data/app/components/avo/index/fields/has_one_field_component.rb +0 -4
- data/app/components/avo/index/fields/id_field_component.html.erb +0 -10
- data/app/components/avo/index/fields/id_field_component.rb +0 -4
- data/app/components/avo/index/fields/number_field_component.rb +0 -4
- data/app/components/avo/index/fields/select_field_component.rb +0 -4
- data/app/components/avo/index/fields/status_field_component.html.erb +0 -3
- data/app/components/avo/index/fields/status_field_component.rb +0 -4
- data/app/components/avo/index/fields/text_field_component.html.erb +0 -3
- data/app/components/avo/index/fields/text_field_component.rb +0 -4
- data/app/components/avo/show/fields/badge_field_component.html.erb +0 -3
- data/app/components/avo/show/fields/badge_field_component.rb +0 -4
- data/app/components/avo/show/fields/belongs_to_field_component.rb +0 -4
- data/app/components/avo/show/fields/boolean_field_component.rb +0 -4
- data/app/components/avo/show/fields/boolean_group_field_component.html.erb +0 -3
- data/app/components/avo/show/fields/boolean_group_field_component.rb +0 -4
- data/app/components/avo/show/fields/code_field_component.rb +0 -4
- data/app/components/avo/show/fields/country_field_component.rb +0 -4
- data/app/components/avo/show/fields/date_field_component.rb +0 -4
- data/app/components/avo/show/fields/date_time_field_component.rb +0 -4
- data/app/components/avo/show/fields/external_image_field_component.rb +0 -4
- data/app/components/avo/show/fields/file_field_component.html.erb +0 -3
- data/app/components/avo/show/fields/file_field_component.rb +0 -4
- data/app/components/avo/show/fields/files_field_component.html.erb +0 -3
- data/app/components/avo/show/fields/files_field_component.rb +0 -4
- data/app/components/avo/show/fields/gravatar_field_component.rb +0 -4
- data/app/components/avo/show/fields/has_many_field_component.rb +0 -4
- data/app/components/avo/show/fields/has_one_field_component.rb +0 -5
- data/app/components/avo/show/fields/heading_field_component.rb +0 -4
- data/app/components/avo/show/fields/id_field_component.rb +0 -4
- data/app/components/avo/show/fields/markdown_field_component.rb +0 -4
- data/app/components/avo/show/fields/number_field_component.rb +0 -4
- data/app/components/avo/show/fields/select_field_component.rb +0 -4
- data/app/components/avo/show/fields/status_field_component.html.erb +0 -3
- data/app/components/avo/show/fields/status_field_component.rb +0 -4
- data/app/components/avo/show/fields/text_field_component.rb +0 -4
- data/app/components/avo/show/fields/textarea_field_component.rb +0 -4
- data/app/components/avo/show/fields/trix_field_component.rb +0 -4
- data/public/avo-packs/css/application-af3e670d.css.br +0 -0
- data/public/avo-packs/css/application-af3e670d.css.gz +0 -0
- data/public/avo-packs/css/application-af3e670d.css.map +0 -1
- data/public/avo-packs/css/application-af3e670d.css.map.br +0 -0
- data/public/avo-packs/css/application-af3e670d.css.map.gz +0 -0
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js +0 -26
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.br +0 -0
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.gz +0 -0
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.map +0 -1
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.map.br +0 -0
- data/public/avo-packs/js/application-801f1297670a4c6df1b6.js.map.gz +0 -0
@@ -1,24 +1,15 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class CurrencyField < BaseField
|
4
|
-
|
5
|
-
|
6
|
-
partial_name: "currency-field",
|
7
|
-
computable: true
|
8
|
-
}
|
4
|
+
attr_reader :currency
|
5
|
+
attr_reader :locale
|
9
6
|
|
10
|
-
|
7
|
+
def initialize(id, **args, &block)
|
8
|
+
super(id, **args, &block)
|
11
9
|
|
12
10
|
@currency = args[:currency].present? ? args[:currency].to_s : Avo.configuration.currency
|
13
11
|
@locale = args[:locale].present? ? args[:locale].to_s : Avo.configuration.locale
|
14
12
|
end
|
15
|
-
|
16
|
-
def hydrate_field(fields, model, resource, view)
|
17
|
-
{
|
18
|
-
currency: @currency,
|
19
|
-
locale: @locale
|
20
|
-
}
|
21
|
-
end
|
22
13
|
end
|
23
14
|
end
|
24
15
|
end
|
@@ -4,20 +4,14 @@ module Avo
|
|
4
4
|
attr_reader :first_day_of_week
|
5
5
|
attr_reader :picker_format
|
6
6
|
attr_reader :format
|
7
|
-
attr_reader :placeholder
|
8
7
|
attr_reader :relative
|
9
8
|
|
10
|
-
def initialize(
|
11
|
-
|
12
|
-
partial_name: "date-field"
|
13
|
-
}
|
14
|
-
|
15
|
-
super(name, **args, &block)
|
9
|
+
def initialize(id, **args, &block)
|
10
|
+
super(id, **args, &block)
|
16
11
|
|
17
12
|
@first_day_of_week = args[:first_day_of_week].present? ? args[:first_day_of_week].to_i : 0
|
18
13
|
@picker_format = args[:picker_format].present? ? args[:picker_format] : "Y-m-d"
|
19
14
|
@format = args[:format].present? ? args[:format] : :long
|
20
|
-
@placeholder = args[:placeholder].present? ? args[:placeholder] : ""
|
21
15
|
@relative = args[:relative].present? ? args[:relative] : false
|
22
16
|
end
|
23
17
|
|
@@ -5,10 +5,9 @@ module Avo
|
|
5
5
|
attr_reader :time_24hr
|
6
6
|
attr_reader :timezone
|
7
7
|
|
8
|
-
def initialize(
|
9
|
-
super(
|
8
|
+
def initialize(id, **args, &block)
|
9
|
+
super(id, **args, &block)
|
10
10
|
|
11
|
-
@partial_name = "date-time-field"
|
12
11
|
@picker_format = args[:picker_format].present? ? args[:picker_format] : "Y-m-d H:i:S"
|
13
12
|
@time_24hr = args[:time_24hr].present? ? args[:time_24hr] : false
|
14
13
|
@timezone = args[:timezone].present? ? args[:timezone] : Rails.application.config.time_zone
|
@@ -5,13 +5,8 @@ module Avo
|
|
5
5
|
attr_reader :height
|
6
6
|
attr_reader :radius
|
7
7
|
|
8
|
-
def initialize(
|
9
|
-
|
10
|
-
partial_name: "external-image-field",
|
11
|
-
computable: true
|
12
|
-
}.merge(@defaults || {})
|
13
|
-
|
14
|
-
super(name, **args, &block)
|
8
|
+
def initialize(id, **args, &block)
|
9
|
+
super(id, **args, &block)
|
15
10
|
|
16
11
|
@link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
|
17
12
|
|
@@ -1,20 +1,16 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class FileField < BaseField
|
4
|
+
attr_accessor :link_to_resource
|
4
5
|
attr_accessor :is_avatar
|
5
6
|
attr_accessor :is_image
|
6
7
|
|
7
|
-
def initialize(
|
8
|
-
|
9
|
-
partial_name: "file-field"
|
10
|
-
}.merge(@defaults || {})
|
8
|
+
def initialize(id, **args, &block)
|
9
|
+
super(id, **args, &block)
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
@file_field = true
|
11
|
+
@link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
|
15
12
|
@is_avatar = args[:is_avatar].present? ? args[:is_avatar] : false
|
16
13
|
@is_image = args[:is_image].present? ? args[:is_image] : @is_avatar
|
17
|
-
@link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
|
18
14
|
end
|
19
15
|
|
20
16
|
def path
|
@@ -3,18 +3,16 @@ module Avo
|
|
3
3
|
class FilesField < BaseField
|
4
4
|
attr_accessor :is_image
|
5
5
|
|
6
|
-
def initialize(
|
7
|
-
|
8
|
-
partial_name: "files-field"
|
9
|
-
}.merge(@defaults || {})
|
6
|
+
def initialize(id, **args, &block)
|
7
|
+
super(id, **args, &block)
|
10
8
|
|
11
|
-
super(name, **args, &block)
|
12
|
-
|
13
|
-
@is_array_param = true
|
14
|
-
@file_field = true
|
15
9
|
@is_image = args[:is_image].present? ? args[:is_image] : @is_avatar
|
16
10
|
end
|
17
11
|
|
12
|
+
def view_component_name
|
13
|
+
"FilesField"
|
14
|
+
end
|
15
|
+
|
18
16
|
def to_permitted_param
|
19
17
|
{"#{id}": []}
|
20
18
|
end
|
@@ -4,25 +4,22 @@ require "erb"
|
|
4
4
|
module Avo
|
5
5
|
module Fields
|
6
6
|
class GravatarField < BaseField
|
7
|
-
attr_reader :
|
7
|
+
attr_reader :link_to_resource
|
8
8
|
attr_reader :rounded
|
9
|
+
attr_reader :size
|
9
10
|
attr_reader :default
|
10
11
|
|
11
|
-
def initialize(
|
12
|
-
|
13
|
-
partial_name: "gravatar-field",
|
14
|
-
name: "Avatar",
|
15
|
-
id: args[:id].present? ? args[:id] : "email"
|
16
|
-
}
|
12
|
+
def initialize(id, **args, &block)
|
13
|
+
args[:name] ||= "Avatar"
|
17
14
|
|
18
|
-
super(
|
15
|
+
super(id, **args, &block)
|
19
16
|
|
20
17
|
hide_on [:edit, :new]
|
21
18
|
|
19
|
+
@link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
|
22
20
|
@rounded = args[:rounded].present? ? args[:rounded] : true
|
23
21
|
@size = args[:size].present? ? args[:size].to_i : 40
|
24
22
|
@default = args[:default].present? ? ERB::Util.url_encode(args[:default]).to_s : ""
|
25
|
-
@link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
|
26
23
|
end
|
27
24
|
|
28
25
|
def md5
|
@@ -1,18 +1,17 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class HasAndBelongsToManyField < BaseField
|
4
|
-
def initialize(
|
5
|
-
|
6
|
-
updatable: false,
|
7
|
-
partial_name: "has-many-field"
|
8
|
-
}
|
4
|
+
def initialize(id, **args, &block)
|
5
|
+
args[:updatable] = false
|
9
6
|
|
10
|
-
super(
|
7
|
+
super(id, **args, &block)
|
11
8
|
|
12
9
|
hide_on :all
|
13
10
|
show_on :show
|
11
|
+
end
|
14
12
|
|
15
|
-
|
13
|
+
def view_component_name
|
14
|
+
"HasManyField"
|
16
15
|
end
|
17
16
|
|
18
17
|
def turbo_frame
|
@@ -1,19 +1,13 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class HasManyField < BaseField
|
4
|
-
def initialize(
|
5
|
-
|
6
|
-
updatable: false,
|
7
|
-
partial_name: "has-many-field"
|
8
|
-
}
|
9
|
-
@through = args[:through]
|
4
|
+
def initialize(id, **args, &block)
|
5
|
+
args[:updatable] = false
|
10
6
|
|
11
|
-
super(
|
7
|
+
super(id, **args, &block)
|
12
8
|
|
13
9
|
hide_on :all
|
14
10
|
show_on :show
|
15
|
-
|
16
|
-
@resource = args[:resource]
|
17
11
|
end
|
18
12
|
|
19
13
|
def turbo_frame
|
@@ -4,17 +4,12 @@ module Avo
|
|
4
4
|
attr_accessor :relation_method
|
5
5
|
attr_accessor :display
|
6
6
|
|
7
|
-
def initialize(
|
8
|
-
|
9
|
-
updatable: true,
|
10
|
-
partial_name: "has-one-field"
|
11
|
-
}
|
12
|
-
|
13
|
-
super(name, **args, &block)
|
7
|
+
def initialize(id, **args, &block)
|
8
|
+
super(id, **args, &block)
|
14
9
|
|
15
10
|
hide_on :new, :edit
|
16
11
|
|
17
|
-
@placeholder
|
12
|
+
@placeholder ||= I18n.t "avo.choose_an_option"
|
18
13
|
|
19
14
|
@relation_method = name.to_s.parameterize.underscore
|
20
15
|
@display = args[:display].present? ? args[:display] : :show
|
@@ -1,18 +1,20 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class HeadingField < BaseField
|
4
|
-
|
5
|
-
@defaults = {
|
6
|
-
updatable: false,
|
7
|
-
partial_name: "heading-field",
|
8
|
-
id: "heading_" + name.to_s.parameterize.underscore
|
9
|
-
}
|
4
|
+
attr_reader :as_html
|
10
5
|
|
11
|
-
|
6
|
+
def initialize(content, **args, &block)
|
7
|
+
args[:updatable] = false
|
8
|
+
|
9
|
+
super(content, **args, &block)
|
12
10
|
|
13
11
|
hide_on :index
|
14
12
|
|
15
|
-
@
|
13
|
+
@as_html = args[:as_html].present? ? args[:as_html] : false
|
14
|
+
end
|
15
|
+
|
16
|
+
def id
|
17
|
+
"heading_#{name.to_s.parameterize.underscore}"
|
16
18
|
end
|
17
19
|
end
|
18
20
|
end
|
@@ -1,12 +1,8 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class HiddenField < TextField
|
4
|
-
def initialize(
|
5
|
-
|
6
|
-
partial_name: "hidden-field"
|
7
|
-
}
|
8
|
-
|
9
|
-
super(name, **args, &block)
|
4
|
+
def initialize(id, **args, &block)
|
5
|
+
super(id, **args, &block)
|
10
6
|
|
11
7
|
only_on [:edit, :new]
|
12
8
|
end
|
data/lib/avo/fields/id_field.rb
CHANGED
@@ -1,27 +1,15 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class IdField < BaseField
|
4
|
-
|
5
|
-
default_value = "id"
|
4
|
+
attr_reader :link_to_resource
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
args_copy = name
|
11
|
-
@name = name = default_value
|
12
|
-
args = args_copy
|
13
|
-
end
|
14
|
-
|
15
|
-
@defaults = {
|
16
|
-
id: name.to_sym,
|
17
|
-
readonly: true,
|
18
|
-
sortable: true,
|
19
|
-
partial_name: "id-field"
|
20
|
-
}
|
6
|
+
def initialize(id, **args, &block)
|
7
|
+
args[:readonly] = true
|
8
|
+
args[:sortable] = true
|
21
9
|
|
22
10
|
hide_on [:edit, :new]
|
23
11
|
|
24
|
-
super(
|
12
|
+
super(id, **args, &block)
|
25
13
|
|
26
14
|
@link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
|
27
15
|
end
|
@@ -3,12 +3,15 @@ require "json"
|
|
3
3
|
module Avo
|
4
4
|
module Fields
|
5
5
|
class KeyValueField < BaseField
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
attr_reader :key_label
|
7
|
+
attr_reader :value_label
|
8
|
+
attr_reader :action_text
|
9
|
+
attr_reader :delete_text
|
10
|
+
attr_reader :disable_editing_keys
|
11
|
+
attr_reader :disable_adding_rows
|
10
12
|
|
11
|
-
|
13
|
+
def initialize(id, **args, &block)
|
14
|
+
super(id, **args, &block)
|
12
15
|
|
13
16
|
hide_on :index
|
14
17
|
|
@@ -33,7 +36,13 @@ module Avo
|
|
33
36
|
[:"#{id}", "#{id}": {}]
|
34
37
|
end
|
35
38
|
|
36
|
-
def
|
39
|
+
def parsed_value
|
40
|
+
value.to_json
|
41
|
+
rescue
|
42
|
+
{}
|
43
|
+
end
|
44
|
+
|
45
|
+
def options
|
37
46
|
{
|
38
47
|
key_label: @key_label,
|
39
48
|
value_label: @value_label,
|
@@ -44,6 +53,18 @@ module Avo
|
|
44
53
|
disable_deleting_rows: @disable_deleting_rows
|
45
54
|
}
|
46
55
|
end
|
56
|
+
|
57
|
+
def fill_field(model, key, value)
|
58
|
+
begin
|
59
|
+
new_value = JSON.parse(value)
|
60
|
+
rescue
|
61
|
+
new_value = {}
|
62
|
+
end
|
63
|
+
|
64
|
+
model[key] = new_value
|
65
|
+
|
66
|
+
model
|
67
|
+
end
|
47
68
|
end
|
48
69
|
end
|
49
70
|
end
|
@@ -1,12 +1,10 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class MarkdownField < BaseField
|
4
|
-
|
5
|
-
@defaults = {
|
6
|
-
partial_name: "markdown-field"
|
7
|
-
}
|
4
|
+
attr_reader :options
|
8
5
|
|
9
|
-
|
6
|
+
def initialize(id, **args, &block)
|
7
|
+
super(id, **args, &block)
|
10
8
|
|
11
9
|
hide_on :index
|
12
10
|
|
@@ -1,19 +1,16 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class NumberField < TextField
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
computable: true
|
8
|
-
}
|
4
|
+
attr_reader :min
|
5
|
+
attr_reader :max
|
6
|
+
attr_reader :step
|
9
7
|
|
10
|
-
|
8
|
+
def initialize(id, **args, &block)
|
9
|
+
super(id, **args, &block)
|
11
10
|
|
12
|
-
@
|
13
|
-
|
14
|
-
|
15
|
-
step: args[:step].present? ? args[:step].to_f : nil
|
16
|
-
}
|
11
|
+
@min = args[:min].present? ? args[:min].to_f : nil
|
12
|
+
@max = args[:max].present? ? args[:max].to_f : nil
|
13
|
+
@step = args[:step].present? ? args[:step].to_f : nil
|
17
14
|
end
|
18
15
|
end
|
19
16
|
end
|
@@ -1,14 +1,10 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class PasswordField < TextField
|
4
|
-
def initialize(
|
5
|
-
@defaults = {
|
6
|
-
partial_name: "password-field"
|
7
|
-
}
|
8
|
-
|
4
|
+
def initialize(id, **args, &block)
|
9
5
|
show_on :forms
|
10
6
|
|
11
|
-
super(
|
7
|
+
super(id, **args, &block)
|
12
8
|
|
13
9
|
hide_on [:index, :show]
|
14
10
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Avo
|
2
|
+
module Fields
|
3
|
+
class ProgressBarField < BaseField
|
4
|
+
attr_reader :max
|
5
|
+
attr_reader :step
|
6
|
+
attr_reader :display_value
|
7
|
+
attr_reader :value_suffix
|
8
|
+
|
9
|
+
def initialize(name, **args, &block)
|
10
|
+
super(name, **args, &block)
|
11
|
+
|
12
|
+
@max = args[:max] || 100
|
13
|
+
@step = args[:step] || 1
|
14
|
+
@display_value = args[:display_value] || false
|
15
|
+
@value_suffix = args[:value_suffix] || nil
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|