avo 1.3.5.pre.1 → 1.4.2
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/{common → fields/common}/key_value_component.html.erb +0 -0
- data/app/components/avo/{common → fields/common}/key_value_component.rb +1 -1
- 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/fields/common/status_viewer_component.html.erb +18 -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/{edit/fields/key_value_field_component.html.erb → fields/key_value_field/edit_component.html.erb} +1 -1
- data/app/components/avo/fields/key_value_field/edit_component.rb +4 -0
- data/app/components/avo/{show/fields/key_value_field_component.html.erb → fields/key_value_field/show_component.html.erb} +1 -1
- 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/{edit/fields/trix_field_component.html.erb → fields/trix_field/edit_component.html.erb} +1 -2
- 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/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/js/controllers/fields/key_value_controller.js +0 -1
- data/app/packs/stylesheets/components/progress.css +13 -0
- data/app/packs/stylesheets/components/status.css +31 -20
- data/app/packs/svgs/check-circle-sm.svg +3 -0
- data/app/packs/svgs/x-circle-sm.svg +3 -0
- data/app/views/avo/actions/show.html.erb +1 -1
- data/app/views/avo/partials/_profile_dropdown.html.erb +19 -0
- data/app/views/layouts/avo/application.html.erb +6 -3
- 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/configuration.rb +1 -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 +4 -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 +5 -9
- 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/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/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-5bdca030.css → application-68691c73.css} +126 -50
- data/public/avo-packs/css/application-68691c73.css.br +0 -0
- data/public/avo-packs/css/application-68691c73.css.gz +0 -0
- data/public/avo-packs/css/application-68691c73.css.map +1 -0
- data/public/avo-packs/css/application-68691c73.css.map.br +0 -0
- data/public/avo-packs/css/application-68691c73.css.map.gz +0 -0
- data/public/avo-packs/js/application-6a0b9e58526ae6bef242.js +26 -0
- data/public/avo-packs/js/{application-16a456a2b7cb56b01153.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 +187 -167
- data/app/components/avo/common/files_list_viewer_component.html.erb +0 -5
- data/app/components/avo/common/status_viewer_component.html.erb +0 -10
- 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/key_value_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.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/key_value_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-5bdca030.css.br +0 -0
- data/public/avo-packs/css/application-5bdca030.css.gz +0 -0
- data/public/avo-packs/css/application-5bdca030.css.map +0 -1
- data/public/avo-packs/css/application-5bdca030.css.map.br +0 -0
- data/public/avo-packs/css/application-5bdca030.css.map.gz +0 -0
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js +0 -26
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js.br +0 -0
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js.gz +0 -0
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js.map +0 -1
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js.map.br +0 -0
- data/public/avo-packs/js/application-16a456a2b7cb56b01153.js.map.gz +0 -0
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
2
|
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
|
3
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
2
|
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
|
3
|
+
</svg>
|
@@ -21,7 +21,7 @@
|
|
21
21
|
|
22
22
|
<% if @action.get_fields.present? %>
|
23
23
|
<% @action.get_fields.each_with_index do |field, index| %>
|
24
|
-
<%=
|
24
|
+
<%= render field.component_for_view(:edit).new field: field, resource: @resource, index: index, form: form, displayed_in_modal: true %>
|
25
25
|
<% end %>
|
26
26
|
<% end %>
|
27
27
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div data-controller="toggle-panel">
|
2
|
+
<a href="javascript:void(0);" class="flex items-center cursor-pointer font-semibold text-gray-700" data-action="click->toggle-panel#togglePanel">
|
3
|
+
<% if _current_user.respond_to? 'avatar' %>
|
4
|
+
<%= image_tag _current_user.avatar, class: "h-12 rounded-full border-4 border-white mr-1" if _current_user.avatar.present? %>
|
5
|
+
<% end %>
|
6
|
+
<% if _current_user.name.present? %>
|
7
|
+
<%= _current_user.name %>
|
8
|
+
<% elsif _current_user.email.present? %>
|
9
|
+
<%= _current_user.email %>
|
10
|
+
<% else %>
|
11
|
+
Avo user
|
12
|
+
<% end %>
|
13
|
+
<%= svg 'chevron-down', class: "ml-1 h-4" %>
|
14
|
+
</a>
|
15
|
+
|
16
|
+
<div class="hidden absolute inset-auto inset-auto right-0 mr-6 mt-0 py-4 bg-white rounded-xl min-w-[200px] shadow-context" data-toggle-panel-target="panel">
|
17
|
+
<%= button_to "Sign out", main_app.destroy_user_session_path, method: :delete, form: { "data-turbo" => "false" }, class: "appearance-none bg-white text-left cursor-pointer text-green-600 font-semibold hover:text-white hover:bg-green-500 block px-4 py-1 w-full" %>
|
18
|
+
</div>
|
19
|
+
</div>
|
@@ -19,15 +19,18 @@
|
|
19
19
|
<%= render partial: 'avo/sidebar/sidebar' %>
|
20
20
|
|
21
21
|
<div class="flex-1 flex flex-col h-full overflow-auto">
|
22
|
-
<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'">
|
23
|
-
<div
|
22
|
+
<div class="relative bg-white p-2 shadow-md h-16 w-full flex flex-shrink-0 items-center z-50 px-6" v-if="layout !== 'blank'">
|
23
|
+
<div>
|
24
24
|
<%= render partial: "avo/partials/header" %>
|
25
25
|
</div>
|
26
26
|
<div class="flex-1 flex justify-center">
|
27
|
-
<div class="w-64">
|
27
|
+
<div class="w-64 flex">
|
28
28
|
<%# <resources-search :global="true"> %>
|
29
29
|
</div>
|
30
30
|
</div>
|
31
|
+
<div class="align-end">
|
32
|
+
<%= render partial: "avo/partials/profile_dropdown" %>
|
33
|
+
</div>
|
31
34
|
</div>
|
32
35
|
|
33
36
|
<div class="content p-8 flex-1 flex flex-col justify-between items-stretch <%= @container_classes %>">
|
data/config/webpacker.yml
CHANGED
@@ -35,8 +35,8 @@ development:
|
|
35
35
|
dev_server:
|
36
36
|
https: false
|
37
37
|
host: localhost
|
38
|
-
port:
|
39
|
-
public: localhost:
|
38
|
+
port: 7299
|
39
|
+
public: localhost:7299
|
40
40
|
# Inject browserside javascript that required by both HMR and Live(full) reload
|
41
41
|
inject_client: true
|
42
42
|
# Hot Module Replacement updates modules while the application is running without a full reload
|
data/db/factories.rb
CHANGED
@@ -13,6 +13,7 @@ FactoryBot.define do
|
|
13
13
|
name { Faker::Company.name }
|
14
14
|
description { Faker::Lorem.paragraph(sentence_count: 4) }
|
15
15
|
url { Faker::Internet.url }
|
16
|
+
color { Faker::Color.hex_color }
|
16
17
|
end
|
17
18
|
|
18
19
|
factory :post do
|
@@ -24,6 +25,7 @@ FactoryBot.define do
|
|
24
25
|
Time.now - rand(10...365).days
|
25
26
|
end
|
26
27
|
end
|
28
|
+
status { 0 }
|
27
29
|
end
|
28
30
|
|
29
31
|
factory :project do
|
@@ -36,5 +38,6 @@ FactoryBot.define do
|
|
36
38
|
users_required { Faker::Number.between(from: 10, to: 100) }
|
37
39
|
started_at { Time.now - rand(10...365).days }
|
38
40
|
meta { [{foo: "bar", hey: "hi"}, {bar: "baz"}, {hoho: "hohoho"}].sample }
|
41
|
+
progress { Faker::Number.between(from: 0, to: 100) }
|
39
42
|
end
|
40
43
|
end
|
data/lib/avo.rb
CHANGED
data/lib/avo/app.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
module Avo
|
2
2
|
class App
|
3
|
-
class_attribute :
|
4
|
-
|
5
|
-
cache_store: nil
|
6
|
-
}
|
3
|
+
class_attribute :resources, default: []
|
4
|
+
class_attribute :cache_store, default: nil
|
7
5
|
class_attribute :fields, default: []
|
8
6
|
class_attribute :request, default: nil
|
9
7
|
class_attribute :context, default: nil
|
@@ -16,9 +14,9 @@ module Avo
|
|
16
14
|
I18n.locale = Avo.configuration.language_code
|
17
15
|
|
18
16
|
if Rails.cache.instance_of?(ActiveSupport::Cache::NullStore)
|
19
|
-
|
17
|
+
self.cache_store ||= ActiveSupport::Cache::MemoryStore.new
|
20
18
|
else
|
21
|
-
|
19
|
+
self.cache_store = Rails.cache
|
22
20
|
end
|
23
21
|
end
|
24
22
|
|
@@ -38,10 +36,6 @@ module Avo
|
|
38
36
|
init_resources
|
39
37
|
end
|
40
38
|
|
41
|
-
def cache_store
|
42
|
-
app[:cache_store]
|
43
|
-
end
|
44
|
-
|
45
39
|
# This method will find all fields available in the Avo::Fields namespace and add them to the fields class_variable array
|
46
40
|
# so later we can instantiate them on our resources.
|
47
41
|
#
|
@@ -67,7 +61,7 @@ module Avo
|
|
67
61
|
end
|
68
62
|
|
69
63
|
def init_resources
|
70
|
-
|
64
|
+
self.resources = BaseResource.descendants
|
71
65
|
.select do |resource|
|
72
66
|
resource != BaseResource
|
73
67
|
end
|
@@ -78,15 +72,11 @@ module Avo
|
|
78
72
|
end
|
79
73
|
end
|
80
74
|
|
81
|
-
def get_resources
|
82
|
-
app[:resources]
|
83
|
-
end
|
84
|
-
|
85
75
|
# Returns the Avo resource by camelized name
|
86
76
|
#
|
87
77
|
# get_resource_by_name('User') => UserResource
|
88
78
|
def get_resource(resource)
|
89
|
-
|
79
|
+
resources.find do |available_resource|
|
90
80
|
"#{resource}Resource".safe_constantize == available_resource.class
|
91
81
|
end
|
92
82
|
end
|
@@ -103,7 +93,7 @@ module Avo
|
|
103
93
|
# get_resource_by_name('User') => UserResource
|
104
94
|
# get_resource_by_name(User) => UserResource
|
105
95
|
def get_resource_by_model_name(name)
|
106
|
-
|
96
|
+
resources.find do |resource|
|
107
97
|
resource.model_class.model_name.name == name.to_s
|
108
98
|
end
|
109
99
|
end
|
@@ -113,7 +103,7 @@ module Avo
|
|
113
103
|
# get_resource_by_controller_name('delayed_backend_active_record_jobs') => DelayedJobResource
|
114
104
|
# get_resource_by_controller_name('users') => UserResource
|
115
105
|
def get_resource_by_controller_name(name)
|
116
|
-
|
106
|
+
resources.find do |resource|
|
117
107
|
resource.model_class.to_s.pluralize.underscore.tr("/", "_") == name.to_s
|
118
108
|
end
|
119
109
|
end
|
@@ -126,8 +116,7 @@ module Avo
|
|
126
116
|
end
|
127
117
|
|
128
118
|
def get_available_resources(user = nil)
|
129
|
-
|
130
|
-
.select do |resource|
|
119
|
+
resources.select do |resource|
|
131
120
|
Services::AuthorizationService.authorize user, resource.model, Avo.configuration.authorization_methods.stringify_keys["index"], raise_exception: false
|
132
121
|
end
|
133
122
|
.sort_by { |r| r.name }
|
data/lib/avo/base_resource.rb
CHANGED
@@ -61,9 +61,17 @@ module Avo
|
|
61
61
|
def get_field_definitions
|
62
62
|
return [] if self.class.fields.blank?
|
63
63
|
|
64
|
-
self.class.fields.map do |field|
|
64
|
+
fields = self.class.fields.map do |field|
|
65
65
|
field.hydrate(resource: self, panel_name: default_panel_name, user: user)
|
66
66
|
end
|
67
|
+
|
68
|
+
if Avo::App.license.invalid? || Avo::App.license.lacks(:custom_fields)
|
69
|
+
fields = fields.reject do |field|
|
70
|
+
field.custom?
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
fields
|
67
75
|
end
|
68
76
|
|
69
77
|
def get_fields(panel: nil, reflection: nil)
|
data/lib/avo/configuration.rb
CHANGED
data/lib/avo/engine.rb
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
3
|
class BadgeField < BaseField
|
4
|
-
|
5
|
-
@defaults = {
|
6
|
-
partial_name: "badge-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 [:edit, :new]
|
12
10
|
|
13
11
|
default_options = {info: :info, success: :success, danger: :danger, warning: :warning}
|
14
|
-
@
|
12
|
+
@options = args[:options].present? ? default_options.merge(args[:options]) : default_options
|
15
13
|
end
|
16
14
|
end
|
17
15
|
end
|
@@ -5,91 +5,65 @@ module Avo
|
|
5
5
|
extend Avo::Fields::FieldExtensions::HasFieldName
|
6
6
|
include Avo::Fields::FieldExtensions::VisibleInDifferentViews
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
attr_accessor :options
|
8
|
+
attr_reader :id
|
9
|
+
attr_reader :name
|
10
|
+
attr_reader :translation_key
|
11
|
+
attr_reader :block
|
12
|
+
attr_reader :required
|
13
|
+
attr_reader :readonly
|
14
|
+
attr_reader :sortable
|
15
|
+
attr_reader :nullable
|
16
|
+
attr_reader :null_values
|
17
|
+
attr_reader :format_using
|
18
|
+
attr_reader :placeholder
|
19
|
+
attr_reader :help
|
20
|
+
attr_reader :default
|
21
|
+
attr_reader :visible
|
22
|
+
|
23
|
+
# Private options
|
24
|
+
attr_reader :updatable
|
25
|
+
attr_reader :computable # if allowed to be computable
|
26
|
+
attr_reader :computed # if block is present
|
27
|
+
attr_reader :computed_value # the value after computation
|
28
|
+
|
29
|
+
# Hydrated payload
|
30
|
+
attr_reader :model
|
31
|
+
attr_reader :view
|
32
|
+
attr_reader :resource
|
33
|
+
attr_reader :action
|
34
|
+
attr_reader :user
|
35
|
+
attr_reader :panel_name
|
37
36
|
|
38
37
|
class_attribute :field_name_attribute
|
39
38
|
|
40
|
-
|
41
|
-
|
42
|
-
def initialize(id, **args, &block)
|
39
|
+
def initialize(id, _options: {}, **args, &block)
|
43
40
|
super(id, **args, &block)
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
@
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
computed_value: false,
|
65
|
-
format_using: false,
|
66
|
-
placeholder: id.to_s.humanize,
|
67
|
-
help: nil,
|
68
|
-
default: nil,
|
69
|
-
visible: true,
|
70
|
-
meta: {},
|
71
|
-
panel_name: nil,
|
72
|
-
options: {}
|
73
|
-
}
|
74
|
-
|
75
|
-
# Set the values in the following order
|
76
|
-
# - app defaults
|
77
|
-
# - field defaults
|
78
|
-
# - field option
|
79
|
-
@field_properties.each do |name, default_value|
|
80
|
-
final_value = args[name.to_sym]
|
81
|
-
send("#{name}=", name != "null_values" && (final_value.nil? || !defined?(final_value)) ? default_value : final_value)
|
82
|
-
end
|
41
|
+
|
42
|
+
@id = id
|
43
|
+
@name = args[:name] || id.to_s.humanize(keep_id_suffix: true)
|
44
|
+
@translation_key = args[:translation_key]
|
45
|
+
@block = block
|
46
|
+
@required = args[:required] || false
|
47
|
+
@readonly = args[:readonly] || false
|
48
|
+
@sortable = args[:sortable] || false
|
49
|
+
@nullable = args[:nullable] || false
|
50
|
+
@null_values = args[:null_values] || [nil, ""]
|
51
|
+
@format_using = args[:format_using] || nil
|
52
|
+
@placeholder = args[:placeholder] || id.to_s.humanize(keep_id_suffix: true)
|
53
|
+
@help = args[:help] || nil
|
54
|
+
@default = args[:default] || nil
|
55
|
+
@visible = args[:visible] || true
|
56
|
+
|
57
|
+
@updatable = true
|
58
|
+
@computable = true
|
59
|
+
@computed = block.present?
|
60
|
+
@computed_value = nil
|
83
61
|
|
84
62
|
# Set the visibility
|
85
63
|
show_on args[:show_on] if args[:show_on].present?
|
86
64
|
hide_on args[:hide_on] if args[:hide_on].present?
|
87
65
|
only_on args[:only_on] if args[:only_on].present?
|
88
66
|
except_on args[:except_on] if args[:except_on].present?
|
89
|
-
|
90
|
-
if args[:use_partials].present?
|
91
|
-
@custom_partials = args[:use_partials]
|
92
|
-
end
|
93
67
|
end
|
94
68
|
|
95
69
|
def hydrate(model: nil, resource: nil, action: nil, view: nil, panel_name: nil, user: nil)
|
@@ -142,12 +116,6 @@ module Avo
|
|
142
116
|
model
|
143
117
|
end
|
144
118
|
|
145
|
-
def partial_path_for(view)
|
146
|
-
return @custom_partials[view] if @custom_partials.present? && @custom_partials[view].present?
|
147
|
-
|
148
|
-
"avo/fields/#{view}/#{partial_name}"
|
149
|
-
end
|
150
|
-
|
151
119
|
# Try to see if the field has a different database ID than it's name
|
152
120
|
def database_id(model)
|
153
121
|
foreign_key
|
@@ -167,8 +135,13 @@ module Avo
|
|
167
135
|
id.to_sym
|
168
136
|
end
|
169
137
|
|
170
|
-
def
|
171
|
-
"
|
138
|
+
def view_component_name
|
139
|
+
"#{type.classify}Field"
|
140
|
+
end
|
141
|
+
|
142
|
+
def component_for_view(view = :index)
|
143
|
+
# puts ['component_for_view->', "Avo::Fields::#{type.classify}Field::#{view.to_s.classify}Component"].inspect
|
144
|
+
"Avo::Fields::#{view_component_name}::#{view.to_s.classify}Component".safe_constantize
|
172
145
|
end
|
173
146
|
|
174
147
|
def model_errors
|
@@ -181,6 +154,12 @@ module Avo
|
|
181
154
|
self.class.name.demodulize.to_s.underscore.gsub("_field", "")
|
182
155
|
end
|
183
156
|
|
157
|
+
def custom?
|
158
|
+
!method(:initialize).source_location.first.include?("lib/avo/field")
|
159
|
+
rescue
|
160
|
+
true
|
161
|
+
end
|
162
|
+
|
184
163
|
private
|
185
164
|
|
186
165
|
def model_or_class(model)
|